Wed Oct 27 15:48:58 PDT 1999

(Mandrake)

Now that we've gone through with -ansi -pedantic and there are no more
warnings, maybe Tru64 support will work in epp?


SVN revision: 1002
This commit is contained in:
Mandrake 1999-10-27 15:07:11 +00:00
parent a6fe224828
commit 40bcd3daec
6 changed files with 705 additions and 674 deletions

View File

@ -56,3 +56,11 @@ Wed Oct 27 09:55:14 PDT 1999
(Mandrake) (Mandrake)
Trying to get this to build under Tru64 Trying to get this to build under Tru64
-------------------------------------------------------------------------------
Wed Oct 27 15:48:58 PDT 1999
(Mandrake)
Now that we've gone through with -ansi -pedantic and there are no more
warnings, maybe Tru64 support will work in epp?

View File

@ -43,7 +43,7 @@
struct arglist struct arglist
{ {
struct arglist *next; struct arglist *next;
unsigned char *name; unsigned char *name;
int length; int length;
int argno; int argno;
}; };
@ -279,7 +279,7 @@ cpp_lex(pfile)
register struct token *toktab; register struct token *toktab;
enum cpp_token token; enum cpp_token token;
struct operation op; struct operation op;
unsigned char *tok_start, *tok_end; unsigned char *tok_start, *tok_end;
int old_written; int old_written;
retry: retry:
@ -317,7 +317,7 @@ cpp_lex(pfile)
case CPP_COMMENT: case CPP_COMMENT:
goto retry; goto retry;
case CPP_NUMBER: case CPP_NUMBER:
return parse_number(pfile, tok_start, tok_end - tok_start); return parse_number(pfile, (char *)tok_start, tok_end - tok_start);
case CPP_STRING: case CPP_STRING:
cpp_error(pfile, "string constants not allowed in #if expressions"); cpp_error(pfile, "string constants not allowed in #if expressions");
op.op = ERROR; op.op = ERROR;
@ -332,7 +332,7 @@ cpp_lex(pfile)
unsigned width = MAX_CHAR_TYPE_SIZE; unsigned width = MAX_CHAR_TYPE_SIZE;
int wide_flag = 0; int wide_flag = 0;
int max_chars; int max_chars;
unsigned char *ptr = tok_start; unsigned char *ptr = tok_start;
#ifdef MULTIBYTE_CHARS #ifdef MULTIBYTE_CHARS
char token_buffer[MAX_LONG_TYPE_SIZE / MAX_CHAR_TYPE_SIZE + MB_CUR_MAX]; char token_buffer[MAX_LONG_TYPE_SIZE / MAX_CHAR_TYPE_SIZE + MB_CUR_MAX];
@ -1065,7 +1065,7 @@ cpp_parse_expr(pfile)
else else
{ {
new_stack = (struct operation *)xmalloc(new_size); new_stack = (struct operation *)xmalloc(new_size);
bcopy((char *)stack, (char *)new_stack, old_size); memcpy((char *)stack, (char *)new_stack, old_size);
} }
stack = new_stack; stack = new_stack;
top = (struct operation *)((char *)new_stack + old_size); top = (struct operation *)((char *)new_stack + old_size);

View File

@ -26,10 +26,10 @@
#include "cpphash.h" #include "cpphash.h"
static HASHNODE *hashtab[HASHSIZE]; static HASHNODE *hashtab[HASHSIZE];
HASHNODE *cpp_lookup(struct parse_file *pfile, const unsigned char * name, int len, HASHNODE *cpp_lookup(struct parse_file *pfile, const unsigned char *name, int len,
int hash); int hash);
void delete_macro(HASHNODE * hp); void delete_macro(HASHNODE * hp);
HASHNODE *install(unsigned char * name, int len, enum node_type type, int ivalue, HASHNODE *install(unsigned char *name, int len, enum node_type type, int ivalue,
char *value, int hash); char *value, int hash);
/* Define a generic NULL if one hasn't already been defined. */ /* Define a generic NULL if one hasn't already been defined. */
@ -77,7 +77,7 @@ hashf(name, len, hashsize)
HASHNODE * HASHNODE *
cpp_lookup(pfile, name, len, hash) cpp_lookup(pfile, name, len, hash)
struct parse_file *pfile; struct parse_file *pfile;
const unsigned char *name; const unsigned char *name;
int len; int len;
int hash; int hash;
{ {
@ -96,7 +96,7 @@ cpp_lookup(pfile, name, len, hash)
bucket = hashtab[hash]; bucket = hashtab[hash];
while (bucket) while (bucket)
{ {
if (bucket->length == len && strncmp(bucket->name, name, len) == 0) if (bucket->length == len && strncmp((char *)bucket->name, (char *)name, len) == 0)
return bucket; return bucket;
bucket = bucket->next; bucket = bucket->next;
} }
@ -164,7 +164,7 @@ delete_macro(hp)
*/ */
HASHNODE * HASHNODE *
install(name, len, type, ivalue, value, hash) install(name, len, type, ivalue, value, hash)
unsigned char *name; unsigned char *name;
int len; int len;
enum node_type type; enum node_type type;
int ivalue; int ivalue;
@ -173,7 +173,7 @@ install(name, len, type, ivalue, value, hash)
{ {
register HASHNODE *hp; register HASHNODE *hp;
register int i, bucket; register int i, bucket;
register unsigned char *p, *q; register unsigned char *p, *q;
if (len < 0) if (len < 0)
{ {
@ -200,7 +200,7 @@ install(name, len, type, ivalue, value, hash)
hp->value.ival = ivalue; hp->value.ival = ivalue;
else else
hp->value.cpval = value; hp->value.cpval = value;
hp->name = ((unsigned char *) hp) + sizeof(HASHNODE); hp->name = ((unsigned char *)hp) + sizeof(HASHNODE);
p = hp->name; p = hp->name;
q = name; q = name;
for (i = 0; i < len; i++) for (i = 0; i < len; i++)

View File

@ -1,36 +1,38 @@
enum node_type; enum node_type;
/* different kinds of things that can appear in the value field /* different kinds of things that can appear in the value field
of a hash node. Actually, this may be useless now. */ * of a hash node. Actually, this may be useless now. */
union hashval { union hashval
int ival; {
char *cpval; int ival;
DEFINITION *defn; char *cpval;
}; DEFINITION *defn;
};
struct hashnode { struct hashnode
struct hashnode *next; /* double links for easy deletion */ {
struct hashnode *prev; struct hashnode *next; /* double links for easy deletion */
struct hashnode **bucket_hdr; /* also, a back pointer to this node's hash struct hashnode *prev;
chain is kept, in case the node is the head struct hashnode **bucket_hdr; /* also, a back pointer to this node's hash
of the chain and gets deleted. */ * chain is kept, in case the node is the head
enum node_type type; /* type of special token */ * of the chain and gets deleted. */
int length; /* length of token, for quick comparison */ enum node_type type; /* type of special token */
unsigned char *name; /* the actual name */ int length; /* length of token, for quick comparison */
union hashval value; /* pointer to expansion, or whatever */ unsigned char *name; /* the actual name */
}; union hashval value; /* pointer to expansion, or whatever */
};
typedef struct hashnode HASHNODE; typedef struct hashnode HASHNODE;
/* Some definitions for the hash table. The hash function MUST be /* Some definitions for the hash table. The hash function MUST be
computed as shown in hashf () below. That is because the rescan * computed as shown in hashf () below. That is because the rescan
loop computes the hash value `on the fly' for most tokens, * loop computes the hash value `on the fly' for most tokens,
in order to avoid the overhead of a lot of procedure calls to * in order to avoid the overhead of a lot of procedure calls to
the hashf () function. Hashf () only exists for the sake of * the hashf () function. Hashf () only exists for the sake of
politeness, for use when speed isn't so important. */ * politeness, for use when speed isn't so important. */
#define HASHSIZE 1403 #define HASHSIZE 1403
#define HASHSTEP(old, c) ((old << 2) + c) #define HASHSTEP(old, c) ((old << 2) + c)
#define MAKE_POS(v) (v & 0x7fffffff) /* make number positive */ #define MAKE_POS(v) (v & 0x7fffffff) /* make number positive */
extern HASHNODE* install PARAMS ((unsigned char*,int,enum node_type, int,char*,int)); extern HASHNODE *install PARAMS((unsigned char *, int, enum node_type, int, char *, int));

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff