- if (declaration->declared_storage_class == STORAGE_CLASS_TYPEDEF) {
- errorf(HERE, "typedef not allowed in parameter list");
- } else if (declaration->declared_storage_class != STORAGE_CLASS_NONE
- && declaration->declared_storage_class != STORAGE_CLASS_REGISTER) {
- errorf(HERE, "parameter may only have none or register storage class");
+ switch (declaration->declared_storage_class) {
+ case STORAGE_CLASS_TYPEDEF:
+ errorf(pos, "typedef not allowed in parameter list");
+ break;
+
+ /* Allowed storage classes */
+ case STORAGE_CLASS_NONE:
+ case STORAGE_CLASS_REGISTER:
+ break;
+
+ default:
+ errorf(pos, "parameter may only have none or register storage class");
+ break;