de-linted somewhat
This commit is contained in:
parent
4483f237f6
commit
5ba9685e76
5 changed files with 19 additions and 16 deletions
|
@ -31,8 +31,9 @@ int AccFileSpecifier = 0; /* return filespecifier <...> */
|
||||||
int LexSave = 0; /* last character read by GetChar */
|
int LexSave = 0; /* last character read by GetChar */
|
||||||
extern int InputLevel; /* # of current macro expansions */
|
extern int InputLevel; /* # of current macro expansions */
|
||||||
|
|
||||||
char *string_token();
|
extern char *string_token();
|
||||||
arith char_constant();
|
extern char *strcpy();
|
||||||
|
extern arith char_constant();
|
||||||
#define FLG_ESEEN 0x01 /* possibly a floating point number */
|
#define FLG_ESEEN 0x01 /* possibly a floating point number */
|
||||||
#define FLG_DOTSEEN 0x02 /* certainly a floating point number */
|
#define FLG_DOTSEEN 0x02 /* certainly a floating point number */
|
||||||
|
|
||||||
|
@ -57,7 +58,7 @@ GetToken(ptok)
|
||||||
|
|
||||||
again: /* rescan the input after an error or replacement */
|
again: /* rescan the input after an error or replacement */
|
||||||
ch = GetChar();
|
ch = GetChar();
|
||||||
go_on: /* rescan, the following character has been read */
|
/* rescan, the following character has been read */
|
||||||
if ((ch & 0200) && ch != EOI) /* stop on non-ascii character */
|
if ((ch & 0200) && ch != EOI) /* stop on non-ascii character */
|
||||||
fatal("non-ascii '\\%03o' read", ch & 0377);
|
fatal("non-ascii '\\%03o' read", ch & 0377);
|
||||||
/* keep track of the place of the token in the file */
|
/* keep track of the place of the token in the file */
|
||||||
|
@ -387,11 +388,11 @@ string_token(nm, stop_char)
|
||||||
ch = quoted(GetChar());
|
ch = quoted(GetChar());
|
||||||
str[pos++] = ch;
|
str[pos++] = ch;
|
||||||
if (pos == str_size)
|
if (pos == str_size)
|
||||||
str = Realloc(str, str_size <<= 1);
|
str = Realloc(str, (unsigned)(str_size <<= 1));
|
||||||
ch = GetChar();
|
ch = GetChar();
|
||||||
}
|
}
|
||||||
str[pos++] = '\0'; /* for filenames etc. */
|
str[pos++] = '\0'; /* for filenames etc. */
|
||||||
str = Realloc(str, pos);
|
str = Realloc(str, (unsigned)pos);
|
||||||
return str;
|
return str;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -34,7 +34,7 @@ GENOPTIONS =
|
||||||
|
|
||||||
# Special #defines during compilation
|
# Special #defines during compilation
|
||||||
CDEFS = $(LIB_INCLUDES)
|
CDEFS = $(LIB_INCLUDES)
|
||||||
CFLAGS = $(CDEFS) $(COPTIONS) -O# # we cannot pass the COPTIONS to lint!
|
CFLAGS = $(CDEFS) $(COPTIONS)# # we cannot pass the COPTIONS to lint!
|
||||||
|
|
||||||
# Grammar files and their objects
|
# Grammar files and their objects
|
||||||
LSRC = tokenfile.g expression.g
|
LSRC = tokenfile.g expression.g
|
||||||
|
|
|
@ -80,7 +80,7 @@ do_option(text)
|
||||||
error("malformed option -D%s", text);
|
error("malformed option -D%s", text);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
macro_def(str2idf(name, 0), mactext, -1, maclen, NOFLAG);
|
macro_def(str2idf(name, 0), mactext, -1, (int)maclen, NOFLAG);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 'I' : /* -Ipath : insert "path" into include list */
|
case 'I' : /* -Ipath : insert "path" into include list */
|
||||||
|
@ -90,7 +90,8 @@ do_option(text)
|
||||||
|
|
||||||
if (++inc_total > inc_max) {
|
if (++inc_total > inc_max) {
|
||||||
inctable = (char **)
|
inctable = (char **)
|
||||||
Realloc(inctable,(inc_max+=10)*sizeof(char *));
|
Realloc((char *)inctable,
|
||||||
|
(unsigned)((inc_max+=10)*sizeof(char *)));
|
||||||
}
|
}
|
||||||
|
|
||||||
for(i = inc_pos++; i < inc_total; i++) {
|
for(i = inc_pos++; i < inc_total; i++) {
|
||||||
|
|
|
@ -53,7 +53,7 @@ do_pragma()
|
||||||
*c_ptr = '\0';
|
*c_ptr = '\0';
|
||||||
while(c != '\n') {
|
while(c != '\n') {
|
||||||
if (c_ptr + 1 - cur_line == size) {
|
if (c_ptr + 1 - cur_line == size) {
|
||||||
cur_line = Realloc(cur_line, size += ITEXTSIZE);
|
cur_line = Realloc(cur_line, (unsigned)(size += ITEXTSIZE));
|
||||||
c_ptr = cur_line + size - 1;
|
c_ptr = cur_line + size - 1;
|
||||||
}
|
}
|
||||||
*c_ptr++ = c;
|
*c_ptr++ = c;
|
||||||
|
@ -63,8 +63,8 @@ do_pragma()
|
||||||
if (!pragma_nr) {
|
if (!pragma_nr) {
|
||||||
pragma_tab = (struct prag_info *)Malloc(sizeof(struct prag_info));
|
pragma_tab = (struct prag_info *)Malloc(sizeof(struct prag_info));
|
||||||
} else {
|
} else {
|
||||||
pragma_tab = (struct prag_info *)Realloc(pragma_tab
|
pragma_tab = (struct prag_info *)Realloc((char *)pragma_tab
|
||||||
, sizeof(struct prag_info) * (pragma_nr+1));
|
, (unsigned)(sizeof(struct prag_info) * (pragma_nr+1)));
|
||||||
}
|
}
|
||||||
pragma_tab[pragma_nr].pr_linnr = LineNumber;
|
pragma_tab[pragma_nr].pr_linnr = LineNumber;
|
||||||
pragma_tab[pragma_nr].pr_fil = FileName;
|
pragma_tab[pragma_nr].pr_fil = FileName;
|
||||||
|
@ -143,7 +143,7 @@ preprocess(fn)
|
||||||
free(pragma_tab[i].pr_text);
|
free(pragma_tab[i].pr_text);
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
free(pragma_tab);
|
free((char *) pragma_tab);
|
||||||
pragma_tab = (struct prag_info *)0;
|
pragma_tab = (struct prag_info *)0;
|
||||||
pragma_nr = 0;
|
pragma_nr = 0;
|
||||||
LineNumber = LiNo;
|
LineNumber = LiNo;
|
||||||
|
|
|
@ -22,6 +22,8 @@
|
||||||
#include "replace.h"
|
#include "replace.h"
|
||||||
|
|
||||||
extern char *GetIdentifier();
|
extern char *GetIdentifier();
|
||||||
|
extern char *strcpy();
|
||||||
|
extern char *strcat();
|
||||||
extern int InputLevel;
|
extern int InputLevel;
|
||||||
struct repl *ReplaceList; /* list of currently active macros */
|
struct repl *ReplaceList; /* list of currently active macros */
|
||||||
|
|
||||||
|
@ -254,7 +256,6 @@ struct repl *repl;
|
||||||
{
|
{
|
||||||
register struct repl *nrepl = ReplaceList;
|
register struct repl *nrepl = ReplaceList;
|
||||||
register struct args *ap = nrepl->r_args;
|
register struct args *ap = nrepl->r_args;
|
||||||
struct args *args = repl->r_args;
|
|
||||||
register char *p;
|
register char *p;
|
||||||
|
|
||||||
/* stash identifier name */
|
/* stash identifier name */
|
||||||
|
@ -731,7 +732,7 @@ add2repl(repl, ch)
|
||||||
|
|
||||||
assert(index < repl->r_size);
|
assert(index < repl->r_size);
|
||||||
if (index + 2 >= repl->r_size) {
|
if (index + 2 >= repl->r_size) {
|
||||||
repl->r_text = Realloc(repl->r_text, repl->r_size <<= 1);
|
repl->r_text = Realloc(repl->r_text, (unsigned)(repl->r_size <<= 1));
|
||||||
repl->r_ptr = repl->r_text + index;
|
repl->r_ptr = repl->r_text + index;
|
||||||
}
|
}
|
||||||
*repl->r_ptr++ = ch;
|
*repl->r_ptr++ = ch;
|
||||||
|
@ -756,7 +757,7 @@ stash(repl, ch, stashraw)
|
||||||
assert(index < args->a_expsize);
|
assert(index < args->a_expsize);
|
||||||
if (index + 1 >= args->a_expsize) {
|
if (index + 1 >= args->a_expsize) {
|
||||||
args->a_expbuf = Realloc(args->a_expbuf,
|
args->a_expbuf = Realloc(args->a_expbuf,
|
||||||
args->a_expsize <<= 1);
|
(unsigned)(args->a_expsize <<= 1));
|
||||||
args->a_expptr = args->a_expbuf + index;
|
args->a_expptr = args->a_expbuf + index;
|
||||||
}
|
}
|
||||||
*args->a_expptr++ = ch;
|
*args->a_expptr++ = ch;
|
||||||
|
@ -767,7 +768,7 @@ stash(repl, ch, stashraw)
|
||||||
assert(index < args->a_rawsize);
|
assert(index < args->a_rawsize);
|
||||||
if (index + 1 >= args->a_rawsize) {
|
if (index + 1 >= args->a_rawsize) {
|
||||||
args->a_rawbuf = Realloc(args->a_rawbuf,
|
args->a_rawbuf = Realloc(args->a_rawbuf,
|
||||||
args->a_rawsize <<= 1);
|
(unsigned)(args->a_rawsize <<= 1));
|
||||||
args->a_rawptr = args->a_rawbuf + index;
|
args->a_rawptr = args->a_rawbuf + index;
|
||||||
}
|
}
|
||||||
*args->a_rawptr++ = ch;
|
*args->a_rawptr++ = ch;
|
||||||
|
|
Loading…
Add table
Reference in a new issue