From 01b937d82e17be4a925ffd8c4a233e628ff6636f Mon Sep 17 00:00:00 2001 From: ceriel Date: Tue, 21 Nov 1989 11:28:56 +0000 Subject: [PATCH] some arith variables changed into int --- lang/cem/cemcom.ansi/struct.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/lang/cem/cemcom.ansi/struct.c b/lang/cem/cemcom.ansi/struct.c index ac3e14e88..68e7336f6 100644 --- a/lang/cem/cemcom.ansi/struct.c +++ b/lang/cem/cemcom.ansi/struct.c @@ -325,10 +325,14 @@ add_field(szp, fd, fdtpp, idf, stp) an explicit alignment is given, a new address is needed. Note that the fields are packed into machine words. */ - long bits_in_type = word_size * 8; +#ifdef word_size +#define bits_in_type ((int)(8*word_size)) +#else + int bits_in_type = (int)word_size * 8; +#endif static int field_offset = (arith)0; static struct type *current_struct = 0; - static long bits_declared; /* nr of bits used in *field_offset */ + static int bits_declared; /* nr of bits used in *field_offset */ if (current_struct != stp) { /* This struct differs from the last one @@ -354,7 +358,7 @@ add_field(szp, fd, fdtpp, idf, stp) strict("non-portable field type"); case INT: /* right type; size OK? */ - if ((*fdtpp)->tp_size > word_size) { + if ((int) (*fdtpp)->tp_size > (int) word_size) { error("bit field type %s does not fit in a word", symbol2str((*fdtpp)->tp_fund)); *fdtpp = error_type; @@ -377,7 +381,7 @@ add_field(szp, fd, fdtpp, idf, stp) field_offset = align(*szp, int_align); *szp = field_offset + int_size; stp->tp_align = lcm(stp->tp_align, int_align); - bits_declared = (arith)0; + bits_declared = 0; field_busy = 1; } @@ -419,7 +423,7 @@ add_field(szp, fd, fdtpp, idf, stp) else /* adjust the field at the left */ fd->fd_shift = bits_in_type - bits_declared; - if (stp->tp_fund == UNION) bits_declared = (arith)0; + if (stp->tp_fund == UNION) bits_declared = 0; return field_offset; } -- 2.34.1