fix switch/enum warnings with 'default: abort();'

This commit is contained in:
Mark Pictor committed 2011-08-02 06:09:31 -04:00
1 parent 4a6179613d
commit b10a69704c
7 files changed
+35 -7

No files matched your search

+4
View File
@@ -2924,6 +2924,10 @@ STEPfile::AppendFile (istream* in, int useTechCor)
// valid_insts = ReadWorkingData2 (*in2);
valid_insts = ReadData2 (*in2, useTechCor);
break;
default:
cerr << "STEPfile::AppendFile: type " << _fileType << " not handled by switch statement. " << __FILE__ << ":" << __LINE__ << endl;
abort();
}
//check for "ENDSEC;"
+3
View File
@@ -557,6 +557,9 @@ STEPcomplex::BuildAttrs(const char *s )
#endif
break;
}
default:
cerr << "STEPcomplex::BuildAttrs: type " << ad->NonRefType() << " not handled by switch statement. " << __FILE__ << ":" << __LINE__ << endl;
abort();
}
a -> set_null ();
+3
View File
@@ -1400,6 +1400,9 @@ TYPE_body_out(Type t, int level)
wrap(" OF");
TYPEunique_or_optional_out(tb);
break;
default:
printf("Error in exppp.c, line 1407: type %d not handled by switch statement.",tb->type);
abort();
}
TYPE_head_out(tb->base,level);
+2
View File
@@ -246,6 +246,8 @@ TYPEinherits_from(Type t, enum type_enum e)
return((tb->type == set_)?True:TYPE_inherits_from(tb->base,e));
case list_:
return((tb->type == list_)?True:TYPE_inherits_from(tb->base,e));
default:
break;
}
return (tb->type == e);
}
+17 -7
View File
@@ -3318,18 +3318,22 @@ ENTITYlib_print (Entity entity, FILE* file,Schema schema)
LIBmemberFunctionPrint (entity, file);
}
//FIXME should return bool
/* return 1 if types are predefined by us */
int
TYPEis_builtin(const Type t) {
switch( TYPEget_body(t)->type) {/* dunno if correct*/
case integer_:
case real_:
case string_:
case binary_:
case boolean_:
case number_:
case logical_:
case integer_:
case real_:
case string_:
case binary_:
case boolean_:
case number_:
case logical_:
return 1;
break;
default:
break;
}
return 0;
}
@@ -3750,6 +3754,9 @@ ENTITYincode_print (Entity entity, FILE* file,Schema schema)
TYPEget_body(v->type)->base->symbol.name);
fprintf(file,"// inverse entity 3 %s\n",TYPEget_body(v->type)->base->symbol.name);
break;
default:
printf("Error in classes.c, line 3783: type %d not handled by switch statement.",TYPEget_body(v->type)->type);
abort();
}
}
}
@@ -4522,6 +4529,9 @@ TypeBody_Description(TypeBody body, char *buf)
strcat(buf," OF");
if (body->flags.unique) strcat(buf," UNIQUE");
break;
default:
printf("Error in classes.c, line 4596: type %d not handled by switch statement.",body->type);
abort();
}
Type_Description(body->base,buf);
+3
View File
@@ -649,6 +649,9 @@ GetTypeDescriptorName( Type t )
case number_:
case generic_:
return "TypeDescriptor";
default:
printf("Error in classes_misc.c, line 655: type %d not handled by switch statement.",TYPEget_body(t)->type);
abort();
}
}
+3
View File
@@ -427,6 +427,9 @@ non_unique_types_vector ( const Type type, int* tvec )
case number_:
tvec[tnumber]++;
break;
default:
printf("Error in selects.c, line 433: type %d not handled by switch statement.",TYPEget_body(t)->type);
abort();
}
LISTod;
}