]> git.draconx.ca Git - cdecl99.git/blobdiff - src/typemap.c
Kill typemap_is_valid.
[cdecl99.git] / src / typemap.c
index 0e5b41c49b73ee95cba18bf770e59a5345fc7c36..61456dd4a31a644393731af2afa3aed9273926bd 100644 (file)
@@ -36,16 +36,6 @@ static unsigned long add_typespec(unsigned long map, struct cdecl_declspec *s)
        return map | (1ul<<s->type);
 }
 
-bool cdecl__typemap_is_valid(unsigned long map)
-{
-       switch (map) {
-#      include "validtypes.h"
-               return true;
-       }
-
-       return false;
-}
-
 unsigned long cdecl__build_typemap(struct cdecl_declspec *s)
 {
        unsigned long map = 0;
@@ -56,8 +46,17 @@ unsigned long cdecl__build_typemap(struct cdecl_declspec *s)
 
                map = add_typespec(map, c);
                if (map == -1)
-                       break;
+                       return -1;
        }
 
-       return map;
+       switch (map) {
+       case 0:
+               fprintf(stderr, "no type specifiers\n");
+               return -1;
+#      include "validtypes.h"
+               return map;
+       default:
+               fprintf(stderr, "conflicting type specifiers\n");
+               return -1;
+       }
 }