Use scoped blocks for case-specific variables

This commit is contained in:
Rangi42
2025-08-23 21:52:22 -04:00
parent 0d509aa65c
commit ead5337fe0
2 changed files with 5 additions and 4 deletions

View File

@@ -92,9 +92,8 @@ void opt_Parse(char const *s) {
} }
break; break;
char const *precisionArg; case 'Q': {
case 'Q': char const *precisionArg = &s[1];
precisionArg = &s[1];
if (precisionArg[0] == '.') { if (precisionArg[0] == '.') {
++precisionArg; ++precisionArg;
} }
@@ -114,6 +113,7 @@ void opt_Parse(char const *s) {
error("Invalid argument for option 'Q'"); error("Invalid argument for option 'Q'");
} }
break; break;
}
case 'r': { case 'r': {
++s; // Skip 'r' ++s; // Skip 'r'

View File

@@ -120,8 +120,8 @@ static void readFileStackNode(
); );
break; break;
case NODE_REPT: {
uint32_t depth; uint32_t depth;
case NODE_REPT:
tryReadLong( tryReadLong(
depth, file, "%s: Cannot read node #%" PRIu32 "'s REPT depth: %s", fileName, nodeID depth, file, "%s: Cannot read node #%" PRIu32 "'s REPT depth: %s", fileName, nodeID
); );
@@ -144,6 +144,7 @@ static void readFileStackNode(
); );
} }
} }
}
} }
// Reads a symbol from a file. // Reads a symbol from a file.