From f492e365e1ab9ac9dd46a94a3b6677cc06e7a359 Mon Sep 17 00:00:00 2001 From: panne Date: Fri, 4 Jun 2004 06:51:01 +0000 Subject: [PATCH] [project @ 2004-06-04 06:51:01 by panne] ANSIfication (from Ralf Wildenhues) --- ghc/utils/hp2ps/AreaBelow.c | 3 +-- ghc/utils/hp2ps/Curves.c | 3 ++- ghc/utils/hp2ps/Deviation.c | 3 +-- ghc/utils/hp2ps/Error.c | 24 ++++++++++++++---------- ghc/utils/hp2ps/Error.h | 6 +++--- ghc/utils/hp2ps/Scale.c | 3 +-- ghc/utils/hp2ps/TopTwenty.c | 3 +-- ghc/utils/hp2ps/TraceElement.c | 3 +-- ghc/utils/hp2ps/Utilities.c | 4 ++-- ghc/utils/hp2ps/Utilities.h | 4 ++-- 10 files changed, 28 insertions(+), 28 deletions(-) diff --git a/ghc/utils/hp2ps/AreaBelow.c b/ghc/utils/hp2ps/AreaBelow.c index 7413807..3bb98d9 100644 --- a/ghc/utils/hp2ps/AreaBelow.c +++ b/ghc/utils/hp2ps/AreaBelow.c @@ -1,4 +1,5 @@ #include +#include #include "Main.h" #include "Defines.h" #include "Error.h" @@ -8,8 +9,6 @@ /* own stuff */ #include "AreaBelow.h" -extern void free(); - /* * Return the area enclosed by all of the curves. The algorithm * used is the same as the trapizoidal rule for integration. diff --git a/ghc/utils/hp2ps/Curves.c b/ghc/utils/hp2ps/Curves.c index c4f173e..72c8eb2 100644 --- a/ghc/utils/hp2ps/Curves.c +++ b/ghc/utils/hp2ps/Curves.c @@ -16,7 +16,8 @@ static floatish *y; static floatish *py; /* previous y values */ static void Curve PROTO((struct entry *)); /* forward */ -static void ShadeCurve(); /* forward */ +static void ShadeCurve + PROTO((floatish *x, floatish *y, floatish *py, floatish shade)); void Curves() diff --git a/ghc/utils/hp2ps/Deviation.c b/ghc/utils/hp2ps/Deviation.c index 49e8d21..81a16df 100644 --- a/ghc/utils/hp2ps/Deviation.c +++ b/ghc/utils/hp2ps/Deviation.c @@ -1,4 +1,5 @@ #include +#include #include #include #include "Main.h" @@ -7,8 +8,6 @@ #include "HpFile.h" #include "Utilities.h" -extern void free(); - /* own stuff */ #include "Deviation.h" diff --git a/ghc/utils/hp2ps/Error.c b/ghc/utils/hp2ps/Error.c index 7844204..7c67646 100644 --- a/ghc/utils/hp2ps/Error.c +++ b/ghc/utils/hp2ps/Error.c @@ -1,40 +1,44 @@ +#include #include +#include #include "Main.h" #include "Defines.h" /* own stuff */ #include "Error.h" -void exit PROTO((int)); - /*VARARGS0*/ void -Error(a1,a2,a3,a4) - char* a1; char* a2; char* a3; char* a4; +Error(const char *fmt, ...) { + va_list ap; fflush(stdout); fprintf(stderr, "%s: ", programname); - fprintf(stderr, a1, a2, a3, a4); + va_start(ap, fmt); + vfprintf(stderr, fmt, ap); + va_end(ap); fprintf(stderr, "\n"); exit(1); } /*VARARGS0*/ void -Disaster(a1,a2,a3,a4) - char* a1; char* a2; char* a3; char* a4; +Disaster(const char *fmt, ...) { + va_list ap; fflush(stdout); fprintf(stderr, "%s: ", programname); - fprintf(stderr, " Disaster! ("); - fprintf(stderr, a1, a2, a3, a4); + fprintf(stderr, " Disaster! ("); + va_start(ap, fmt); + vfprintf(stderr, fmt, ap); + va_end(ap); fprintf(stderr, ")\n"); exit(1); } void Usage(str) - char *str; + const char *str; { if (str) printf("error: %s\n", str); printf("usage: %s -b -d -ef -g -i -p -mn -p -s -tf -y [file[.hp]]\n", programname); diff --git a/ghc/utils/hp2ps/Error.h b/ghc/utils/hp2ps/Error.h index 0febc84..c1cdede 100644 --- a/ghc/utils/hp2ps/Error.h +++ b/ghc/utils/hp2ps/Error.h @@ -1,8 +1,8 @@ #ifndef ERROR_H #define ERROR_H -extern void Error (); /*PROTO((char *, ...)); */ -extern void Disaster (); /* PROTO((char *, ...)); */ -extern void Usage (); /* PROTO((char *)); */ +extern void Error PROTO((const char *, ...)); +extern void Disaster PROTO((const char *, ...)); +extern void Usage PROTO((const char *)); #endif /* ERROR_H */ diff --git a/ghc/utils/hp2ps/Scale.c b/ghc/utils/hp2ps/Scale.c index 576e173..2b557d7 100644 --- a/ghc/utils/hp2ps/Scale.c +++ b/ghc/utils/hp2ps/Scale.c @@ -1,4 +1,5 @@ #include +#include #include "Main.h" #include "Defines.h" #include "Dimensions.h" @@ -16,8 +17,6 @@ * fit on the page. */ -extern void free(); - floatish MaxCombinedHeight() { diff --git a/ghc/utils/hp2ps/TopTwenty.c b/ghc/utils/hp2ps/TopTwenty.c index 9060aaf..10de7bb 100644 --- a/ghc/utils/hp2ps/TopTwenty.c +++ b/ghc/utils/hp2ps/TopTwenty.c @@ -1,4 +1,5 @@ #include +#include #include "Main.h" #include "Defines.h" #include "Error.h" @@ -17,8 +18,6 @@ * band which appears as band 20. */ -extern void free(); - void TopTwenty() { diff --git a/ghc/utils/hp2ps/TraceElement.c b/ghc/utils/hp2ps/TraceElement.c index 984faf5..787ff7b 100644 --- a/ghc/utils/hp2ps/TraceElement.c +++ b/ghc/utils/hp2ps/TraceElement.c @@ -1,4 +1,5 @@ #include +#include #include "Main.h" #include "Defines.h" #include "HpFile.h" @@ -16,8 +17,6 @@ * elements'' and they are thrown away. */ -extern void free(); - extern floatish thresholdpercent; void TraceElement() diff --git a/ghc/utils/hp2ps/Utilities.c b/ghc/utils/hp2ps/Utilities.c index aba1caf..4589327 100644 --- a/ghc/utils/hp2ps/Utilities.c +++ b/ghc/utils/hp2ps/Utilities.c @@ -79,7 +79,7 @@ CommaPrint(fp,n) void * xmalloc(n) - int n; + size_t n; { void *r; @@ -94,7 +94,7 @@ xmalloc(n) void * xrealloc(p, n) void *p; - int n; + size_t n; { void *r; extern void *realloc(); diff --git a/ghc/utils/hp2ps/Utilities.h b/ghc/utils/hp2ps/Utilities.h index bffc87d..10776d9 100644 --- a/ghc/utils/hp2ps/Utilities.h +++ b/ghc/utils/hp2ps/Utilities.h @@ -7,7 +7,7 @@ FILE* OpenFile PROTO((char *, char *)); void CommaPrint PROTO((FILE *, intish)); char *copystring PROTO((char *)); char *copystring2 PROTO((char *, char *)); -void *xmalloc PROTO((int)); -void *xrealloc PROTO((void *, int)); +void *xmalloc PROTO((size_t)); +void *xrealloc PROTO((void *, size_t)); #endif /* UTILITIES_H */ -- 1.7.10.4