made to fit on PDP-11

This commit is contained in:
ceriel 1988-07-05 18:06:00 +00:00
parent 938b7e3d9d
commit e1cb398e02
5 changed files with 18 additions and 18 deletions

View 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;

View 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

View 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];
}

View 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:

View 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 */