comparison tools/lib64gfx.c @ 1924:1c5ea4fa8788

Add some default-case error handling.
author Matti Hamalainen <ccr@tnsp.org>
date Thu, 28 Jun 2018 01:25:10 +0300
parents 42cd527a01b9
children cf0457f93b37
comparison
equal deleted inserted replaced
1923:42cd527a01b9 1924:1c5ea4fa8788
969 break; 969 break;
970 970
971 case DO_SET_MEM_LO: 971 case DO_SET_MEM_LO:
972 value = *src & 0x0f; 972 value = *src & 0x0f;
973 break; 973 break;
974
975 default:
976 return dmError(DMERR_INTERNAL,
977 "Unhandled op type %d in "
978 "op #%d, offs=%d ($%04x), bank=%d, size=%d ($%04x) @ %d ($%04x)\n",
979 op->type, i, op->offs, op->offs, op->bank, size, size, buf->len, buf->len);
974 } 980 }
975 switch (op->subject) 981 switch (op->subject)
976 { 982 {
977 case DS_D020: img->d020 = value; break; 983 case DS_D020: img->d020 = value; break;
978 case DS_BGCOL: 984 case DS_BGCOL:
1131 break; 1137 break;
1132 1138
1133 case DO_SET_OP: 1139 case DO_SET_OP:
1134 // This operation makes no sense in encoding, so do nothing 1140 // This operation makes no sense in encoding, so do nothing
1135 break; 1141 break;
1142 default:
1143 return dmError(DMERR_INTERNAL,
1144 "Unhandled op type %d in "
1145 "op #%d, offs=%d ($%04x), bank=%d, size=%d ($%04x) @ %d ($%04x)\n",
1146 op->type, i, op->offs, op->offs, op->bank, size, size, buf->len, buf->len);
1136 } 1147 }
1137 break; 1148 break;
1138 1149
1139 case DS_D020: 1150 case DS_D020:
1140 case DS_BGCOL: 1151 case DS_BGCOL:
1167 break; 1178 break;
1168 1179
1169 case DO_SET_OP: 1180 case DO_SET_OP:
1170 // Do nothing in this case 1181 // Do nothing in this case
1171 break; 1182 break;
1183
1184 default:
1185 return dmError(DMERR_INTERNAL,
1186 "Unhandled op type %d in "
1187 "op #%d, offs=%d ($%04x), bank=%d, size=%d ($%04x) @ %d ($%04x)\n",
1188 op->type, i, op->offs, op->offs, op->bank, size, size, buf->len, buf->len);
1172 } 1189 }
1173 break; 1190 break;
1174 1191
1175 default: 1192 default:
1176 return dmError(DMERR_INTERNAL, 1193 return dmError(DMERR_INTERNAL,