made to fit on PDP-11
authorceriel <none@none>
Tue, 5 Jul 1988 18:06:00 +0000 (18:06 +0000)
committerceriel <none@none>
Tue, 5 Jul 1988 18:06:00 +0000 (18:06 +0000)
lang/cem/cemcom/LLlex.c
lang/cem/cemcom/conversion.c
lang/cem/cemcom/cstoper.c
lang/cem/cemcom/eval.c
lang/cem/cemcom/main.c

index 080a872..96e38d0 100644 (file)
@@ -304,7 +304,8 @@ firstline:
        }
        case STCHAR:                            /* character constant   */
        {
-               register arith val = 0, size = 0;
+               register arith val = 0;
+               int size = 0;
 
                LoadChar(ch);
                if (ch == '\'')
@@ -327,7 +328,7 @@ firstline:
                        size++;
                        LoadChar(ch);
                }
-               if (size > int_size)
+               if (size > (int)int_size)
                        lexerror("character constant too long");
                ptok->tk_ival = val;
                ptok->tk_fund = INT;
index 614ebfe..f11e312 100644 (file)
@@ -36,8 +36,8 @@ conversion(from_type, to_type)
        int from_fund = fundamental(from_type);
        int to_fund = fundamental(to_type);
 
-       if (to_size < word_size) to_size = word_size;
-       if (from_size == to_size && from_fund == to_fund)
+       if ((int)to_size < (int)word_size) to_size = word_size;
+       if ((int)from_size == (int)to_size && from_fund == to_fund)
                return;
        switch (from_fund)      {
        case T_SIGNED:
@@ -51,7 +51,7 @@ conversion(from_type, to_type)
 #ifndef NOFLOAT
                case T_FLOATING:
 #endif NOOFLOAT
-                       if (from_size < word_size) {
+                       if ((int)from_size < (int)word_size) {
                                C_loc(from_size);
                                C_loc(word_size);
                                C_cii();
@@ -65,7 +65,7 @@ conversion(from_type, to_type)
                }
                break;
        case T_UNSIGNED:
-               if (from_size < word_size) from_size = word_size;
+               if ((int)from_size < (int)word_size) from_size = word_size;
                C_loc(from_size);
                C_loc(to_size);
                switch (to_fund)        {
@@ -102,7 +102,7 @@ conversion(from_type, to_type)
        default:
                crash("(conversion) illegal type conversion");
        }
-       if (to_type->tp_size < word_size
+       if ((int)(to_type->tp_size) < (int)word_size
 #ifndef NOFLOAT
            && to_fund != T_FLOATING
 #endif NOFLOAT
index 0208e19..49bcc16 100644 (file)
@@ -230,8 +230,8 @@ init_cst()
        }
        mach_long_size = i;
        mach_long_sign = 1L << (mach_long_size * 8 - 1);
-       if (long_size < mach_long_size)
+       if ((int)long_size < mach_long_size)
                fatal("sizeof (long) insufficient on this machine");
-       max_int = full_mask[(int)int_size] & ~(1L << (int_size * 8 - 1));
+       max_int = full_mask[(int)int_size] & ~(1L << ((int)int_size * 8 - 1));
        max_unsigned = full_mask[(int)int_size];
 }
index 1446758..7c09837 100644 (file)
@@ -29,7 +29,6 @@
 #include       "specials.h"
 
 #define        CRASH()         crash("EVAL: CRASH at line %u", __LINE__)
-#define        toword(n)       ((n) < word_size ? word_size : (n))
 
 char *symbol2str();
 char *long2str();
@@ -324,7 +323,7 @@ EVAL(expr, val, code, true_label, false_label)
                        if (gencode) {
                                arith size = tp->tp_size;
 
-                               if (size < word_size)
+                               if ((int)size < (int)word_size)
                                        size = word_size;
                                switch (oper) {
                                case '&':
@@ -679,7 +678,7 @@ assop(type, oper)
        register arith size;
        register uns = type->tp_unsigned;
 
-       if ((size = type->tp_size) < word_size)
+       if ((int)(size = type->tp_size) < (int)word_size)
                size = word_size;
        switch (type->tp_fund) {
        case CHAR:
index 66d41b7..43b67eb 100644 (file)
@@ -250,23 +250,23 @@ init()
                pointer arithmetic type which is equal to either
                int_type or long_type, depending on the pointer_size
        */
-       if (pointer_size == word_size)
+       if ((int)pointer_size == (int)word_size)
                pa_type = word_type;
        else
-       if (pointer_size == short_size)
+       if ((int)pointer_size == (int)short_size)
                pa_type = short_type;
        else
-       if (pointer_size == int_size)
+       if ((int)pointer_size == (int)int_size)
                pa_type = int_type;
        else
-       if (pointer_size == long_size)
+       if ((int)pointer_size == (int)long_size)
                pa_type = long_type;
        else
                fatal("pointer size incompatible with any integral size");
 
-       if (int_size != word_size)
+       if ((int)int_size != (int)word_size)
                fatal("int_size and word_size are not equal");
-       if (short_size > int_size || int_size > long_size)
+       if ((int)short_size > (int)int_size || (int)int_size > (int)long_size)
                fatal("sizes of short/int/long decreasing");
 
        /* Build a type for function returning int, RM 13 */