]> git.sur5r.net Git - cc65/blobdiff - src/cc65/datatype.c
Fixed multi line macro bug
[cc65] / src / cc65 / datatype.c
index 1c2f0a3efbfc7f195ef87cd6ec38cde786348f8d..4da5470b98b8e84c20ad2860e49a6d5b0aa3b01c 100644 (file)
@@ -230,7 +230,7 @@ void PrintType (FILE* F, const type* Type)
 /* Output translation of type array. */
 {
     type T;
-
+    unsigned long Size;
 
     /* Walk over the complete string */
     while ((T = *Type++) != T_END) {
@@ -280,12 +280,20 @@ void PrintType (FILE* F, const type* Type)
                Type += DECODE_SIZE;
                break;
            case T_TYPE_ARRAY:
-                       fprintf (F, "array[%lu] of ", Decode (Type));
-               Type += DECODE_SIZE;
-               break;
+               /* Recursive call */
+               PrintType (F, Type + DECODE_SIZE);
+               Size = Decode (Type);
+               if (Size == 0) {
+                   fprintf (F, "[]");
+               } else {
+                   fprintf (F, "[%lu]", Size);
+               }
+               return;
            case T_TYPE_PTR:
-               fprintf (F, "pointer to ");
-               break;
+               /* Recursive call */
+               PrintType (F, Type);
+               fprintf (F, "*");
+               return;
            case T_TYPE_FUNC:
                fprintf (F, "function returning ");
                Type += DECODE_SIZE;