Resolve many build warnings

This patch fixes many warnings from the beginning of the build up to
and including the depend stage. Nearly all warnings should be gone
even with -Wall.
This commit is contained in:
Ulrich Wilkens
2014-09-23 23:16:35 +02:00
committed by Jon Trulson
parent 2bf29e5d63
commit 42e891d9e7
125 changed files with 1926 additions and 1440 deletions

View File

@@ -626,7 +626,7 @@ name
pcchain:pcchain {
*nextchain = (CHAIN *) m_malloc(sizeof(CHAIN), "chain") ;
(*nextchain)->next = NULL ;
if ((*nextchain)->elt = m_packedlook(m_entree, name))
if (((*nextchain)->elt = m_packedlook(m_entree, name)))
(*nextchain)->elt++ ;
else
m_err1("Undefined element: %s", name) ;
@@ -660,61 +660,61 @@ text
}
}
globdef:globdef {
fprintf(globdef, "%c", textchar) ;
fprintf(globdef, "%c", (char)textchar) ;
/* if (textchar == '\n') fprintf(globdef, "#line %d \"%s\"\n",
m_line, iffile) ; */
}
globdec:globdec {
fprintf(globdec, "%c", textchar) ;
fprintf(globdec, "%c", (char)textchar) ;
/* if (textchar == '\n') fprintf(globdec, "#line %d \"%s\"\n",
m_line, iffile) ; */
}
iniss:iniss,
inss:inss {
if (! stringstart) fprintf(string, ",\n") ;
fprintf(string, " %d", textchar) ;
fprintf(string, " %d", (int)textchar) ;
stringstart = FALSE ;
stringcnt++ ;
}
inies:inies,
ines:ines {
if (! stringstart) fprintf(string, ",\n") ;
fprintf(string, " %d", textchar) ;
fprintf(string, " %d", (int)textchar) ;
stringstart = FALSE ;
stringcnt++ ;
}
inisc:inisc,
insc:insc {
fprintf(sfile, "%c", textchar) ;
fprintf(sfile, "%c", (char)textchar) ;
/* if (textchar == '\n') fprintf(sfile, "#line %d \"%s\"\n",
m_line, iffile) ; */
}
iniec:iniec,
inec:inec {
fprintf(efile, "%c", textchar) ;
fprintf(efile, "%c", (char)textchar) ;
/* if (textchar == '\n') fprintf(efile, "#line %d \"%s\"\n",
m_line, iffile) ; */
}
initc:initc,
intc:intc {
fprintf(tfile, "%c", textchar) ;
fprintf(tfile, "%c", (char)textchar) ;
/* if (textchar == '\n') fprintf(tfile, "#line %d \"%s\"\n",
m_line, iffile) ; */
}
inipc:inipc,
inpc:inpc {
fprintf(pfile, "%c", textchar) ;
fprintf(pfile, "%c", (char)textchar) ;
/* if (textchar == '\n') fprintf(pfile, "#line %d \"%s\"\n",
m_line, iffile) ; */
}
inistc:inistc,
instc:instc {
fprintf(stfile, "%c", textchar) ;
fprintf(stfile, "%c", (char)textchar) ;
/* if (textchar == '\n') fprintf(stfile, "#line %d \"%s\"\n",
m_line, iffile) ; */
}
inentc:inentc {
fprintf(entfile, "%c", textchar) ;
fprintf(entfile, "%c", (char)textchar) ;
/* if (textchar == '\n') fprintf(entfile, "#line %d \"%s\"\n",
m_line, iffile) ; */
}

View File

@@ -49,13 +49,13 @@ This product and information is proprietary of Tandem Computers Incorporated.
#include "entity.h"
/* Main program */
void main(argc, argv)
int main(argc, argv)
int argc ;
char **argv ;
{
int m_token ;
if (argc > 2)
if (argc > 2) {
if (*argv[2] == '-') {
if (strchr(argv[2], 'a')) m_malftrace = TRUE ;
if (strchr(argv[2], 'A')) m_malftrace = TRUE ;
@@ -70,6 +70,7 @@ void main(argc, argv)
fprintf(stderr,
"****Starting with MARKUP 2.0, ELTDEF no longer writes a statistics file"
) ;
}
if (argc < 2) {
fprintf(stderr, "**** Specify interface file ****\n") ;
exit(TRUE) ;
@@ -84,7 +85,7 @@ void main(argc, argv)
if (scantrace)
printf(
"Main: m_prevcon=%d,m_token=%d,curcon=%d,textchar='%c'(%d), line=%d\n",
m_prevcon, m_token, curcon, textchar, textchar, m_line) ;
m_prevcon, m_token, curcon, (char)textchar, (int)textchar, m_line) ;
#include "case.c"
if (m_token == ENDFILE) break ;
if (! curcon) {
@@ -93,4 +94,5 @@ void main(argc, argv)
}
}
done() ;
return 0;
}

View File

@@ -106,7 +106,7 @@ void cvalue(M_NOPAR)
PARVAL *new;
new = (PARVAL *) m_malloc(sizeof(PARVAL), "parameter value");
if (pval = (PARVAL *) m_ntrtrie(name, &parval, (M_TRIE *) new))
if ((pval = (PARVAL *) m_ntrtrie(name, &parval, (M_TRIE *) new)))
m_free(new, "parameter value");
else {
new->line = 0;
@@ -467,7 +467,7 @@ for ( ; p ; p = p->next)
iffile);
fprintf(pvalh, "#define %s \"", mb_cname);
m_free(mb_cname,"multi-byte string");
if (q = ((PARVAL *) p->data)->value)
if ((q = ((PARVAL *) p->data)->value))
for ( ; *q ; q++)
{
char mbq[32]; /* larger than largest possible mbyte char */
@@ -498,7 +498,7 @@ for ( ; p ; p = p->next)
void skiptoend(M_NOPAR)
{
int i;
static errlev = 0;
static int errlev = 0;
CVARSTRUCT *cvarp, *dvarp;
for (cvarp = cvarlist ; cvarp ;) {
@@ -615,7 +615,7 @@ void startelement(M_NOPAR)
m_free(discard, "C variable");
}
cvarlist = NULL;
if (openelt = m_packedlook(m_entree, name)) {
if ((openelt = m_packedlook(m_entree, name))) {
if (processed[openelt - 1])
warning1("Warning: Element %s already processed", name);
processed[openelt - 1] = TRUE;
@@ -670,7 +670,7 @@ if (m_partype(cvarlist->param + m_element[openelt - 1].parptr, p))
{
M_WCHAR *w_buffer;
sprintf(buffer, "%d", pval->line);
snprintf(buffer, 5, "%d", pval->line);
w_buffer = MakeWideCharString(buffer);
m_err5("Can't #define %s to %s. %s #define'd to %s on line %s",
pval->cname,

View File

@@ -40,7 +40,7 @@ void addent(M_NOPAR)
M_ENTITY *new ;
new = (M_ENTITY *) m_malloc(sizeof(M_ENTITY), "entity") ;
if (entity = (M_ENTITY *) m_ntrtrie(name, m_enttrie, (M_TRIE *) new)) {
if ((entity = (M_ENTITY *) m_ntrtrie(name, m_enttrie, (M_TRIE *) new))) {
m_free(new, "entity") ;
if (! entity->wheredef) return ;
if (entity->wheredef == M_DBUILD) {

View File

@@ -226,7 +226,7 @@ LOGICAL litproc(
#endif
) ;
void main(
int main(
#if defined(M_PROTO)
int argc, char **argv
#endif

View File

@@ -53,7 +53,8 @@ M_WCHAR *p, wus;
int c, cttype;
LOGICAL cname;
mbtowc(&wus, "_", 1);
int ret = mbtowc(&wus, "_", 1);
(void) ret;
cname = (LOGICAL) (curcon == INPARAM || curcon == INVALUE);
*(p = name) = (M_WCHAR) first;
@@ -92,7 +93,8 @@ int n;
static char unexp[] = "c";
M_WCHAR wus;
mbtowc(&wus, "_", 1);
int ret = mbtowc(&wus, "_", 1);
(void) ret;
while (TRUE)
{