more modifications due to lint

This commit is contained in:
dick
1988-08-23 12:45:11 +00:00
parent 9b082e6d5a
commit 78599e150a
15 changed files with 60 additions and 67 deletions

View File

@@ -20,28 +20,29 @@
/* conversion() generates the EM code for a conversion between
the types char, short, int, long, float, double and pointer.
In case of integral type, the notion signed / unsigned is
taken into account.
There are three conversion types: signed, unsigned and floating.
The EM code to obtain this conversion looks like:
LOC sizeof(from_type)
LOC sizeof(to_type)
C??
*/
static int convtype();
conversion(from_type, to_type)
register struct type *from_type, *to_type;
{
register arith from_size = from_type->tp_size;
register arith to_size = to_type->tp_size;
int from_fund = fundamental(from_type);
int to_fund = fundamental(to_type);
int from_cnvtype = convtype(from_type);
int to_cnvtype = convtype(to_type);
if ((int)to_size < (int)word_size) to_size = word_size;
if ((int)from_size == (int)to_size && from_fund == to_fund)
if ((int)from_size == (int)to_size && from_cnvtype == to_cnvtype)
return;
switch (from_fund) {
switch (from_cnvtype) {
case T_SIGNED:
switch (to_fund) {
switch (to_cnvtype) {
case T_SIGNED:
C_loc(from_size);
C_loc(to_size);
@@ -59,7 +60,7 @@ conversion(from_type, to_type)
}
C_loc(from_size);
C_loc(to_size);
if (to_fund == T_UNSIGNED) C_ciu();
if (to_cnvtype == T_UNSIGNED) C_ciu();
else C_cif();
break;
}
@@ -68,7 +69,7 @@ conversion(from_type, to_type)
if ((int)from_size < (int)word_size) from_size = word_size;
C_loc(from_size);
C_loc(to_size);
switch (to_fund) {
switch (to_cnvtype) {
case T_SIGNED:
C_cui();
break;
@@ -86,7 +87,7 @@ conversion(from_type, to_type)
case T_FLOATING:
C_loc(from_size);
C_loc(to_size);
switch (to_fund) {
switch (to_cnvtype) {
case T_SIGNED:
C_cfi();
break;
@@ -104,12 +105,12 @@ conversion(from_type, to_type)
}
if ((int)(to_type->tp_size) < (int)word_size
#ifndef NOFLOAT
&& to_fund != T_FLOATING
&& to_cnvtype != T_FLOATING
#endif NOFLOAT
) {
extern long full_mask[];
if (to_fund == T_SIGNED) {
if (to_cnvtype == T_SIGNED) {
C_loc(to_type->tp_size);
C_loc(word_size);
C_cii();
@@ -121,11 +122,11 @@ conversion(from_type, to_type)
}
}
/* fundamental() returns in which category a given type falls:
/* convtype() returns in which category a given type falls:
signed, unsigned or floating
*/
int
fundamental(tp)/* bad name ???*/
static int
convtype(tp)/* bad name ???*/
register struct type *tp;
{
switch (tp->tp_fund) {
@@ -141,8 +142,8 @@ fundamental(tp)/* bad name ???*/
case DOUBLE:
return T_FLOATING;
#endif NOFLOAT
case POINTER: /* pointer : signed / unsigned ??? */
return T_SIGNED;
case POINTER:
return T_UNSIGNED;
}
return 0;
}