lots and lots of changes & improvements

This commit is contained in:
eck
1989-09-19 16:13:23 +00:00
parent 18439ffa3f
commit fa4e6eecb4
59 changed files with 1826 additions and 1571 deletions

View File

@@ -6,7 +6,6 @@
/* MAIN PROGRAM */
#include "lint.h"
#include "nofloat.h"
#include <system.h>
#include "nopp.h"
#include "target_sizes.h"
@@ -25,7 +24,6 @@
#include "LLlex.h"
#include <alloc.h>
#include "specials.h"
#include "noRoption.h"
#include "nocross.h"
#include "sizes.h"
#include "align.h"
@@ -55,11 +53,9 @@ arith
dword_size = (2 * SZ_WORD),
int_size = SZ_INT,
long_size = SZ_LONG,
#ifndef NOFLOAT
float_size = SZ_FLOAT,
double_size = SZ_DOUBLE,
lngdbl_size = SZ_LNGDBL,
#endif NOFLOAT
pointer_size = SZ_POINTER;
int
@@ -67,11 +63,9 @@ int
word_align = AL_WORD,
int_align = AL_INT,
long_align = AL_LONG,
#ifndef NOFLOAT
float_align = AL_FLOAT,
double_align = AL_DOUBLE,
lngdbl_align = AL_LNGDBL,
#endif NOFLOAT
pointer_align = AL_POINTER,
struct_align = AL_STRUCT,
union_align = AL_UNION;
@@ -113,7 +107,7 @@ main(argc, argv)
{
char *par = &argv[1][1];
do_option(par, 1);
do_option(par);
argc--, argv++;
}
#ifdef LINT
@@ -240,7 +234,7 @@ init()
transparent to the user.
*/
gen_type = standard_type(GENERIC, 0, 1, (arith)1);
char_type = standard_type(CHAR, 0, 1, (arith)1);
schar_type = standard_type(CHAR, 0, 1, (arith)1);
uchar_type = standard_type(CHAR, UNSIGNED, 1, (arith)1);
short_type = standard_type(SHORT, 0, short_align, short_size);
@@ -259,11 +253,9 @@ init()
long_type = standard_type(LONG, 0, long_align, long_size);
ulong_type = standard_type(LONG, UNSIGNED, long_align, long_size);
#ifndef NOFLOAT
float_type = standard_type(FLOAT, 0, float_align, float_size);
double_type = standard_type(DOUBLE, 0, double_align, double_size);
lngdbl_type = standard_type(LNGDBL, 0, lngdbl_align, lngdbl_size);
#endif NOFLOAT
void_type = standard_type(VOID, 0, 1, (arith)0);
label_type = standard_type(LABEL, 0, 0, (arith)0);
error_type = standard_type(ERRONEOUS, 0, 1, (arith)1);
@@ -292,17 +284,15 @@ init()
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 */
/* Build a type for function returning int (3.3.2.2) */
funint_type = construct_type(FUNCTION, int_type, 0, (arith)0, NO_PROTO);
string_type = construct_type(POINTER, char_type, 0, (arith)0, NO_PROTO);
string_type = construct_type(POINTER, schar_type, 0, (arith)0, NO_PROTO);
/* Define the standard type identifiers. */
add_def(str2idf("char"), TYPEDEF, char_type, L_UNIVERSAL);
add_def(str2idf("char"), TYPEDEF, schar_type, L_UNIVERSAL);
add_def(str2idf("int"), TYPEDEF, int_type, L_UNIVERSAL);
#ifndef NOFLOAT
add_def(str2idf("float"), TYPEDEF, float_type, L_UNIVERSAL);
add_def(str2idf("double"), TYPEDEF, double_type, L_UNIVERSAL);
#endif NOFLOAT
add_def(str2idf("void"), TYPEDEF, void_type, L_UNIVERSAL);
stack_level();
}
@@ -372,17 +362,16 @@ preprocess()
char sbuf[1024]; /* a transient buffer */
char *bts2str();
print("\"%s\" ", bts2str(dot.tk_bts, dot.tk_len, sbuf));
print("\"%s\" ", bts2str(dot.tk_bts, dot.tk_len -
1, sbuf));
break;
}
case INTEGER:
print("%ld ", dot.tk_ival);
break;
#ifndef NOFLOAT
case FLOATING:
print("%s ", dot.tk_fval);
break;
#endif NOFLOAT
case EOI:
case EOF:
return;