[project @ 2004-06-04 06:51:01 by panne]
authorpanne <unknown>
Fri, 4 Jun 2004 06:51:01 +0000 (06:51 +0000)
committerpanne <unknown>
Fri, 4 Jun 2004 06:51:01 +0000 (06:51 +0000)
ANSIfication (from Ralf Wildenhues)

ghc/utils/hp2ps/AreaBelow.c
ghc/utils/hp2ps/Curves.c
ghc/utils/hp2ps/Deviation.c
ghc/utils/hp2ps/Error.c
ghc/utils/hp2ps/Error.h
ghc/utils/hp2ps/Scale.c
ghc/utils/hp2ps/TopTwenty.c
ghc/utils/hp2ps/TraceElement.c
ghc/utils/hp2ps/Utilities.c
ghc/utils/hp2ps/Utilities.h

index 7413807..3bb98d9 100644 (file)
@@ -1,4 +1,5 @@
 #include <stdio.h>
+#include <stdlib.h>
 #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. 
index c4f173e..72c8eb2 100644 (file)
@@ -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()
index 49e8d21..81a16df 100644 (file)
@@ -1,4 +1,5 @@
 #include <stdio.h>
+#include <stdlib.h>
 #include <string.h>
 #include <math.h>
 #include "Main.h"
@@ -7,8 +8,6 @@
 #include "HpFile.h"
 #include "Utilities.h"
 
-extern void free();
-
 /* own stuff */
 #include "Deviation.h"
 
index 7844204..7c67646 100644 (file)
@@ -1,40 +1,44 @@
+#include <stdarg.h>
 #include <stdio.h>
+#include <stdlib.h>
 #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);
index 0febc84..c1cdede 100644 (file)
@@ -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 */
index 576e173..2b557d7 100644 (file)
@@ -1,4 +1,5 @@
 #include <stdio.h>
+#include <stdlib.h>
 #include "Main.h"
 #include "Defines.h"
 #include "Dimensions.h"
@@ -16,8 +17,6 @@
  *     fit on the page.
  */
 
-extern void free();
-
 floatish
 MaxCombinedHeight()
 {
index 9060aaf..10de7bb 100644 (file)
@@ -1,4 +1,5 @@
 #include <stdio.h>
+#include <stdlib.h>
 #include "Main.h"
 #include "Defines.h"
 #include "Error.h"
@@ -17,8 +18,6 @@
  *     band which appears as band 20.
  */
 
-extern void free();
-
 void
 TopTwenty()
 {
index 984faf5..787ff7b 100644 (file)
@@ -1,4 +1,5 @@
 #include <stdio.h>
+#include <stdlib.h>
 #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()
index aba1caf..4589327 100644 (file)
@@ -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();
index bffc87d..10776d9 100644 (file)
@@ -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 */