Next batch of warning hunt...

This commit is contained in:
Manoel Trapier
2013-03-19 17:37:24 +01:00
committed by Manoël Trapier
parent 1ed1edf94d
commit 25c717d9b3
38 changed files with 405 additions and 240 deletions

View File

@@ -35,6 +35,9 @@ _PROTOTYPE(void C_ms_stb_pnam, (char *, int, int, char *));
_PROTOTYPE(void C_ms_std, (char *, int, int));
_PROTOTYPE(int C_out, (struct e_instr *p));
_PROTOTYPE(void error, (char *, ...));
_PROTOTYPE(void fatal, (char *, ...));
#ifdef PEEPHOLE
#include "em_codeO.h"
#include "emO_code.h"

View File

@@ -28,11 +28,10 @@ static char rcsid[] = "$Id$";
char *filename; /* Name of input file */
int errors; /* Number of errors */
main(argc,argv)
char **argv;
int main(int argc, char *argv[])
{
struct e_instr buf;
register struct e_instr *p = &buf;
struct e_instr *p = &buf;
if (argc >= 2) {
filename = argv[1];
@@ -68,22 +67,34 @@ main(argc,argv)
}
/* VARARGS */
error(s,a1,a2,a3,a4)
char *s;
static int verror(char *s, va_list ap)
{
fprint(STDERR,
fprintf(stderr,
"%s, line %d: ",
filename ? filename : "standard input",
EM_lineno);
fprint(STDERR,s,a1,a2,a3,a4);
fprint(STDERR, "\n");
vfprintf(stderr, s, ap);
fprintf(stderr, "\n");
errors++;
return 0;
}
/* VARARGS */
fatal(s,a1,a2,a3,a4)
char *s;
int error(char *s, ...)
{
error(s,a1,a2,a3,a4);
exit(1);
va_list ap;
va_start(ap, s);
verror(s, ap);
va_end(ap);
return 0;
}
/*VARARGS1*/
int fatal(char *s, ...)
{
va_list ap;
va_start(ap, s);
verror(s, ap);
va_end(ap);
exit(1);
return 0;
}

View File

@@ -2,24 +2,19 @@
* (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
* See the copyright notice in the ACK home directory, in the file "Copyright".
*/
#ifndef NORCSID
static char rcsid1[] = "$Id$";
#endif
/* This is the main program for the stand-alone version of the
peephole optimizer.
*/
#include <stdarg.h>
#include "nopt.h"
char *filename; /* Name of input file */
int errors; /* Number of errors */
main(argc,argv)
char **argv;
int main(int argc, char *argv[])
{
static struct e_instr buff;
register p_instr p = &buff;
p_instr p = &buff;
if (argc >= 2) {
filename = argv[1];
@@ -93,22 +88,34 @@ main(argc,argv)
}
/*VARARGS1*/
error(s,a1,a2,a3,a4)
char *s;
static int verror(char *s, va_list ap)
{
fprintf(stderr,
"%s, line %d: ",
filename ? filename : "standard input",
EM_lineno);
fprintf(stderr,s,a1,a2,a3,a4);
vfprintf(stderr, s, ap);
fprintf(stderr, "\n");
errors++;
return 0;
}
int error(char *s, ...)
{
va_list ap;
va_start(ap, s);
verror(s, ap);
va_end(ap);
return 0;
}
/*VARARGS1*/
fatal(s,a1,a2,a3,a4)
char *s;
int fatal(char *s, ...)
{
error(s,a1,a2,a3,a4);
va_list ap;
va_start(ap, s);
verror(s, ap);
va_end(ap);
exit(1);
return 0;
}

View File

@@ -8,10 +8,7 @@
#include "flt_misc.h"
#include <em_arith.h>
void
flt_arith2flt(n, e, uns)
register arith n;
register flt_arith *e;
void flt_arith2flt(arith n, flt_arith *e, int uns)
{
/* Convert the arith "n" to a flt_arith "e".
*/