Add default clauses to switch statements

Signed-off-by: Antonio Niño Díaz <antonio_nd@outlook.com>
This commit is contained in:
Antonio Niño Díaz
2018-04-01 01:54:42 +01:00
parent 516e4578ea
commit 85ece88268
5 changed files with 16 additions and 2 deletions

View File

@@ -87,6 +87,8 @@ static void pushcontext(void)
(*ppFileStack)->nREPTBlockSize = nCurrentREPTBlockSize;
(*ppFileStack)->nREPTBlockCount = nCurrentREPTBlockCount;
break;
default:
fatalerror("%s: Internal error.", __func__);
}
nLineNo = 0;
@@ -152,6 +154,8 @@ static int32_t popcontext(void)
nCurrentREPTBlockSize = pLastFile->nREPTBlockSize;
nCurrentREPTBlockCount = pLastFile->nREPTBlockCount;
break;
default:
fatalerror("%s: Internal error.", __func__);
}
free(*ppLastFile);
@@ -174,6 +178,8 @@ int32_t fstk_GetLine(void)
return nLineNo; /* ??? */
case STAT_isREPTBlock:
break; /* Peek top file of the stack */
default:
fatalerror("%s: Internal error.", __func__);
}
pLastFile = pFileStack;

View File

@@ -93,6 +93,9 @@ static int32_t ascii2bin(char *s)
s += 1;
convertfunc = binary2bin;
break;
default:
/* Handle below */
break;
}
if (radix == 4) {

View File

@@ -850,7 +850,7 @@ uint32_t yylex(void)
return yylex_NORMAL();
case LEX_STATE_MACROARGS:
return yylex_MACROARGS();
default:
fatalerror("%s: Internal error.", __func__);
}
fatalerror("Internal error in %s", __func__);
}

View File

@@ -617,6 +617,9 @@ void AssignSections(void)
pSection->nOrg, pSection->nBank);
}
break;
default:
errx(1, "%s: Internal error: Type %d", __func__,
pSection->Type);
}
}

View File

@@ -325,6 +325,8 @@ void Patch(void)
pPatch->nLineNo);
}
break;
default:
errx(1, "%s: Internal error.", __func__);
}
pPatch = pPatch->pNext;