From: thefiddler Date: Mon, 21 Jul 2014 15:46:39 +0000 (+0200) Subject: Fixed compilation warnings on Mono 3.4.0 X-Git-Tag: 2.0-0~107^2~3 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=00b531fdef7ae708f5bbef783c80f1183224af13;p=platform%2Fcore%2Fcsapi%2Fopentk.git Fixed compilation warnings on Mono 3.4.0 --- diff --git a/Source/OpenTK/Graphics/ES20/Helper.cs b/Source/OpenTK/Graphics/ES20/Helper.cs index 3f51e4b..cf0556b 100644 --- a/Source/OpenTK/Graphics/ES20/Helper.cs +++ b/Source/OpenTK/Graphics/ES20/Helper.cs @@ -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 + /// /// Defines the signature of a debug callback for /// . @@ -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 } diff --git a/Source/OpenTK/Graphics/ES30/Helper.cs b/Source/OpenTK/Graphics/ES30/Helper.cs index 52fe33a..9a289b8 100644 --- a/Source/OpenTK/Graphics/ES30/Helper.cs +++ b/Source/OpenTK/Graphics/ES30/Helper.cs @@ -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 + /// /// Defines the signature of a debug callback for /// . @@ -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 } diff --git a/Source/OpenTK/Graphics/GraphicsContext.cs b/Source/OpenTK/Graphics/GraphicsContext.cs index 348b795..1d6eb6b 100644 --- a/Source/OpenTK/Graphics/GraphicsContext.cs +++ b/Source/OpenTK/Graphics/GraphicsContext.cs @@ -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) diff --git a/Source/OpenTK/Graphics/OpenGL/GLHelper.cs b/Source/OpenTK/Graphics/OpenGL/GLHelper.cs index 6d5bd87..db3815c 100644 --- a/Source/OpenTK/Graphics/OpenGL/GLHelper.cs +++ b/Source/OpenTK/Graphics/OpenGL/GLHelper.cs @@ -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 + /// /// Defines the signature of a debug callback for /// . @@ -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 } diff --git a/Source/OpenTK/Graphics/OpenGL4/Helper.cs b/Source/OpenTK/Graphics/OpenGL4/Helper.cs index 55f23a3..bb2c254 100644 --- a/Source/OpenTK/Graphics/OpenGL4/Helper.cs +++ b/Source/OpenTK/Graphics/OpenGL4/Helper.cs @@ -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 + /// /// Defines the signature of a debug callback for /// . @@ -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 } diff --git a/Source/OpenTK/Input/MouseEventArgs.cs b/Source/OpenTK/Input/MouseEventArgs.cs index f9c6feb..a5829e9 100644 --- a/Source/OpenTK/Input/MouseEventArgs.cs +++ b/Source/OpenTK/Input/MouseEventArgs.cs @@ -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; } /// diff --git a/Source/OpenTK/Math/Quaternion.cs b/Source/OpenTK/Math/Quaternion.cs index 1334ea0..922a4f7 100644 --- a/Source/OpenTK/Math/Quaternion.cs +++ b/Source/OpenTK/Math/Quaternion.cs @@ -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 + /// /// Gets or sets an OpenTK.Vector3 with the X, Y and Z components of this instance. /// @@ -88,6 +90,8 @@ namespace OpenTK [CLSCompliant(false)] public Vector3 Xyz { get { return xyz; } set { xyz = value; } } + #pragma warning restore 3005 + /// /// Gets or sets the X component of this instance. /// diff --git a/Source/OpenTK/Math/Quaterniond.cs b/Source/OpenTK/Math/Quaterniond.cs index 9806f69..792dddd 100644 --- a/Source/OpenTK/Math/Quaterniond.cs +++ b/Source/OpenTK/Math/Quaterniond.cs @@ -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 + /// /// Gets or sets an OpenTK.Vector3d with the X, Y and Z components of this instance. /// @@ -87,6 +89,8 @@ namespace OpenTK /// public Vector3d Xyz { get { return xyz; } set { xyz = value; } } + #pragma warning restore 3005 + /// /// Gets or sets the X component of this instance. /// diff --git a/Source/OpenTK/Platform/MacOS/Cocoa/NSApplication.cs b/Source/OpenTK/Platform/MacOS/Cocoa/NSApplication.cs index 30e61ce..0670d43 100644 --- a/Source/OpenTK/Platform/MacOS/Cocoa/NSApplication.cs +++ b/Source/OpenTK/Platform/MacOS/Cocoa/NSApplication.cs @@ -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 diff --git a/Source/OpenTK/Platform/MacOS/HIDInput.cs b/Source/OpenTK/Platform/MacOS/HIDInput.cs index 8f30304..5bde1be 100755 --- a/Source/OpenTK/Platform/MacOS/HIDInput.cs +++ b/Source/OpenTK/Platform/MacOS/HIDInput.cs @@ -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); diff --git a/Source/OpenTK/Platform/SDL2/Sdl2.cs b/Source/OpenTK/Platform/SDL2/Sdl2.cs index b1acdb7..2a9bba1 100644 --- a/Source/OpenTK/Platform/SDL2/Sdl2.cs +++ b/Source/OpenTK/Platform/SDL2/Sdl2.cs @@ -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; diff --git a/Source/OpenTK/Platform/SDL2/Sdl2Keyboard.cs b/Source/OpenTK/Platform/SDL2/Sdl2Keyboard.cs index bb84d4a..d5b05c1 100644 --- a/Source/OpenTK/Platform/SDL2/Sdl2Keyboard.cs +++ b/Source/OpenTK/Platform/SDL2/Sdl2Keyboard.cs @@ -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 keyboards = - new List(); + #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) { diff --git a/Source/OpenTK/Platform/SDL2/Sdl2NativeWindow.cs b/Source/OpenTK/Platform/SDL2/Sdl2NativeWindow.cs index a49dea1..e024abd 100644 --- a/Source/OpenTK/Platform/SDL2/Sdl2NativeWindow.cs +++ b/Source/OpenTK/Platform/SDL2/Sdl2NativeWindow.cs @@ -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; } } } diff --git a/Source/OpenTK/Platform/Windows/WinDisplayDevice.cs b/Source/OpenTK/Platform/Windows/WinDisplayDevice.cs index 8ea67e0..ceb7cd4 100644 --- a/Source/OpenTK/Platform/Windows/WinDisplayDevice.cs +++ b/Source/OpenTK/Platform/Windows/WinDisplayDevice.cs @@ -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) diff --git a/Source/OpenTK/Platform/Windows/WinGraphicsMode.cs b/Source/OpenTK/Platform/Windows/WinGraphicsMode.cs index 8550ddf..91ffd9a 100644 --- a/Source/OpenTK/Platform/Windows/WinGraphicsMode.cs +++ b/Source/OpenTK/Platform/Windows/WinGraphicsMode.cs @@ -47,9 +47,7 @@ namespace OpenTK.Platform.Windows ICD, } - static readonly object SyncRoot = new object(); readonly IntPtr Device; - readonly List modes = new List(); #region Constructors diff --git a/Source/OpenTK/Platform/Windows/WinMMJoystick.cs b/Source/OpenTK/Platform/Windows/WinMMJoystick.cs index b8bd79a..ff3e635 100644 --- a/Source/OpenTK/Platform/Windows/WinMMJoystick.cs +++ b/Source/OpenTK/Platform/Windows/WinMMJoystick.cs @@ -43,7 +43,6 @@ namespace OpenTK.Platform.Windows readonly object sync = new object(); List sticks = new List(); - IList sticks_readonly; // Matches a WinMM device index to a specific stick above readonly Dictionary index_to_stick = @@ -65,7 +64,6 @@ namespace OpenTK.Platform.Windows public WinMMJoystick() { - sticks_readonly = sticks.AsReadOnly(); RefreshDevices(); } diff --git a/Source/OpenTK/Platform/Windows/WinRawInput.cs b/Source/OpenTK/Platform/Windows/WinRawInput.cs index 9f12099..0e99bc9 100644 --- a/Source/OpenTK/Platform/Windows/WinRawInput.cs +++ b/Source/OpenTK/Platform/Windows/WinRawInput.cs @@ -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; diff --git a/Source/OpenTK/Platform/X11/Bindings/Xkb.cs b/Source/OpenTK/Platform/X11/Bindings/Xkb.cs index 0be6971..74a3d83 100644 --- a/Source/OpenTK/Platform/X11/Bindings/Xkb.cs +++ b/Source/OpenTK/Platform/X11/Bindings/Xkb.cs @@ -31,6 +31,8 @@ using System; using System.Diagnostics; using System.Runtime.InteropServices; +#pragma warning disable 0169 + namespace OpenTK.Platform.X11 { using Atom = IntPtr; diff --git a/Source/OpenTK/Platform/X11/Functions.cs b/Source/OpenTK/Platform/X11/Functions.cs index b8e44ed..985e647 100644 --- a/Source/OpenTK/Platform/X11/Functions.cs +++ b/Source/OpenTK/Platform/X11/Functions.cs @@ -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; } diff --git a/Source/OpenTK/Platform/X11/X11DisplayDevice.cs b/Source/OpenTK/Platform/X11/X11DisplayDevice.cs index 7f9e1ea..3a794f1 100644 --- a/Source/OpenTK/Platform/X11/X11DisplayDevice.cs +++ b/Source/OpenTK/Platform/X11/X11DisplayDevice.cs @@ -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; diff --git a/Source/OpenTK/Platform/X11/X11GLNative.cs b/Source/OpenTK/Platform/X11/X11GLNative.cs index 70bb62f..b10a5b5 100644 --- a/Source/OpenTK/Platform/X11/X11GLNative.cs +++ b/Source/OpenTK/Platform/X11/X11GLNative.cs @@ -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. diff --git a/Source/OpenTK/Platform/X11/X11GraphicsMode.cs b/Source/OpenTK/Platform/X11/X11GraphicsMode.cs index 9a76447..d82e616 100644 --- a/Source/OpenTK/Platform/X11/X11GraphicsMode.cs +++ b/Source/OpenTK/Platform/X11/X11GraphicsMode.cs @@ -102,7 +102,6 @@ namespace OpenTK.Platform.X11 Debug.Print("Selecting FB config for {0}", mode); List visualAttributes = new List(); - IntPtr visual = IntPtr.Zero; if (mode.ColorFormat.BitsPerPixel > 0) {