made to fit on PDP-11
This commit is contained in:
parent
938b7e3d9d
commit
e1cb398e02
5 changed files with 18 additions and 18 deletions
|
@ -304,7 +304,8 @@ firstline:
|
||||||
}
|
}
|
||||||
case STCHAR: /* character constant */
|
case STCHAR: /* character constant */
|
||||||
{
|
{
|
||||||
register arith val = 0, size = 0;
|
register arith val = 0;
|
||||||
|
int size = 0;
|
||||||
|
|
||||||
LoadChar(ch);
|
LoadChar(ch);
|
||||||
if (ch == '\'')
|
if (ch == '\'')
|
||||||
|
@ -327,7 +328,7 @@ firstline:
|
||||||
size++;
|
size++;
|
||||||
LoadChar(ch);
|
LoadChar(ch);
|
||||||
}
|
}
|
||||||
if (size > int_size)
|
if (size > (int)int_size)
|
||||||
lexerror("character constant too long");
|
lexerror("character constant too long");
|
||||||
ptok->tk_ival = val;
|
ptok->tk_ival = val;
|
||||||
ptok->tk_fund = INT;
|
ptok->tk_fund = INT;
|
||||||
|
|
|
@ -36,8 +36,8 @@ conversion(from_type, to_type)
|
||||||
int from_fund = fundamental(from_type);
|
int from_fund = fundamental(from_type);
|
||||||
int to_fund = fundamental(to_type);
|
int to_fund = fundamental(to_type);
|
||||||
|
|
||||||
if (to_size < word_size) to_size = word_size;
|
if ((int)to_size < (int)word_size) to_size = word_size;
|
||||||
if (from_size == to_size && from_fund == to_fund)
|
if ((int)from_size == (int)to_size && from_fund == to_fund)
|
||||||
return;
|
return;
|
||||||
switch (from_fund) {
|
switch (from_fund) {
|
||||||
case T_SIGNED:
|
case T_SIGNED:
|
||||||
|
@ -51,7 +51,7 @@ conversion(from_type, to_type)
|
||||||
#ifndef NOFLOAT
|
#ifndef NOFLOAT
|
||||||
case T_FLOATING:
|
case T_FLOATING:
|
||||||
#endif NOOFLOAT
|
#endif NOOFLOAT
|
||||||
if (from_size < word_size) {
|
if ((int)from_size < (int)word_size) {
|
||||||
C_loc(from_size);
|
C_loc(from_size);
|
||||||
C_loc(word_size);
|
C_loc(word_size);
|
||||||
C_cii();
|
C_cii();
|
||||||
|
@ -65,7 +65,7 @@ conversion(from_type, to_type)
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case T_UNSIGNED:
|
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(from_size);
|
||||||
C_loc(to_size);
|
C_loc(to_size);
|
||||||
switch (to_fund) {
|
switch (to_fund) {
|
||||||
|
@ -102,7 +102,7 @@ conversion(from_type, to_type)
|
||||||
default:
|
default:
|
||||||
crash("(conversion) illegal type conversion");
|
crash("(conversion) illegal type conversion");
|
||||||
}
|
}
|
||||||
if (to_type->tp_size < word_size
|
if ((int)(to_type->tp_size) < (int)word_size
|
||||||
#ifndef NOFLOAT
|
#ifndef NOFLOAT
|
||||||
&& to_fund != T_FLOATING
|
&& to_fund != T_FLOATING
|
||||||
#endif NOFLOAT
|
#endif NOFLOAT
|
||||||
|
|
|
@ -230,8 +230,8 @@ init_cst()
|
||||||
}
|
}
|
||||||
mach_long_size = i;
|
mach_long_size = i;
|
||||||
mach_long_sign = 1L << (mach_long_size * 8 - 1);
|
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");
|
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];
|
max_unsigned = full_mask[(int)int_size];
|
||||||
}
|
}
|
||||||
|
|
|
@ -29,7 +29,6 @@
|
||||||
#include "specials.h"
|
#include "specials.h"
|
||||||
|
|
||||||
#define CRASH() crash("EVAL: CRASH at line %u", __LINE__)
|
#define CRASH() crash("EVAL: CRASH at line %u", __LINE__)
|
||||||
#define toword(n) ((n) < word_size ? word_size : (n))
|
|
||||||
|
|
||||||
char *symbol2str();
|
char *symbol2str();
|
||||||
char *long2str();
|
char *long2str();
|
||||||
|
@ -324,7 +323,7 @@ EVAL(expr, val, code, true_label, false_label)
|
||||||
if (gencode) {
|
if (gencode) {
|
||||||
arith size = tp->tp_size;
|
arith size = tp->tp_size;
|
||||||
|
|
||||||
if (size < word_size)
|
if ((int)size < (int)word_size)
|
||||||
size = word_size;
|
size = word_size;
|
||||||
switch (oper) {
|
switch (oper) {
|
||||||
case '&':
|
case '&':
|
||||||
|
@ -679,7 +678,7 @@ assop(type, oper)
|
||||||
register arith size;
|
register arith size;
|
||||||
register uns = type->tp_unsigned;
|
register uns = type->tp_unsigned;
|
||||||
|
|
||||||
if ((size = type->tp_size) < word_size)
|
if ((int)(size = type->tp_size) < (int)word_size)
|
||||||
size = word_size;
|
size = word_size;
|
||||||
switch (type->tp_fund) {
|
switch (type->tp_fund) {
|
||||||
case CHAR:
|
case CHAR:
|
||||||
|
|
|
@ -250,23 +250,23 @@ init()
|
||||||
pointer arithmetic type which is equal to either
|
pointer arithmetic type which is equal to either
|
||||||
int_type or long_type, depending on the pointer_size
|
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;
|
pa_type = word_type;
|
||||||
else
|
else
|
||||||
if (pointer_size == short_size)
|
if ((int)pointer_size == (int)short_size)
|
||||||
pa_type = short_type;
|
pa_type = short_type;
|
||||||
else
|
else
|
||||||
if (pointer_size == int_size)
|
if ((int)pointer_size == (int)int_size)
|
||||||
pa_type = int_type;
|
pa_type = int_type;
|
||||||
else
|
else
|
||||||
if (pointer_size == long_size)
|
if ((int)pointer_size == (int)long_size)
|
||||||
pa_type = long_type;
|
pa_type = long_type;
|
||||||
else
|
else
|
||||||
fatal("pointer size incompatible with any integral size");
|
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");
|
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");
|
fatal("sizes of short/int/long decreasing");
|
||||||
|
|
||||||
/* Build a type for function returning int, RM 13 */
|
/* Build a type for function returning int, RM 13 */
|
||||||
|
|
Loading…
Reference in a new issue