Merge pull request #3802 from buddytex/Testing

Eliminated usage of default parameters.
This commit is contained in:
Paul Chote
2013-09-06 15:04:59 -07:00
2 changed files with 19 additions and 7 deletions

View File

@@ -96,14 +96,18 @@ namespace OpenRA.FileFormats
/// <returns>
/// The calculated checksum.
/// </returns>
public static uint Calculate(byte[] data, uint polynomal = 0xFFFFFFFF)
public static uint Calculate(byte[] data, uint polynomial)
{
uint crc = polynomal;
uint crc = polynomial;
for (int i = 0; i < data.Length; i++)
crc = (crc >> 8) ^ lookUp[(crc & 0xFF) ^ data[i]];
crc ^= polynomal;
crc ^= polynomial;
return crc;
}
public static uint Calculate(byte[] data)
{
return Calculate(data, 0xFFFFFFFF);
}
/// <summary>
/// A fast (native) CRC32 implementation that can be used on a pinned byte array using
@@ -113,13 +117,17 @@ namespace OpenRA.FileFormats
/// <param name="len"> The length of the data data.</param>
/// <param name="polynomal">The polynomal to xor with.</param>
/// <returns>The calculated checksum.</returns>
public static unsafe uint Calculate(byte* data, uint len, uint polynomal = 0xFFFFFFFF)
public static unsafe uint Calculate(byte* data, uint len, uint polynomial)
{
uint crc = polynomal;
uint crc = polynomial;
for (int i = 0; i < len; i++)
crc = (crc >> 8) ^ lookUp[(crc & 0xFF) ^ *data++];
crc ^= polynomal;
crc ^= polynomial;
return crc;
}
public static unsafe uint Calculate(byte* data, uint len)
{
return Calculate(data, len, 0xFFFFFFFF);
}
}
}

View File

@@ -500,12 +500,16 @@ namespace OpenRA.Mods.RA.AI
return squads.Where(s => s.type == type).FirstOrDefault();
}
Squad RegisterNewSquad(SquadType type, Actor target = null)
Squad RegisterNewSquad(SquadType type, Actor target)
{
var ret = new Squad(this, type, target);
squads.Add(ret);
return ret;
}
Squad RegisterNewSquad(SquadType type)
{
return RegisterNewSquad(type, null);
}
int assignRolesTicks = 0;
int rushTicks = 0;