From f4d09e030f5415c5a26c1d6001a64c572a2da617 Mon Sep 17 00:00:00 2001 From: Jarl Gullberg Date: Thu, 20 Jul 2017 12:57:42 +0200 Subject: [PATCH 1/2] Disable superfluous warnings in native interop code. --- src/OpenTK/Platform/Egl/Egl.cs | 6 ++++-- src/OpenTK/Platform/X11/API.cs | 14 ++++---------- 2 files changed, 8 insertions(+), 12 deletions(-) diff --git a/src/OpenTK/Platform/Egl/Egl.cs b/src/OpenTK/Platform/Egl/Egl.cs index 6edfeadc..93802a48 100644 --- a/src/OpenTK/Platform/Egl/Egl.cs +++ b/src/OpenTK/Platform/Egl/Egl.cs @@ -29,6 +29,10 @@ using System.Collections.Generic; using System.Text; using OpenTK.Graphics; +// ReSharper disable InconsistentNaming +// ReSharper disable UnusedMember.Global +#pragma warning disable 1591 + namespace OpenTK.Platform.Egl { using EGLNativeDisplayType = IntPtr; @@ -394,7 +398,5 @@ namespace OpenTK.Platform.Egl return true; } } - } -#pragma warning restore 0169 } \ No newline at end of file diff --git a/src/OpenTK/Platform/X11/API.cs b/src/OpenTK/Platform/X11/API.cs index c04d8f55..962a57ad 100644 --- a/src/OpenTK/Platform/X11/API.cs +++ b/src/OpenTK/Platform/X11/API.cs @@ -9,6 +9,9 @@ using System.Text; using System.Runtime.InteropServices; using System.Diagnostics; +// ReSharper disable UnusedMember.Global +// ReSharper disable InconsistentNaming +#pragma warning disable 1591 // Missing XML comments #pragma warning disable 3019 // CLS-compliance checking #pragma warning disable 0649 // struct members not explicitly initialized #pragma warning disable 0169 // field / method is never used. @@ -1229,8 +1232,6 @@ XF86VidModeGetGammaRampSize( SunOpen = 0x1005ff73, } -#pragma warning disable 1591 - public enum XVisualClass : int { StaticGray = 0, @@ -1241,8 +1242,6 @@ XF86VidModeGetGammaRampSize( DirectColor = 5, } -#pragma warning restore 1591 - [Flags] public enum XVisualInfoMask { @@ -1615,9 +1614,4 @@ XF86VidModeGetGammaRampSize( AsyncBoth, SyncBoth } -} - -#pragma warning restore 3019 -#pragma warning restore 0649 -#pragma warning restore 0169 -#pragma warning restore 0414 \ No newline at end of file +} \ No newline at end of file From e4e7fba52a1c82f0447d17ae834e38f5c4b83cc1 Mon Sep 17 00:00:00 2001 From: Jarl Gullberg Date: Thu, 20 Jul 2017 19:58:10 +0200 Subject: [PATCH 2/2] Add comment for #pragma disable --- src/OpenTK/Platform/Egl/Egl.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/OpenTK/Platform/Egl/Egl.cs b/src/OpenTK/Platform/Egl/Egl.cs index 93802a48..144cfb28 100644 --- a/src/OpenTK/Platform/Egl/Egl.cs +++ b/src/OpenTK/Platform/Egl/Egl.cs @@ -31,7 +31,8 @@ using OpenTK.Graphics; // ReSharper disable InconsistentNaming // ReSharper disable UnusedMember.Global -#pragma warning disable 1591 + +#pragma warning disable 1591 // Missing XML comments namespace OpenTK.Platform.Egl {