From: ceriel Date: Tue, 5 Jul 1988 18:06:00 +0000 (+0000) Subject: made to fit on PDP-11 X-Git-Tag: release-5-5~3094 X-Git-Url: https://git.ndcode.org/public/gitweb.cgi?a=commitdiff_plain;h=e1cb398e028d09e9608e86ba6a4e529d0dfe7faf;p=ack.git made to fit on PDP-11 --- diff --git a/lang/cem/cemcom/LLlex.c b/lang/cem/cemcom/LLlex.c index 080a8722e..96e38d022 100644 --- a/lang/cem/cemcom/LLlex.c +++ b/lang/cem/cemcom/LLlex.c @@ -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; diff --git a/lang/cem/cemcom/conversion.c b/lang/cem/cemcom/conversion.c index 614ebfefa..f11e312db 100644 --- a/lang/cem/cemcom/conversion.c +++ b/lang/cem/cemcom/conversion.c @@ -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 diff --git a/lang/cem/cemcom/cstoper.c b/lang/cem/cemcom/cstoper.c index 0208e1939..49bcc16a0 100644 --- a/lang/cem/cemcom/cstoper.c +++ b/lang/cem/cemcom/cstoper.c @@ -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]; } diff --git a/lang/cem/cemcom/eval.c b/lang/cem/cemcom/eval.c index 144675800..7c09837e8 100644 --- a/lang/cem/cemcom/eval.c +++ b/lang/cem/cemcom/eval.c @@ -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: diff --git a/lang/cem/cemcom/main.c b/lang/cem/cemcom/main.c index 66d41b7f4..43b67ebeb 100644 --- a/lang/cem/cemcom/main.c +++ b/lang/cem/cemcom/main.c @@ -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 */