shithub: rgbds

Download patch

ref: 85ece882689527ad8f73cf05637dfca2b3fcb048
parent: 516e4578ea144e297e69ac7972e639b67a17b387
author: Antonio Niño Díaz <antonio_nd@outlook.com>
date: Sat Mar 31 21:54:42 EDT 2018

Add default clauses to switch statements

Signed-off-by: Antonio Niño Díaz <antonio_nd@outlook.com>

--- a/src/asm/fstack.c
+++ b/src/asm/fstack.c
@@ -87,6 +87,8 @@
 		(*ppFileStack)->nREPTBlockSize = nCurrentREPTBlockSize;
 		(*ppFileStack)->nREPTBlockCount = nCurrentREPTBlockCount;
 		break;
+	default:
+		fatalerror("%s: Internal error.", __func__);
 	}
 
 	nLineNo = 0;
@@ -152,6 +154,8 @@
 		nCurrentREPTBlockSize = pLastFile->nREPTBlockSize;
 		nCurrentREPTBlockCount = pLastFile->nREPTBlockCount;
 		break;
+	default:
+		fatalerror("%s: Internal error.", __func__);
 	}
 
 	free(*ppLastFile);
@@ -174,6 +178,8 @@
 		return nLineNo; /* ??? */
 	case STAT_isREPTBlock:
 		break; /* Peek top file of the stack */
+	default:
+		fatalerror("%s: Internal error.", __func__);
 	}
 
 	pLastFile = pFileStack;
--- a/src/asm/globlex.c
+++ b/src/asm/globlex.c
@@ -93,6 +93,9 @@
 		s += 1;
 		convertfunc = binary2bin;
 		break;
+	default:
+		/* Handle below */
+		break;
 	}
 
 	if (radix == 4) {
--- a/src/asm/lexer.c
+++ b/src/asm/lexer.c
@@ -850,7 +850,7 @@
 		return yylex_NORMAL();
 	case LEX_STATE_MACROARGS:
 		return yylex_MACROARGS();
+	default:
+		fatalerror("%s: Internal error.", __func__);
 	}
-
-	fatalerror("Internal error in %s", __func__);
 }
--- a/src/link/assign.c
+++ b/src/link/assign.c
@@ -617,6 +617,9 @@
 				     pSection->nOrg, pSection->nBank);
 			}
 			break;
+		default:
+			errx(1, "%s: Internal error: Type %d", __func__,
+			     pSection->Type);
 		}
 	}
 
--- a/src/link/patch.c
+++ b/src/link/patch.c
@@ -325,6 +325,8 @@
 					     pPatch->nLineNo);
 				}
 				break;
+			default:
+				errx(1, "%s: Internal error.", __func__);
 			}
 
 			pPatch = pPatch->pNext;