Correct keyword spacing in OpenTK.

This commit is contained in:
Jarl Gullberg 2017-07-28 12:29:22 +02:00
parent 1260fd0a6b
commit 7090695ac6
No known key found for this signature in database
GPG key ID: 750FF6F6BDA72D23
11 changed files with 43 additions and 43 deletions

View file

@ -87,7 +87,7 @@ namespace OpenTK
{ {
sbyte* str = (sbyte*)ptr.ToPointer(); sbyte* str = (sbyte*)ptr.ToPointer();
int len = 0; int len = 0;
while(*str != 0) while (*str != 0)
{ {
++len; ++len;
++str; ++str;

View file

@ -111,7 +111,7 @@ namespace OpenTK.Input
{ {
fixed (int* k = Keys) fixed (int* k = Keys)
{ {
for(int i = 0; i < NumInts; ++i) for (int i = 0; i < NumInts; ++i)
{ {
if (k[i] != 0) if (k[i] != 0)
{ {

View file

@ -70,21 +70,21 @@ namespace OpenTK
/// </summary> /// </summary>
public float this[int index] { public float this[int index] {
get{ get{
if(index == 0) if (index == 0)
{ {
return X; return X;
} }
else if(index == 1) else if (index == 1)
{ {
return Y; return Y;
} }
throw new IndexOutOfRangeException("You tried to access this vector at index: " + index); throw new IndexOutOfRangeException("You tried to access this vector at index: " + index);
} set{ } set{
if(index == 0) if (index == 0)
{ {
X = value; X = value;
} }
else if(index == 1) else if (index == 1)
{ {
Y = value; Y = value;
} }

View file

@ -86,21 +86,21 @@ namespace OpenTK
/// </summary> /// </summary>
public double this[int index] { public double this[int index] {
get{ get{
if(index == 0) if (index == 0)
{ {
return X; return X;
} }
else if(index == 1) else if (index == 1)
{ {
return Y; return Y;
} }
throw new IndexOutOfRangeException("You tried to access this vector at index: " + index); throw new IndexOutOfRangeException("You tried to access this vector at index: " + index);
} set{ } set{
if(index == 0) if (index == 0)
{ {
X = value; X = value;
} }
else if(index == 1) else if (index == 1)
{ {
Y = value; Y = value;
} }

View file

@ -114,29 +114,29 @@ namespace OpenTK
/// </summary> /// </summary>
public float this[int index] { public float this[int index] {
get{ get{
if(index == 0) if (index == 0)
{ {
return X; return X;
} }
else if(index == 1) else if (index == 1)
{ {
return Y; return Y;
} }
else if(index == 2) else if (index == 2)
{ {
return Z; return Z;
} }
throw new IndexOutOfRangeException("You tried to access this vector at index: " + index); throw new IndexOutOfRangeException("You tried to access this vector at index: " + index);
} set{ } set{
if(index == 0) if (index == 0)
{ {
X = value; X = value;
} }
else if(index == 1) else if (index == 1)
{ {
Y = value; Y = value;
} }
else if(index == 2) else if (index == 2)
{ {
Z = value; Z = value;
} }

View file

@ -111,29 +111,29 @@ namespace OpenTK
/// </summary> /// </summary>
public double this[int index] { public double this[int index] {
get{ get{
if(index == 0) if (index == 0)
{ {
return X; return X;
} }
else if(index == 1) else if (index == 1)
{ {
return Y; return Y;
} }
else if(index == 2) else if (index == 2)
{ {
return Z; return Z;
} }
throw new IndexOutOfRangeException("You tried to access this vector at index: " + index); throw new IndexOutOfRangeException("You tried to access this vector at index: " + index);
} set{ } set{
if(index == 0) if (index == 0)
{ {
X = value; X = value;
} }
else if(index == 1) else if (index == 1)
{ {
Y = value; Y = value;
} }
else if(index == 2) else if (index == 2)
{ {
Z = value; Z = value;
} }

View file

@ -172,37 +172,37 @@ namespace OpenTK
/// </summary> /// </summary>
public float this[int index] { public float this[int index] {
get{ get{
if(index == 0) if (index == 0)
{ {
return X; return X;
} }
else if(index == 1) else if (index == 1)
{ {
return Y; return Y;
} }
else if(index == 2) else if (index == 2)
{ {
return Z; return Z;
} }
else if(index == 3) else if (index == 3)
{ {
return W; return W;
} }
throw new IndexOutOfRangeException("You tried to access this vector at index: " + index); throw new IndexOutOfRangeException("You tried to access this vector at index: " + index);
} set{ } set{
if(index == 0) if (index == 0)
{ {
X = value; X = value;
} }
else if(index == 1) else if (index == 1)
{ {
Y = value; Y = value;
} }
else if(index == 2) else if (index == 2)
{ {
Z = value; Z = value;
} }
else if(index == 3) else if (index == 3)
{ {
W = value; W = value;
} }

View file

@ -169,37 +169,37 @@ namespace OpenTK
/// </summary> /// </summary>
public double this[int index] { public double this[int index] {
get{ get{
if(index == 0) if (index == 0)
{ {
return X; return X;
} }
else if(index == 1) else if (index == 1)
{ {
return Y; return Y;
} }
else if(index == 2) else if (index == 2)
{ {
return Z; return Z;
} }
else if(index == 3) else if (index == 3)
{ {
return W; return W;
} }
throw new IndexOutOfRangeException("You tried to access this vector at index: " + index); throw new IndexOutOfRangeException("You tried to access this vector at index: " + index);
} set{ } set{
if(index == 0) if (index == 0)
{ {
X = value; X = value;
} }
else if(index == 1) else if (index == 1)
{ {
Y = value; Y = value;
} }
else if(index == 2) else if (index == 2)
{ {
Z = value; Z = value;
} }
else if(index == 3) else if (index == 3)
{ {
W = value; W = value;
} }

View file

@ -107,7 +107,7 @@ namespace OpenTK.Platform.Windows
string deviceClassGUID = (string)regkey.GetValue("ClassGUID"); // for windows 8 support via OpenTK issue 3198 string deviceClassGUID = (string)regkey.GetValue("ClassGUID"); // for windows 8 support via OpenTK issue 3198
// making a guess at backwards compatability. Not sure what older windows returns in these cases... // making a guess at backwards compatability. Not sure what older windows returns in these cases...
if(deviceClass == null || deviceClass.Equals(string.Empty)){ if (deviceClass == null || deviceClass.Equals(string.Empty)){
RegistryKey classGUIDKey = Registry.LocalMachine.OpenSubKey(@"SYSTEM\CurrentControlSet\Control\Class\" + deviceClassGUID); 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;
} }

View file

@ -106,7 +106,7 @@ namespace OpenTK.Platform.Windows
string deviceDesc = (string)regkey.GetValue("DeviceDesc"); string deviceDesc = (string)regkey.GetValue("DeviceDesc");
string deviceClass = (string)regkey.GetValue("Class") as string; string deviceClass = (string)regkey.GetValue("Class") as string;
if(deviceClass == null) if (deviceClass == null)
{ {
// Added to address OpenTK issue 3198 with mouse on Windows 8 // Added to address OpenTK issue 3198 with mouse on Windows 8
string deviceClassGUID = (string)regkey.GetValue("ClassGUID"); string deviceClassGUID = (string)regkey.GetValue("ClassGUID");

View file

@ -1651,7 +1651,7 @@ namespace OpenTK.Platform.X11
} }
else else
{ {
fixed(byte* pixels = value.Data) fixed (byte* pixels = value.Data)
{ {
var xcursorimage = Functions.XcursorImageCreate(value.Width, value.Height); var xcursorimage = Functions.XcursorImageCreate(value.Width, value.Height);
xcursorimage->xhot = (uint)value.X; xcursorimage->xhot = (uint)value.X;
@ -1696,7 +1696,7 @@ namespace OpenTK.Platform.X11
cursor_visible = true; cursor_visible = true;
} }
} }
else if(!value && cursor_visible) else if (!value && cursor_visible)
{ {
using (new XLock(window.Display)) using (new XLock(window.Display))
{ {
@ -1884,7 +1884,7 @@ namespace OpenTK.Platform.X11
if (window != null && window.Handle != IntPtr.Zero) if (window != null && window.Handle != IntPtr.Zero)
{ {
Functions.XFreeCursor(window.Display, EmptyCursor); Functions.XFreeCursor(window.Display, EmptyCursor);
if(cursorHandle != IntPtr.Zero) if (cursorHandle != IntPtr.Zero)
{ {
Functions.XFreeCursor(window.Display, cursorHandle); Functions.XFreeCursor(window.Display, cursorHandle);
} }