From b08acb758a940319c664de2799b0d7509e528efa Mon Sep 17 00:00:00 2001 From: Jarl Gullberg Date: Sun, 30 Jul 2017 17:58:15 +0200 Subject: [PATCH] Correct cast operator position. --- src/OpenTK/Math/Box2.cs | 2 +- src/OpenTK/Math/Box2d.cs | 2 +- src/OpenTK/Math/MathHelper.cs | 2 +- src/OpenTK/Platform/Egl/EglAnglePlatformFactory.cs | 4 ++-- src/OpenTK/Platform/Egl/EglContext.cs | 8 ++++---- src/OpenTK/Platform/Egl/EglGraphicsMode.cs | 2 +- src/OpenTK/Platform/Windows/WinRawJoystick.cs | 4 ++-- src/OpenTK/Platform/Windows/WinRawKeyboard.cs | 2 +- src/OpenTK/Platform/Windows/WinRawMouse.cs | 2 +- src/OpenTK/Platform/X11/Functions.cs | 4 ++-- 10 files changed, 16 insertions(+), 16 deletions(-) diff --git a/src/OpenTK/Math/Box2.cs b/src/OpenTK/Math/Box2.cs index 16789ef..51b27e6 100644 --- a/src/OpenTK/Math/Box2.cs +++ b/src/OpenTK/Math/Box2.cs @@ -184,7 +184,7 @@ namespace OpenTK /// public override bool Equals(object obj) { - return obj is Box2 && Equals((Box2) obj); + return obj is Box2 && Equals((Box2)obj); } /// diff --git a/src/OpenTK/Math/Box2d.cs b/src/OpenTK/Math/Box2d.cs index 8b32e23..232ab4e 100644 --- a/src/OpenTK/Math/Box2d.cs +++ b/src/OpenTK/Math/Box2d.cs @@ -185,7 +185,7 @@ namespace OpenTK /// public override bool Equals(object obj) { - return obj is Box2d && Equals((Box2d) obj); + return obj is Box2d && Equals((Box2d)obj); } /// diff --git a/src/OpenTK/Math/MathHelper.cs b/src/OpenTK/Math/MathHelper.cs index f5fac0a..66e0038 100644 --- a/src/OpenTK/Math/MathHelper.cs +++ b/src/OpenTK/Math/MathHelper.cs @@ -306,7 +306,7 @@ namespace OpenTK } private static unsafe int FloatToInt32Bits(float f) { - return *((int*) &f); + return *((int*)&f); } /// diff --git a/src/OpenTK/Platform/Egl/EglAnglePlatformFactory.cs b/src/OpenTK/Platform/Egl/EglAnglePlatformFactory.cs index 2d2cb07..d0dedb5 100644 --- a/src/OpenTK/Platform/Egl/EglAnglePlatformFactory.cs +++ b/src/OpenTK/Platform/Egl/EglAnglePlatformFactory.cs @@ -53,7 +53,7 @@ namespace OpenTK.Platform.Egl public override IGraphicsContext CreateGLContext(GraphicsMode mode, IWindowInfo window, IGraphicsContext shareContext, bool directRendering, int major, int minor, GraphicsContextFlags flags) { - var angle_window = (IAngleWindowInfoInternal) window; + var angle_window = (IAngleWindowInfoInternal)window; var egl_window = CreateWindowInfo(angle_window, major, flags); var egl_context = new EglWinContext(mode, egl_window, shareContext, major, minor, flags); angle_window.EglContext = egl_context; @@ -63,7 +63,7 @@ namespace OpenTK.Platform.Egl public override IGraphicsContext CreateGLContext(ContextHandle handle, IWindowInfo window, IGraphicsContext shareContext, bool directRendering, int major, int minor, GraphicsContextFlags flags) { - var angle_window = (IAngleWindowInfoInternal) window; + var angle_window = (IAngleWindowInfoInternal)window; var egl_window = CreateWindowInfo(angle_window, major, flags); var egl_context = new EglWinContext(handle, egl_window, shareContext, major, minor, flags); angle_window.EglContext = egl_context; diff --git a/src/OpenTK/Platform/Egl/EglContext.cs b/src/OpenTK/Platform/Egl/EglContext.cs index 5e12332..d85850a 100644 --- a/src/OpenTK/Platform/Egl/EglContext.cs +++ b/src/OpenTK/Platform/Egl/EglContext.cs @@ -152,12 +152,12 @@ namespace OpenTK.Platform.Egl { if (window is EglWindowInfo) { - WindowInfo = (EglWindowInfo) window; + WindowInfo = (EglWindowInfo)window; } #if !ANDROID else if (window is IAngleWindowInfoInternal) { - WindowInfo = ((IAngleWindowInfoInternal) window).EglWindowInfo; + WindowInfo = ((IAngleWindowInfoInternal)window).EglWindowInfo; } #endif @@ -263,9 +263,9 @@ namespace OpenTK.Platform.Egl var internalContext = sharedContext as IGraphicsContextInternal; if (internalContext != null) { - return (EglContext) internalContext.Implementation; + return (EglContext)internalContext.Implementation; } - return (EglContext) sharedContext; + return (EglContext)sharedContext; } } } diff --git a/src/OpenTK/Platform/Egl/EglGraphicsMode.cs b/src/OpenTK/Platform/Egl/EglGraphicsMode.cs index 91df6fb..c66385b 100644 --- a/src/OpenTK/Platform/Egl/EglGraphicsMode.cs +++ b/src/OpenTK/Platform/Egl/EglGraphicsMode.cs @@ -58,7 +58,7 @@ namespace OpenTK.Platform.Egl IntPtr[] configs = new IntPtr[1]; int[] attribList = new int[] { - Egl.SURFACE_TYPE, (int) surfaceType, + Egl.SURFACE_TYPE, (int)surfaceType, Egl.RENDERABLE_TYPE, (int)renderableFlags, Egl.RED_SIZE, color.Red, diff --git a/src/OpenTK/Platform/Windows/WinRawJoystick.cs b/src/OpenTK/Platform/Windows/WinRawJoystick.cs index 233a640..cadd9a1 100644 --- a/src/OpenTK/Platform/Windows/WinRawJoystick.cs +++ b/src/OpenTK/Platform/Windows/WinRawJoystick.cs @@ -426,8 +426,8 @@ namespace OpenTK.Platform.Windows { if (stick.AxisCaps[i].LogicalMin > 0) { - short scaled_value = (short) HidHelper.ScaleValue( - (int) ((long) value + stick.AxisCaps[i].LogicalMin), + short scaled_value = (short)HidHelper.ScaleValue( + (int)((long)value + stick.AxisCaps[i].LogicalMin), stick.AxisCaps[i].LogicalMin, stick.AxisCaps[i].LogicalMax, Int16.MinValue, Int16.MaxValue); stick.SetAxis(collection, page, usage, scaled_value); diff --git a/src/OpenTK/Platform/Windows/WinRawKeyboard.cs b/src/OpenTK/Platform/Windows/WinRawKeyboard.cs index c19c901..bee7eca 100644 --- a/src/OpenTK/Platform/Windows/WinRawKeyboard.cs +++ b/src/OpenTK/Platform/Windows/WinRawKeyboard.cs @@ -109,7 +109,7 @@ namespace OpenTK.Platform.Windows // making a guess at backwards compatability. Not sure what older windows returns in these cases... if (deviceClass == null || deviceClass.Equals(string.Empty)){ RegistryKey classGUIDKey = Registry.LocalMachine.OpenSubKey(@"SYSTEM\CurrentControlSet\Control\Class\" + deviceClassGUID); - deviceClass = classGUIDKey != null ? (string) classGUIDKey.GetValue("Class") : string.Empty; + deviceClass = classGUIDKey != null ? (string)classGUIDKey.GetValue("Class") : string.Empty; } if (String.IsNullOrEmpty(deviceDesc)) diff --git a/src/OpenTK/Platform/Windows/WinRawMouse.cs b/src/OpenTK/Platform/Windows/WinRawMouse.cs index 99d9c62..877f906 100644 --- a/src/OpenTK/Platform/Windows/WinRawMouse.cs +++ b/src/OpenTK/Platform/Windows/WinRawMouse.cs @@ -111,7 +111,7 @@ namespace OpenTK.Platform.Windows // Added to address OpenTK issue 3198 with mouse on Windows 8 string deviceClassGUID = (string)regkey.GetValue("ClassGUID"); RegistryKey classGUIDKey = Registry.LocalMachine.OpenSubKey(@"SYSTEM\CurrentControlSet\Control\Class\" + deviceClassGUID); - deviceClass = classGUIDKey != null ? (string) classGUIDKey.GetValue("Class") : string.Empty; + deviceClass = classGUIDKey != null ? (string)classGUIDKey.GetValue("Class") : string.Empty; } // deviceDesc remained null on a new Win7 system - not sure why. diff --git a/src/OpenTK/Platform/X11/Functions.cs b/src/OpenTK/Platform/X11/Functions.cs index 672b74b..288e306 100644 --- a/src/OpenTK/Platform/X11/Functions.cs +++ b/src/OpenTK/Platform/X11/Functions.cs @@ -553,7 +553,7 @@ namespace OpenTK.Platform.X11 public byte A, R, G, B; public Pixel(byte a, byte r, byte g, byte b) { - A= a; + A = a; R = r; G = g; B = b; @@ -602,7 +602,7 @@ namespace OpenTK.Platform.X11 { for (int x = 0; x < width; ++x) { - byte bit = (byte) (1 << (msbfirst ? (7 - (x & 7)) : (x & 7))); + byte bit = (byte)(1 << (msbfirst ? (7 - (x & 7)) : (x & 7))); int offset = y * stride + (x >> 3); if (image.GetPixel(x, y).A >= 128) -- 2.7.4