From 5ba9685e76ba9ea5bc05b8d7282fe441143b4242 Mon Sep 17 00:00:00 2001 From: ceriel Date: Tue, 2 Oct 1990 17:19:17 +0000 Subject: [PATCH] de-linted somewhat --- lang/cem/cpp.ansi/LLlex.c | 11 ++++++----- lang/cem/cpp.ansi/Makefile | 2 +- lang/cem/cpp.ansi/options.c | 5 +++-- lang/cem/cpp.ansi/preprocess.c | 8 ++++---- lang/cem/cpp.ansi/replace.c | 9 +++++---- 5 files changed, 19 insertions(+), 16 deletions(-) diff --git a/lang/cem/cpp.ansi/LLlex.c b/lang/cem/cpp.ansi/LLlex.c index 64108e1d7..26e039fbb 100644 --- a/lang/cem/cpp.ansi/LLlex.c +++ b/lang/cem/cpp.ansi/LLlex.c @@ -31,8 +31,9 @@ int AccFileSpecifier = 0; /* return filespecifier <...> */ int LexSave = 0; /* last character read by GetChar */ extern int InputLevel; /* # of current macro expansions */ -char *string_token(); -arith char_constant(); +extern char *string_token(); +extern char *strcpy(); +extern arith char_constant(); #define FLG_ESEEN 0x01 /* possibly 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 */ 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 */ fatal("non-ascii '\\%03o' read", ch & 0377); /* keep track of the place of the token in the file */ @@ -387,11 +388,11 @@ string_token(nm, stop_char) ch = quoted(GetChar()); str[pos++] = ch; if (pos == str_size) - str = Realloc(str, str_size <<= 1); + str = Realloc(str, (unsigned)(str_size <<= 1)); ch = GetChar(); } str[pos++] = '\0'; /* for filenames etc. */ - str = Realloc(str, pos); + str = Realloc(str, (unsigned)pos); return str; } diff --git a/lang/cem/cpp.ansi/Makefile b/lang/cem/cpp.ansi/Makefile index 3c16e0f26..0a6481b37 100644 --- a/lang/cem/cpp.ansi/Makefile +++ b/lang/cem/cpp.ansi/Makefile @@ -34,7 +34,7 @@ GENOPTIONS = # Special #defines during compilation 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 LSRC = tokenfile.g expression.g diff --git a/lang/cem/cpp.ansi/options.c b/lang/cem/cpp.ansi/options.c index 729edaad1..b643c2d3c 100644 --- a/lang/cem/cpp.ansi/options.c +++ b/lang/cem/cpp.ansi/options.c @@ -80,7 +80,7 @@ do_option(text) error("malformed option -D%s", text); break; } - macro_def(str2idf(name, 0), mactext, -1, maclen, NOFLAG); + macro_def(str2idf(name, 0), mactext, -1, (int)maclen, NOFLAG); break; } case 'I' : /* -Ipath : insert "path" into include list */ @@ -90,7 +90,8 @@ do_option(text) if (++inc_total > inc_max) { 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++) { diff --git a/lang/cem/cpp.ansi/preprocess.c b/lang/cem/cpp.ansi/preprocess.c index c867d458f..98796a339 100644 --- a/lang/cem/cpp.ansi/preprocess.c +++ b/lang/cem/cpp.ansi/preprocess.c @@ -53,7 +53,7 @@ do_pragma() *c_ptr = '\0'; while(c != '\n') { 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++ = c; @@ -63,8 +63,8 @@ do_pragma() if (!pragma_nr) { pragma_tab = (struct prag_info *)Malloc(sizeof(struct prag_info)); } else { - pragma_tab = (struct prag_info *)Realloc(pragma_tab - , sizeof(struct prag_info) * (pragma_nr+1)); + pragma_tab = (struct prag_info *)Realloc((char *)pragma_tab + , (unsigned)(sizeof(struct prag_info) * (pragma_nr+1))); } pragma_tab[pragma_nr].pr_linnr = LineNumber; pragma_tab[pragma_nr].pr_fil = FileName; @@ -143,7 +143,7 @@ preprocess(fn) free(pragma_tab[i].pr_text); i++; } - free(pragma_tab); + free((char *) pragma_tab); pragma_tab = (struct prag_info *)0; pragma_nr = 0; LineNumber = LiNo; diff --git a/lang/cem/cpp.ansi/replace.c b/lang/cem/cpp.ansi/replace.c index c899a8b89..eacbe7295 100644 --- a/lang/cem/cpp.ansi/replace.c +++ b/lang/cem/cpp.ansi/replace.c @@ -22,6 +22,8 @@ #include "replace.h" extern char *GetIdentifier(); +extern char *strcpy(); +extern char *strcat(); extern int InputLevel; struct repl *ReplaceList; /* list of currently active macros */ @@ -254,7 +256,6 @@ struct repl *repl; { register struct repl *nrepl = ReplaceList; register struct args *ap = nrepl->r_args; - struct args *args = repl->r_args; register char *p; /* stash identifier name */ @@ -731,7 +732,7 @@ add2repl(repl, ch) assert(index < 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++ = ch; @@ -756,7 +757,7 @@ stash(repl, ch, stashraw) assert(index < args->a_expsize); if (index + 1 >= args->a_expsize) { 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++ = ch; @@ -767,7 +768,7 @@ stash(repl, ch, stashraw) assert(index < args->a_rawsize); if (index + 1 >= args->a_rawsize) { 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++ = ch; -- 2.34.1