Fix StyleCop warnings in OpenRA.Game

This commit is contained in:
Hellhake
2015-01-01 23:04:18 +01:00
parent e9989496c4
commit 5a97a4b63b
119 changed files with 547 additions and 529 deletions

View File

@@ -29,7 +29,7 @@ namespace OpenRA
var path = Platform.SupportDir + "Logs";
Directory.CreateDirectory(path);
for(var i = 0;; i++ )
for (var i = 0;; i++)
yield return Path.Combine(path, i > 0 ? "{0}.{1}".F(baseFilename, i) : baseFilename);
}

View File

@@ -35,9 +35,9 @@ namespace OpenRA.Support
if (index == 0) Generate();
var y = mt[index];
y ^= (y >> 11);
y ^= ((y << 7) & 2636928640);
y ^= ((y << 15) & 4022730752);
y ^= y >> 11;
y ^= (y << 7) & 2636928640;
y ^= (y << 15) & 4022730752;
y ^= y >> 18;
index = (index + 1) % 624;
@@ -77,7 +77,7 @@ namespace OpenRA.Support
var y = (mt[i] & 0x80000000) | (mt[(i + 1) % 624] & 0x7fffffff);
mt[i] = mt[(i + 397u) % 624u] ^ (y >> 1);
if ((y & 1) == 1)
mt[i] = (mt[i] ^ 2567483615);
mt[i] = mt[i] ^ 2567483615;
}
}
}

View File

@@ -33,7 +33,7 @@ namespace OpenRA.Support
return x;
});
public static void Increment( string item, double x )
public static void Increment(string item, double x)
{
items[item].val += x;
}
@@ -91,6 +91,7 @@ namespace OpenRA.Support
sum += samples[n];
i++;
}
return sum / i;
}

View File

@@ -18,6 +18,11 @@ namespace OpenRA.Support
{
public sealed class PerfTimer : IDisposable
{
// Tree settings
const int Digits = 6;
const string IndentationString = "| ";
const string FormatSeperation = " ms ";
static readonly string FormatString = "{0," + Digits + ":0}" + FormatSeperation + "{1}";
readonly string name;
readonly float thresholdMs;
readonly byte depth;
@@ -27,12 +32,6 @@ namespace OpenRA.Support
static ThreadLocal<PerfTimer> Parent = new ThreadLocal<PerfTimer>();
// Tree settings
const int Digits = 6;
const string IndentationString = "| ";
const string FormatSeperation = " ms ";
static readonly string FormatString = "{0," + Digits + ":0}" + FormatSeperation + "{1}";
public PerfTimer(string name, float thresholdMs = 0)
{
this.name = name;

View File

@@ -86,8 +86,9 @@ namespace OpenRA
Indent(sb, d);
sb.AppendFormat("TypeName=`{0}`", tle.TypeName);
}
else // TODO: more exception types
else
{
// TODO: more exception types
}
if (e.InnerException != null)