Fixed compilation warnings on Mono 3.4.0

This commit is contained in:
thefiddler 2014-07-21 17:46:39 +02:00
parent 7a064c382a
commit 00b531fdef
22 changed files with 42 additions and 33 deletions

View file

@ -458,6 +458,8 @@ namespace OpenTK.Graphics.ES20
#endregion
}
#pragma warning disable 1574 // XML comment cref attribute could not be resolved, compiler bug in Mono 3.4.0
/// <summary>
/// Defines the signature of a debug callback for
/// <see cref="GL.DebugMessageCallback"/>.
@ -491,4 +493,6 @@ namespace OpenTK.Graphics.ES20
DebugSource source, DebugType type, int id,
DebugSeverity severity, int length, IntPtr message,
IntPtr userParam);
#pragma warning restore 1574 // XML comment cref attribute could not be resolved, compiler bug in Mono 3.4.0
}

View file

@ -449,6 +449,8 @@ namespace OpenTK.Graphics.ES30
#endregion
}
#pragma warning disable 1574 // XML comment cref attribute could not be resolved, compiler bug in Mono 3.4.0
/// <summary>
/// Defines the signature of a debug callback for
/// <see cref="GL.DebugMessageCallback"/>.
@ -482,4 +484,6 @@ namespace OpenTK.Graphics.ES30
DebugSource source, DebugType type, int id,
DebugSeverity severity, int length, IntPtr message,
IntPtr userParam);
#pragma warning restore 1574 // XML comment cref attribute could not be resolved, compiler bug in Mono 3.4.0
}

View file

@ -121,7 +121,7 @@ namespace OpenTK.Graphics
Debug.Print("GraphicsContextFlags: {0}", flags);
Debug.Print("Requested version: {0}.{1}", major, minor);
IGraphicsContext shareContext = shareContext = FindSharedContext();
IGraphicsContext shareContext = FindSharedContext();
// Todo: Add a DummyFactory implementing IPlatformFactory.
if (designMode)

View file

@ -1355,6 +1355,8 @@ namespace OpenTK.Graphics.OpenGL
#endregion
}
#pragma warning disable 1574 // XML comment cref attribute could not be resolved, compiler bug in Mono 3.4.0
/// <summary>
/// Defines the signature of a debug callback for
/// <see cref="GL.Amd.DebugMessageCallback"/>.
@ -1420,4 +1422,6 @@ namespace OpenTK.Graphics.OpenGL
DebugSource source, DebugType type, int id,
DebugSeverity severity, int length, IntPtr message,
IntPtr userParam);
#pragma warning restore 1574 // XML comment cref attribute could not be resolved, compiler bug in Mono 3.4.0
}

View file

@ -458,6 +458,8 @@ namespace OpenTK.Graphics.OpenGL4
#endregion
}
#pragma warning disable 1574 // XML comment cref attribute could not be resolved, compiler bug in Mono 3.4.0
/// <summary>
/// Defines the signature of a debug callback for
/// <see cref="GL.Arb.DebugMessageCallback"/>.
@ -508,4 +510,6 @@ namespace OpenTK.Graphics.OpenGL4
DebugSource source, DebugType type, int id,
DebugSeverity severity, int length, IntPtr message,
IntPtr userParam);
#pragma warning restore 1574 // XML comment cref attribute could not be resolved, compiler bug in Mono 3.4.0
}

View file

@ -231,7 +231,6 @@ namespace OpenTK.Input
#region Fields
MouseButton button;
bool pressed;
#endregion
@ -253,7 +252,6 @@ namespace OpenTK.Input
: base(x, y)
{
this.button = button;
this.pressed = pressed;
}
/// <summary>

View file

@ -73,6 +73,8 @@ namespace OpenTK
#region Properties
#pragma warning disable 3005 // Identifier differing only in case is not CLS-compliant, compiler bug in Mono 3.4.0
/// <summary>
/// Gets or sets an OpenTK.Vector3 with the X, Y and Z components of this instance.
/// </summary>
@ -88,6 +90,8 @@ namespace OpenTK
[CLSCompliant(false)]
public Vector3 Xyz { get { return xyz; } set { xyz = value; } }
#pragma warning restore 3005
/// <summary>
/// Gets or sets the X component of this instance.
/// </summary>

View file

@ -73,6 +73,8 @@ namespace OpenTK
#region Properties
#pragma warning disable 3005 // Identifier differing only in case is not CLS-compliant, compiler bug in Mono 3.4.0
/// <summary>
/// Gets or sets an OpenTK.Vector3d with the X, Y and Z components of this instance.
/// </summary>
@ -87,6 +89,8 @@ namespace OpenTK
/// </summary>
public Vector3d Xyz { get { return xyz; } set { xyz = value; } }
#pragma warning restore 3005
/// <summary>
/// Gets or sets the X component of this instance.
/// </summary>

View file

@ -83,7 +83,7 @@ namespace OpenTK.Platform.MacOS
// Disable momentum scrolling and long-press key pop-ups
IntPtr settings = Cocoa.SendIntPtr(Class.NSDictionary, Selector.Alloc);
IntPtr momentum_scrolling = Cocoa.SendIntPtr(Class.NSNumber, Selector.Get("numberWithBool:"), false);
//IntPtr momentum_scrolling = Cocoa.SendIntPtr(Class.NSNumber, Selector.Get("numberWithBool:"), false);
IntPtr press_and_hold = Cocoa.SendIntPtr(Class.NSNumber, Selector.Get("numberWithBool:"), false);
// Initialize and register the settings dictionary

View file

@ -561,7 +561,6 @@ namespace OpenTK.Platform.MacOS
for (int i = 0; i < element_array.Count; i++)
{
IOHIDElementRef element_ref = element_array[i];
IOHIDElementType type = NativeMethods.IOHIDElementGetType(element_ref);
HIDPage page = NativeMethods.IOHIDElementGetUsagePage(element_ref);
int usage = NativeMethods.IOHIDElementGetUsage(element_ref);

View file

@ -31,6 +31,8 @@ using System.Diagnostics;
using System.Security;
using System.Runtime.InteropServices;
#pragma warning disable 0169
namespace OpenTK.Platform.SDL2
{
using Surface = IntPtr;

View file

@ -33,10 +33,9 @@ namespace OpenTK.Platform.SDL2
{
class Sdl2Keyboard : IKeyboardDriver2
{
#pragma warning disable 649 // Field never assigned to, compiler bug in Mono 3.4.0
KeyboardState state;
readonly List<KeyboardDevice> keyboards =
new List<KeyboardDevice>();
#pragma warning restore 649
public Sdl2Keyboard()
{
@ -78,7 +77,6 @@ namespace OpenTK.Platform.SDL2
bool pressed = e.State != 0;
var scancode = e.Keysym.Scancode;
Key key = Sdl2KeyMap.GetKey(scancode);
KeyModifiers mods = Sdl2KeyMap.GetModifiers(e.Keysym.Mod);
if (key != Key.Unknown)
{

View file

@ -60,7 +60,6 @@ namespace OpenTK.Platform.SDL2
Icon icon;
MouseCursor cursor = MouseCursor.Default;
IntPtr sdl_cursor = IntPtr.Zero;
string window_title;
// Used in KeyPress event to decode SDL UTF8 text strings
// to .Net UTF16 strings
@ -100,7 +99,6 @@ namespace OpenTK.Platform.SDL2
window = new Sdl2WindowInfo(handle, null);
window_id = SDL.GetWindowID(handle);
windows.Add(window_id, this);
window_title = title;
}
}
@ -669,7 +667,6 @@ namespace OpenTK.Platform.SDL2
if (Exists)
{
SDL.SetWindowTitle(window.Handle, value);
window_title = value;
}
}
}

View file

@ -113,7 +113,7 @@ namespace OpenTK.Platform.Windows
int device_count = 0, mode_count = 0;
// Get available video adapters and enumerate all monitors
WindowsDisplayDevice dev1 = new WindowsDisplayDevice(), dev2 = new WindowsDisplayDevice();
WindowsDisplayDevice dev1 = new WindowsDisplayDevice();
while (Functions.EnumDisplayDevices(null, device_count++, dev1, 0))
{
if ((dev1.StateFlags & DisplayDeviceStateFlags.AttachedToDesktop) == DisplayDeviceStateFlags.None)

View file

@ -47,9 +47,7 @@ namespace OpenTK.Platform.Windows
ICD,
}
static readonly object SyncRoot = new object();
readonly IntPtr Device;
readonly List<GraphicsMode> modes = new List<GraphicsMode>();
#region Constructors

View file

@ -43,7 +43,6 @@ namespace OpenTK.Platform.Windows
readonly object sync = new object();
List<JoystickDevice> sticks = new List<JoystickDevice>();
IList<JoystickDevice> sticks_readonly;
// Matches a WinMM device index to a specific stick above
readonly Dictionary<int, int> index_to_stick =
@ -65,7 +64,6 @@ namespace OpenTK.Platform.Windows
public WinMMJoystick()
{
sticks_readonly = sticks.AsReadOnly();
RefreshDevices();
}

View file

@ -39,7 +39,6 @@ namespace OpenTK.Platform.Windows
// Input event data.
static RawInput data = new RawInput();
static readonly int rawInputStructSize = API.RawInputSize;
WinRawKeyboard keyboard_driver;
WinRawMouse mouse_driver;

View file

@ -31,6 +31,8 @@ using System;
using System.Diagnostics;
using System.Runtime.InteropServices;
#pragma warning disable 0169
namespace OpenTK.Platform.X11
{
using Atom = IntPtr;

View file

@ -575,7 +575,6 @@ namespace OpenTK.Platform.X11
{
int width = image.Width;
int height = image.Height;
int size = width * height;
BitmapData data = image.LockBits(new Rectangle(0, 0, width, height),
ImageLockMode.ReadOnly,
@ -591,7 +590,7 @@ namespace OpenTK.Platform.X11
XFreeGC(display, gc);
image.UnlockBits(data);
return pixmap;
}

View file

@ -324,8 +324,6 @@ namespace OpenTK.Platform.X11
{
short rate = 0;
IntPtr screen_config = Functions.XRRGetScreenInfo(API.DefaultDisplay, Functions.XRootWindow(API.DefaultDisplay, screen));
ushort rotation = 0;
int size = Functions.XRRConfigCurrentConfiguration(screen_config, out rotation);
rate = Functions.XRRConfigCurrentRate(screen_config);
Functions.XRRFreeScreenConfigInfo(screen_config);
return (float)rate;

View file

@ -75,11 +75,13 @@ namespace OpenTK.Platform.X11
IntPtr _atom_net_wm_state_fullscreen;
IntPtr _atom_net_wm_state_maximized_horizontal;
IntPtr _atom_net_wm_state_maximized_vertical;
#pragma warning disable 414 // assigned but never used
IntPtr _atom_net_wm_allowed_actions;
IntPtr _atom_net_wm_action_resize;
IntPtr _atom_net_wm_action_maximize_horizontally;
IntPtr _atom_net_wm_action_maximize_vertically;
#pragma warning restore 414
IntPtr _atom_net_wm_icon;
@ -91,7 +93,9 @@ namespace OpenTK.Platform.X11
static readonly IntPtr _atom_add = (IntPtr)1;
static readonly IntPtr _atom_toggle = (IntPtr)2;
#pragma warning disable 649 // never assigned, compiler bug in Mono 3.4.0
Rectangle bounds, client_rectangle;
#pragma warning restore 649
int border_left, border_right, border_top, border_bottom;
Icon icon;
bool has_focus;
@ -123,9 +127,11 @@ namespace OpenTK.Platform.X11
readonly IntPtr EmptyCursor;
#pragma warning disable 414 // Field assigned but never used, we do that on purpose
readonly bool xi2_supported;
readonly int xi2_opcode;
readonly int xi2_version;
#pragma warning restore 414
#endregion
@ -409,15 +415,7 @@ namespace OpenTK.Platform.X11
bool IsWindowBorderHidden
{
get
{
//IntPtr actual_atom;
//int actual_format;
//IntPtr nitems;
//IntPtr bytes_after;
IntPtr prop = IntPtr.Zero;
//IntPtr atom;
//XWindowAttributes attributes;
{
using (new XLock(window.Display))
{
// Test if decorations have been disabled through Motif.

View file

@ -102,7 +102,6 @@ namespace OpenTK.Platform.X11
Debug.Print("Selecting FB config for {0}", mode);
List<int> visualAttributes = new List<int>();
IntPtr visual = IntPtr.Zero;
if (mode.ColorFormat.BitsPerPixel > 0)
{