Merge pull request #608 from Nihlus/cleanup-6-keyword-spacing

Correct keyword spacing
This commit is contained in:
Jarl Gullberg 2017-07-30 17:28:04 +02:00 committed by GitHub
commit e9422ab25c
13 changed files with 47 additions and 47 deletions

View file

@ -709,13 +709,13 @@ namespace Bind
if (!String.IsNullOrEmpty(p.ComputeSize)) if (!String.IsNullOrEmpty(p.ComputeSize))
{ {
int count; int count;
if(Int32.TryParse(p.ComputeSize, out count)) if (Int32.TryParse(p.ComputeSize, out count))
{ {
attributes.Add(String.Format("CountAttribute(Count = {0})", count)); attributes.Add(String.Format("CountAttribute(Count = {0})", count));
} }
else else
{ {
if(p.ComputeSize.StartsWith("COMPSIZE")) if (p.ComputeSize.StartsWith("COMPSIZE"))
{ {
//remove the compsize hint, just keep comma delimited param names //remove the compsize hint, just keep comma delimited param names
var len = "COMPSIZE(".Length; var len = "COMPSIZE(".Length;
@ -729,7 +729,7 @@ namespace Bind
} }
} }
if(attributes.Count != 0) if (attributes.Count != 0)
{ {
sb.Append("["); sb.Append("[");
sb.Append(string.Join(", ", attributes)); sb.Append(string.Join(", ", attributes));

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);
} }

View file

@ -6,7 +6,7 @@
<Rule Id="SA0002" Action="Error" /> <!-- Invalid settings file --> <Rule Id="SA0002" Action="Error" /> <!-- Invalid settings file -->
<!-- Spacing rules --> <!-- Spacing rules -->
<Rule Id="SA1000" Action="None" /> <!-- Keywords must be spaced correctly --> <Rule Id="SA1000" Action="Error" /> <!-- Keywords must be spaced correctly -->
<Rule Id="SA1001" Action="None" /> <!-- Commas must be spaced correctly --> <Rule Id="SA1001" Action="None" /> <!-- Commas must be spaced correctly -->
<Rule Id="SA1002" Action="None" /> <!-- Semicolons must be spaced correctly --> <Rule Id="SA1002" Action="None" /> <!-- Semicolons must be spaced correctly -->
<Rule Id="SA1003" Action="None" /> <!-- Symbols must be spaced correctly --> <Rule Id="SA1003" Action="None" /> <!-- Symbols must be spaced correctly -->