Specify the parameter for argument-based exceptions. Correct the parameter names of others.

Common mistake.
This commit is contained in:
mathew1800 2015-02-10 04:19:34 +00:00
parent 186f28a2fe
commit abbee1672e
7 changed files with 10 additions and 8 deletions

View File

@ -276,7 +276,7 @@ namespace BizHawk.Client.EmuHawk
public void SetAudioParameters(int sampleRate, int channels, int bits) public void SetAudioParameters(int sampleRate, int channels, int bits)
{ {
if (bits != 16) if (bits != 16)
throw new ArgumentOutOfRangeException("sampling depth must be 16 bits!"); throw new ArgumentOutOfRangeException("bits", "Sampling depth must be 16 bits!");
this.sampleRate = sampleRate; this.sampleRate = sampleRate;
this.channels = channels; this.channels = channels;
} }

View File

@ -106,7 +106,7 @@ namespace BizHawk.Client.EmuHawk
static void WriteVarU(int v, Stream stream) static void WriteVarU(int v, Stream stream)
{ {
if (v < 0) if (v < 0)
throw new ArgumentOutOfRangeException("unsigned must be non-negative"); throw new ArgumentOutOfRangeException("v", "unsigned must be non-negative");
WriteVarU((ulong)v, stream); WriteVarU((ulong)v, stream);
} }
@ -116,7 +116,7 @@ namespace BizHawk.Client.EmuHawk
static void WriteVarU(long v, Stream stream) static void WriteVarU(long v, Stream stream)
{ {
if (v < 0) if (v < 0)
throw new ArgumentOutOfRangeException("unsigned must be non-negative"); throw new ArgumentOutOfRangeException("v", "unsigned must be non-negative");
WriteVarU((ulong)v, stream); WriteVarU((ulong)v, stream);
} }

View File

@ -112,7 +112,7 @@ namespace BizHawk.Client.EmuHawk
public void SetAudioParameters(int sampleRate, int channels, int bits) public void SetAudioParameters(int sampleRate, int channels, int bits)
{ {
if (bits != 16) if (bits != 16)
throw new ArgumentOutOfRangeException("audio depth must be 16 bit!"); throw new ArgumentOutOfRangeException("bits", "Audio depth must be 16 bit!");
this.sampleRate = sampleRate; this.sampleRate = sampleRate;
this.channels = channels; this.channels = channels;
} }

View File

@ -136,7 +136,7 @@ namespace BizHawk.Client.EmuHawk.CustomControls
public void SetButtons(string[] names, DialogResult[] results, int def) public void SetButtons(string[] names, DialogResult[] results, int def)
{ {
if (names == null) if (names == null)
throw new ArgumentNullException("btnText", "Button Text is null"); throw new ArgumentNullException("names", "Button Text is null");
int count = names.Length; int count = names.Length;

View File

@ -31,7 +31,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBA
{ {
if (scanline < 0 || scanline > 227) if (scanline < 0 || scanline > 227)
{ {
throw new ArgumentOutOfRangeException("Scanline must be in [0, 227]!"); throw new ArgumentOutOfRangeException("scanline", "Scanline must be in [0, 227]!");
} }
if (callback == null) if (callback == null)

View File

@ -25,7 +25,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBA
{ {
if (scanline < 0 || scanline > 227) if (scanline < 0 || scanline > 227)
{ {
throw new ArgumentOutOfRangeException("Scanline must be in [0, 227]!"); throw new ArgumentOutOfRangeException("scanline", "Scanline must be in [0, 227]!");
} }
if (callback == null) if (callback == null)
{ {

View File

@ -520,7 +520,9 @@ namespace BizHawk.Emulation.Cores.Nintendo.Gameboy
LibGambatte.gambatte_setscanlinecallback(GambatteState, scanlinecb, line); LibGambatte.gambatte_setscanlinecallback(GambatteState, scanlinecb, line);
} }
else else
throw new ArgumentOutOfRangeException("line must be in [0, 153]"); {
throw new ArgumentOutOfRangeException("line", "line must be in [0, 153]");
}
} }
LibGambatte.ScanlineCallback scanlinecb; LibGambatte.ScanlineCallback scanlinecb;