Move declarations closer to usage.

This commit is contained in:
2023-10-05 02:37:04 +01:00
parent 214d210979
commit 13a2bfdaf4
6 changed files with 7 additions and 8 deletions

View File

@@ -169,12 +169,12 @@ public class TeleDiskLzh
/// <returns>Number of decompressed bytes</returns> /// <returns>Number of decompressed bytes</returns>
public int Decode(out byte[] buf, int len) /* Decoding/Uncompressing */ public int Decode(out byte[] buf, int len) /* Decoding/Uncompressing */
{ {
short c;
buf = new byte[len]; buf = new byte[len];
int count; // was an unsigned long, seems unnecessary int count; // was an unsigned long, seems unnecessary
for(count = 0; count < len;) for(count = 0; count < len;)
{ {
short c;
if(_tdctl.Bufcnt == 0) if(_tdctl.Bufcnt == 0)
{ {
if((c = DecodeChar()) < 0) if((c = DecodeChar()) < 0)

View File

@@ -712,12 +712,11 @@ public class Nes : IByteAddressableImage
var foundMapper = false; var foundMapper = false;
var foundSubMapper = false; var foundSubMapper = false;
Regex regex;
Match match;
// Sanitize // Sanitize
foreach(LinearMemoryDevice map in mappings.Devices) foreach(LinearMemoryDevice map in mappings.Devices)
{ {
Regex regex;
Match match;
switch(map.Type) switch(map.Type)
{ {
case LinearMemoryType.ROM when !foundRom: case LinearMemoryType.ROM when !foundRom:

View File

@@ -184,7 +184,6 @@ sealed class DecodeCommand : Command
Statistics.AddMediaFormat(inputFormat.Format); Statistics.AddMediaFormat(inputFormat.Format);
Statistics.AddMedia(inputFormat.Info.MediaType, false); Statistics.AddMedia(inputFormat.Info.MediaType, false);
Statistics.AddFilter(inputFilter.Name); Statistics.AddFilter(inputFilter.Name);
ErrorNumber errno;
if(diskTags) if(diskTags)
{ {
@@ -194,6 +193,7 @@ sealed class DecodeCommand : Command
{ {
foreach(MediaTagType tag in inputFormat.Info.ReadableMediaTags) foreach(MediaTagType tag in inputFormat.Info.ReadableMediaTags)
{ {
ErrorNumber errno;
switch(tag) switch(tag)
{ {
case MediaTagType.SCSI_INQUIRY: case MediaTagType.SCSI_INQUIRY: