Index: /trunk/Jgraph/draw.c
===================================================================
--- /trunk/Jgraph/draw.c	(revision 419)
+++ /trunk/Jgraph/draw.c	(revision 420)
@@ -22,7 +22,7 @@
       error_header();
       fprintf(stderr, 
-              "Value of %f is at negative infinity with logrhythmic %c axis\n", 
+              "Value of %f is at negative infinity with logarithmic %c axis\n", 
               val, (axis->is_x) ? 'x' : 'y'); 
-       exit(1);
+      exit(1);
     }
     return (log(val) / axis->logfactor - axis->logmin) * axis->factor;
@@ -51,6 +51,12 @@
 #define MAXIMUM(a,b) ((a > b) ? a : b)
 
-draw_axis(a, other)
-Axis a, other;
+void draw_label(Label l)
+{
+  if (l->label == CNULL) return;
+  comment(l->label);
+  print_label(l);
+}
+
+void draw_axis(Axis a, Axis other)
 {
   char orientation;
@@ -117,14 +123,5 @@
 
 
-draw_label(l)
-Label l;
-{
-  if (l->label == CNULL) return;
-  comment(l->label);
-  print_label(l);
-}
-
-set_clip(g)
-Graph g;
+void set_clip(Graph g)
 {
   comment("Setting Clip");
@@ -136,6 +133,7 @@
 }
 
-draw_curves(g)
-Graph g;
+void draw_curve(Curve c, Graph g);
+
+void draw_curves(Graph g)
 {
   Curve c;
@@ -151,7 +149,8 @@
 }
 
-draw_curve(c, g)
-Curve c;
-Graph g;
+void draw_mark(float x, float y, Curve c, Graph g);
+void draw_arrow(float x1, float y1, float x2, float y2, Curve c);
+
+void draw_curve(Curve c, Graph g)
 {
   Point p, px, py;
@@ -270,8 +269,5 @@
 }
 
-draw_mark(x, y, c, g)
-float x, y;
-Curve c;
-Graph g;
+void draw_mark(float x, float y, Curve c, Graph g)
 {
   Point p;
@@ -317,5 +313,5 @@
               }
               for (i = 0; i < 4; i++) {
-                if (fscanf(f, "%d", &(bb[i])) == NULL) {
+                if (fscanf(f, "%d", &(bb[i])) == 0) {
                   fprintf(stderr, "Error: Eps file '%s': eof in %s\n",
                           c->eps, "bounding box");
@@ -502,7 +498,5 @@
 }
 
-draw_arrow(x1, y1, x2, y2, c)
-float x1, y1, x2, y2;
-Curve c;
+void draw_arrow(float x1, float y1, float x2, float y2, Curve c)
 {
   float dx, dy;
@@ -542,6 +536,5 @@
 }
 
-draw_legend(g)
-Graph g;
+void draw_legend(Graph g)
 {
   Curve c;
@@ -606,6 +599,5 @@
 }
 
-draw_strings(g)
-Graph g;
+void draw_strings(Graph g)
 {
   String s;
@@ -616,6 +608,5 @@
 }
 
-draw_graph(g)
-Graph g;
+void draw_graph(Graph g)
 {
   comment("Drawing New Graph");
@@ -637,8 +628,8 @@
 }
 
-draw_graphs(gs, pp, landscape)
-Graphs gs;
-int pp;
-int landscape;
+void draw_header(Graphs gs, int pp, int landscape);
+void draw_footer(Graphs gs, int pp);
+
+void draw_graphs(Graphs gs, int pp, int landscape)
 {
   Graphs gs_p;
@@ -661,8 +652,5 @@
 }
 
-draw_header(gs, pp, landscape)
-Graphs gs;
-int pp;
-int landscape;
+void draw_header(Graphs gs, int pp, int landscape)
 {
   FILE *f;
@@ -774,5 +762,5 @@
     }
   } else if (landscape) {
-    printf("%f 0 translate\n", -gs->bb[2] - gs->bb[0]);
+    printf("%d 0 translate\n", -gs->bb[2] - gs->bb[0]);
   }
   printf("1 setlinecap 1 setlinejoin\n");
@@ -835,7 +823,5 @@
 }
 
-draw_footer(gs, pp)
-Graphs gs;
-int pp;
+void draw_footer(Graphs gs, int pp)
 {
   FILE *f;
Index: /trunk/Jgraph/edit.c
===================================================================
--- /trunk/Jgraph/edit.c	(revision 419)
+++ /trunk/Jgraph/edit.c	(revision 420)
@@ -8,4 +8,5 @@
 
 #include <stdio.h>
+#include <string.h>
 
 #include "jgraph.h"
@@ -14,6 +15,5 @@
 #define MIN(a,b) ((a < b) ? a : b)
 
-edit_label(l)
-Label l;
+void edit_label(Label l)
 {
   char *txt, inp_str[80];
@@ -73,6 +73,5 @@
 }
 
-copy_curve(c1, c2) /* Copies curve c2 to c1 */
-Curve c1, c2;
+void copy_curve(Curve c1, Curve c2) /* Copies curve c2 to c1 */
 {
   Flist f, newf;
@@ -139,6 +138,5 @@
 }
 
-copy_label(l1, l2) /* Copies label l2 to l1 */
-Label l1, l2;
+void copy_label(Label l1, Label l2) /* Copies label l2 to l1 */
 {
   l1->label = l2->label;
@@ -157,6 +155,5 @@
 }
 
-copy_axis(a1, a2) /* Copies axis a2 to a1 */
-Axis a1, a2;
+void copy_axis(Axis a1, Axis a2) /* Copies axis a2 to a1 */
 {
   copy_label(a1->label, a2->label);
@@ -202,8 +199,5 @@
 }
 
-Curve do_copy_curve(g, gs, all_gs)
-Graph g;
-Graphs gs;
-Graphs all_gs;
+Curve do_copy_curve(Graph g, Graphs gs, Graphs all_gs)
 {
   Curve lastc, newc;
@@ -255,8 +249,5 @@
 }
 
-Label do_copy_string(g, gs, all_gs)
-Graph g;
-Graphs gs;
-Graphs all_gs;
+Label do_copy_string(Graph g, Graphs gs, Graphs all_gs)
 {
   String lastl, newl;
@@ -308,8 +299,5 @@
 }
 
-Graph last_graph(g, gs, all_gs)
-Graph g;
-Graphs gs;
-Graphs all_gs;
+Graph last_graph(Graph g, Graphs gs, Graphs all_gs)
 {
   Graph lastg;
@@ -330,6 +318,5 @@
 }
 
-copy_legend(l1, l2)
-Legend l1, l2;
+void copy_legend(Legend l1, Legend l2)
 {
   l1->linelength = l2->linelength;
@@ -340,7 +327,5 @@
 }
 
-inherit_axes(g, lastg)
-Graph g;
-Graph lastg;
+void inherit_axes(Graph g, Graph lastg)
 {
   char *s;
@@ -357,7 +342,5 @@
 }
 
-getpattern(inp_str, key, p, a)
-char *inp_str, *key, *p;
-float *a;
+void getpattern(char *inp_str, char *key, char *p, float *a)
 {
   int i;
@@ -386,7 +369,5 @@
 }
 
-edit_curve(c, g)
-Curve c;
-Graph g;
+void edit_curve(Curve c, Graph g)
 {
   char inp_str[256], *txt;
@@ -681,6 +662,5 @@
 }
 
-edit_hash_label(a)
-Axis a;
+void edit_hash_label(Axis a)
 {
   float at, f;
@@ -732,6 +712,5 @@
 }
 
-edit_axis(a)
-Axis a;
+void edit_axis(Axis a)
 {
   char inp_str[256];
@@ -908,6 +887,5 @@
 }
 
-edit_legend(l)
-Legend l;
+void edit_legend(Legend l)
 {
   char inp_str[256];
@@ -975,8 +953,5 @@
 }
 
-edit_graph(g, gs, all_gs)
-Graph g;
-Graphs gs;
-Graphs all_gs;
+void edit_graph(Graph g, Graphs gs, Graphs all_gs)
 {
   char inp_str[80];
@@ -1050,6 +1025,5 @@
 }
 
-edit_graphs(gs)
-Graphs gs;
+void edit_graphs(Graphs gs)
 {
   Graphs the_g;
Index: /trunk/Jgraph/jgraph.c
===================================================================
--- /trunk/Jgraph/jgraph.c	(revision 419)
+++ /trunk/Jgraph/jgraph.c	(revision 420)
@@ -7,4 +7,5 @@
 
 #include <stdio.h>
+#include <string.h>
 
 #ifdef VMS 
@@ -297,6 +298,5 @@
 }
 
-new_graphs(gs)
-Graphs gs;
+void new_graphs(Graphs gs)
 {
   Graphs newg;
@@ -316,7 +316,5 @@
 }
 
-main(argc, argv)
-int argc;
-char **argv;
+int main(int argc, char **argv)
 {
   Graphs gs;
Index: /trunk/Jgraph/jgraph.h
===================================================================
--- /trunk/Jgraph/jgraph.h	(revision 419)
+++ /trunk/Jgraph/jgraph.h	(revision 420)
@@ -241,2 +241,55 @@
 extern char PTYPES[];
 extern int NPATTERNS;
+
+void new_graphs(Graphs gs);
+
+/* Stuff defined in printline.c */
+
+void print_label(Label l);
+void set_comment(int c);
+void comment(char *s);
+void gsave(void);
+void grestore(void);
+void setlinewidth(float size);
+void setlinestyle(char style, Flist glist);
+void print_ebar(float x1, float y1, float x2, float ms, char orientation);
+void start_line(float x1, float y1, Curve c);
+void bezier_control(float x1, float y1);
+void bezier_end(float x1, float y1);
+void end_line(void);
+void setfill(float x, float y, char t, float f[], char p, float a);
+void cont_line(float x1, float y1);
+void setgray(char t, float f[]);
+void printline(float x1, float y1, float x2, float y2, char orientation);
+void start_poly(float x1, float y1);
+void cont_poly(float x1, float y1);
+void end_poly(float x, float y, char ftype, float fill[],
+	      char pattern, float parg);
+void printellipse(float x, float y, float radius1, float radius2,
+		  char ftype, float fill[], char pattern, float parg);
+void setfont(char *f, float s);
+
+/* Stuff defined in edit.c */
+
+void copy_label(Label l1, Label l2);
+void edit_graphs(Graphs gs);
+
+/* Stuff defined in token.c */
+
+void set_input_file(char *s);
+int getint(int *i);
+int getstring(char *s);
+int getfloat(float *f);
+void rejecttoken(void);
+
+/* Stuff defined in process.c */
+
+void process_graphs(Graphs gs);
+
+/* Stuff defined in show.c */
+
+void show_graphs(Graphs gs);
+
+/* Stuff defined in draw.c */
+
+void draw_graphs(Graphs gs, int pp, int landscape);
Index: /trunk/Jgraph/list.c
===================================================================
--- /trunk/Jgraph/list.c	(revision 419)
+++ /trunk/Jgraph/list.c	(revision 420)
@@ -7,4 +7,5 @@
 
 #include <stdio.h>    /* Basic includes and definitions */
+#include <stdlib.h>
 #include "list.h"
 
@@ -33,23 +34,20 @@
 } *Int_list;
 
-insert(item, list)	/* Inserts to the end of a list */
-List item;
-List list;
+void insert(void *item, void *list)	/* Inserts to the end of a list */
 {
   List last_node;
 
-  last_node = list->blink;
+  last_node = ((List)list)->blink;
 
-  list->blink = item;
+  ((List)list)->blink = item;
   last_node->flink = item;
-  item->blink = last_node;
-  item->flink = list;
+  ((List)item)->blink = last_node;
+  ((List)item)->flink = list;
 }
 
-delete_item(item)		/* Deletes an arbitrary iterm */
-List item;
+void delete_item(void *item)		/* Deletes an arbitrary iterm */
 {
-  item->flink->blink = item->blink;
-  item->blink->flink = item->flink;
+  ((List)item)->flink->blink = ((List)item)->blink;
+  ((List)item)->blink->flink = ((List)item)->flink;
 }
 
@@ -68,6 +66,5 @@
 }
   
-List get_node(list)   /* Allocates a node to be inserted into the list */
-List list;
+List get_node(void *list)   /* Allocates a node to be inserted into the list */
 {
   Int_list l;
@@ -84,12 +81,10 @@
 }
 
-free_node(node, list)    /* Deallocates a node from the list */
-List node;
-List list;
+void free_node(void *node, void *list)    /* Deallocates a node from the list */
 {
   Int_list l;
   
   l = (Int_list) list;
-  node->flink = l->free_list;
+  ((List)node)->flink = l->free_list;
   l->free_list = node;
 }
Index: /trunk/Jgraph/list.h
===================================================================
--- /trunk/Jgraph/list.h	(revision 419)
+++ /trunk/Jgraph/list.h	(revision 420)
@@ -24,10 +24,11 @@
 #define prev(n) (n->blink)
 
-/* These are the routines for manipluating lists */
+/* These are the routines for manipulating lists */
 
-/* void insert(node list);     Inserts a node to the end of a list */
-/* void delete_item(node);     Deletes an arbitrary node */
-/* List make_list(node_size);  Creates a new list */
-/* List get_node(list);        Allocates a node to be inserted into the list */
-/* void free_node(node, list); Deallocates a node from the list */
+void insert(void *, void *);/* Inserts a node to the end of a list */
+void delete_item(void *);   /* Deletes an arbitrary node */
+List make_list(int size);   /* Creates a new list */
+List get_node(void *);      /* Allocates a node to be inserted into the list */
+void free_node(void *, void *); /* Deallocates a node from the list */
 
+void error_header();
Index: /trunk/Jgraph/makefile
===================================================================
--- /trunk/Jgraph/makefile	(revision 419)
+++ /trunk/Jgraph/makefile	(revision 420)
@@ -7,5 +7,5 @@
 # jgraph.1 to be the directory containing the example jgraphs.
 
-CC = cc
+CC = gcc -DLCC -Wall
 
 OBJS = draw.o \
@@ -94,3 +94,3 @@
 token.o: token.c list.h
 clean: 
-	rm -f *.o a.out *.jps jgraph
+	rm -f *.o a.out *.jps *.eps jgraph sin
Index: /trunk/Jgraph/printline.c
===================================================================
--- /trunk/Jgraph/printline.c	(revision 419)
+++ /trunk/Jgraph/printline.c	(revision 420)
@@ -9,4 +9,5 @@
 #include <stdio.h>
 #include <assert.h> //by pzn@debian.org
+#include <string.h>
 
 #define LINEWIDTHFACTOR 0.700
@@ -25,5 +26,5 @@
 static int Jgraph_comment;
 
-gsave()
+void gsave(void)
 {
   if (Jgraph_gsave_level == -100) {
@@ -35,5 +36,5 @@
 }
 
-grestore()
+void grestore(void)
 {
   Fontlist l;
@@ -50,7 +51,5 @@
 }
 
-setfont(f, s)
-char *f;
-float s;
+void setfont(char *f, float s)
 {
   Fontlist l;
@@ -77,8 +76,5 @@
 }
   
-setfill( x, y, t, f, p, a)
-char t, p ;
-float x, y;
-float f[], a ;
+void setfill(float x, float y, char t, float f[], char p, float a)
 {
 /*   fprintf(stderr, "Hello?  %c %f %c %f\n", t, f[0], p, a); */
@@ -102,7 +98,5 @@
 }
 
-setgray( t, f)
-char t ;
-float f[] ;
+void setgray(char t, float f[])
 {
     if ( t == 'g' )  {
@@ -113,7 +107,5 @@
 }
 
-printline(x1, y1,x2, y2, orientation)
-float x1, y1, x2, y2;
-char orientation;
+void printline(float x1, float y1, float x2, float y2, char orientation)
 {
   if (orientation == 'x') 
@@ -124,7 +116,5 @@
 } 
 
-print_ebar(x1, y1, x2, ms, orientation)
-float x1, y1, x2, ms;
-char orientation;
+void print_ebar(float x1, float y1, float x2, float ms, char orientation)
 {
   printline(x1, y1, x2, y1, orientation);
@@ -132,7 +122,5 @@
 }
 
-start_line(x1, y1, c)
-float x1, y1;
-Curve c;
+void start_line(float x1, float y1, Curve c)
 {
   setlinewidth(c->linethick);
@@ -141,11 +129,10 @@
 }
 
-cont_line(x1, y1)
-float x1, y1;
+void cont_line(float x1, float y1)
 {
   printf("  %f %f lineto\n", x1, y1);
 }
 
-end_line()
+void end_line(void)
 {
   printf("stroke\n");
@@ -156,12 +143,10 @@
 }
 
-bezier_control(x1, y1)
-float x1, y1;
+void bezier_control(float x1, float y1)
 {
   printf("  %f %f ", x1, y1);
 }
 
-bezier_end(x1, y1)
-float x1, y1;
+void bezier_end(float x1, float y1)
 {
   printf("  %f %f curveto\n", x1, y1);
@@ -169,20 +154,16 @@
 
 
-start_poly(x1, y1)
-float x1, y1;
+void start_poly(float x1, float y1)
 {
   printf(" newpath %f %f moveto", x1, y1);
 }
 
-cont_poly(x1, y1)
-float x1, y1;
+void cont_poly(float x1, float y1)
 {
   printf("  %f %f lineto\n", x1, y1);
 }
 
-end_poly(x, y, ftype, fill, pattern, parg)
-float x, y;
-char  ftype, pattern ;
-float fill[], parg;
+void end_poly(float x, float y, char ftype, float fill[],
+	      char pattern, float parg)
 {
   printf("closepath ");
@@ -194,7 +175,6 @@
 /* Ellipse at 0, 0 -- assumes that you've already translated to x, y */
 
-printellipse(x, y, radius1, radius2, ftype, fill, pattern, parg)
-char ftype, pattern;
-float x, y, radius1, radius2, fill[], parg;
+void printellipse(float x, float y, float radius1, float radius2,
+		  char ftype, float fill[], char pattern, float parg)
 {
   printf("newpath %f %f JDE\n", radius1, radius2);
@@ -204,19 +184,15 @@
 }
 
-set_comment(c)
-int c;
+void set_comment(int c)
 {
   Jgraph_comment = c;
 }
 
-comment(s)
-char *s;
+void comment(char *s)
 {
   if (Jgraph_comment) printf("%% %s\n", s);
 }
 
-printline_c(x1, y1, x2, y2, g)
-float x1, y1, x2, y2;
-Graph g;
+void printline_c(float x1, float y1, float x2, float y2, Graph g)
 {
   printline(ctop(x1, g->x_axis), ctop(y1, g->y_axis),
@@ -224,11 +200,10 @@
 }
 
-print_label(l)
-Label l;
+void print_label(Label l)
 {
   int f, i, nlines;
   float fnl;
   char *s;
-  unsigned char *s_7bit; // added by pzn@debian.org
+  char *s_7bit; // added by pzn@debian.org
 
   if (l->label == CNULL) return;
@@ -317,13 +292,10 @@
 }
 
-setlinewidth(size)
-float size;
+void setlinewidth(float size)
 {
   printf("%f setlinewidth ", size * LINEWIDTHFACTOR);
 }
 
-setlinestyle(style, glist)
-char style;
-Flist glist;
+void setlinestyle(char style, Flist glist)
 {
   Flist fl;
Index: /trunk/Jgraph/prio_list.c
===================================================================
--- /trunk/Jgraph/prio_list.c	(revision 419)
+++ /trunk/Jgraph/prio_list.c	(revision 420)
@@ -10,15 +10,4 @@
 #include <stdio.h>
 
-typedef int Boolean;
-
-/* A prioirity list is any list with the first three fields being flink, 
- * blink and prio.  Use the routines of list.c to do everything except
- * insertion */
- 
-typedef struct prio_list {
-  struct prio_list *flink;
-  struct prio_list *blink;
-  int prio;
-} *Prio_list;
 
 /* Prio_insert inserts nodes into their proper places in priority lists.  It first 
@@ -26,10 +15,7 @@
  * Thus, it is worst case linear, but for most cases constant time (right). */
 
-prio_insert(node, list, desc)
-Prio_list node;
-Prio_list list;
-Boolean desc;
+void prio_insert(void *n, void *l, Boolean desc)
 {
-  Prio_list p;
+  Prio_list p, node = (Prio_list)n, list = (Prio_list)l;
 
   /* Check nil and head of list */
Index: /trunk/Jgraph/prio_list.h
===================================================================
--- /trunk/Jgraph/prio_list.h	(revision 419)
+++ /trunk/Jgraph/prio_list.h	(revision 420)
@@ -6,23 +6,26 @@
  */
 
-/* Priority lists are just like normal lists of list.h and list.c, except
- * that their third field is a (int) prioriy.  The routines of list.c should all
- * be used except for insert, because it will always put an item at the 
- * end of a list.  Instead, use prio_insert, which will put the item
- * into its proper place in the list.  The last argument of prio_insert should
- * be TRUE if the list is to be kept in descending order; it should be FALSE
- * for ascending order.
+/* Priority lists are just like normal lists of list.h and list.c,
+ * except that their third field is a (int) priority.  The routines of
+ * list.c should all be used except for insert, because it will always
+ * put an item at the end of a list.  Instead, use prio_insert, which
+ * will put the item into its proper place in the list.  The last
+ * argument of prio_insert should be TRUE if the list is to be kept in
+ * descending order; it should be FALSE for ascending order.
+ */
 
- * Priority list should be:
-
-struct prio_list {
+/* A priority list is any list with the first three fields being flink, 
+ * blink and prio.  Use the routines of list.c to do everything except
+ * insertion */
+ 
+typedef struct prio_list {
   struct prio_list *flink;
   struct prio_list *blink;
   int prio;
-  ...
-  }
+  /* ... */
+} *Prio_list;
 
-*/
+typedef int Boolean;
 
-/* void prio_insert(node, list, descending); */
+void prio_insert(void *node, void *list, Boolean descending);
 
Index: /trunk/Jgraph/process.c
===================================================================
--- /trunk/Jgraph/process.c	(revision 419)
+++ /trunk/Jgraph/process.c	(revision 420)
@@ -8,4 +8,5 @@
 #include <stdio.h>
 #include <math.h>
+#include <string.h>
 
 #include "jgraph.h"
@@ -19,6 +20,7 @@
 static double Pi;
 
-process_title(g)
-Graph g;
+void process_label(Label l, Graph g, int adjust);
+
+void process_title(Graph g)
 {
 
@@ -44,6 +46,51 @@
 }
 
-process_legend(g)
-Graph g;
+void process_label_max_n_mins(Label l, float len, float height)
+{
+  float xlen, ylen, xheight, yheight;
+  float x, y;
+
+  xlen = len * cos(l->rotate * Pi / 180.00);
+  ylen = height * cos((l->rotate + 90.0) * Pi / 180.00);
+  xheight = len * sin(l->rotate * Pi / 180.00);
+  yheight = height * sin((l->rotate + 90.0) * Pi / 180.00);
+  
+  x = l->x;
+  y = l->y;
+
+  if (l->hj == 'c') {
+    x -= xlen / 2.0;
+    y -= xheight / 2.0;
+  } else if (l->hj == 'r') {
+    x -= xlen;
+    y -= xheight;
+  }
+  if (l->vj == 'c') {
+    x -= ylen / 2.0;
+    y -= yheight / 2.0;
+  } else if (l->vj == 't') {
+    x -= ylen;
+    y -= yheight;
+  }
+
+  l->xmin = MIN(x, x + xlen);
+  l->xmin = MIN(l->xmin, x + xlen + ylen);
+  l->xmin = MIN(l->xmin, x + ylen);
+
+  l->ymin = MIN(y, y + xheight);
+  l->ymin = MIN(l->ymin, y + yheight);
+  l->ymin = MIN(l->ymin, y + xheight + yheight);
+
+  l->xmax = MAX(x, x + xlen);
+  l->xmax = MAX(l->xmax, x + xlen + ylen);
+  l->xmax = MAX(l->xmax, x + ylen);
+
+  l->ymax = MAX(y, y + xheight);
+  l->ymax = MAX(l->ymax, y + yheight);
+  l->ymax = MAX(l->ymax, y + xheight + yheight);
+
+}
+
+void process_legend(Graph g)
 {
   Legend l;
@@ -209,6 +256,5 @@
 }
 
-float find_reasonable_hash_interval(a) 
-Axis a;
+float find_reasonable_hash_interval(Axis a)
 {
   float s, d;
@@ -238,6 +284,5 @@
 }
 
-float find_reasonable_hash_start(a)
-Axis a;
+float find_reasonable_hash_start(Axis a)
 {
   int i;
@@ -249,6 +294,5 @@
 }
 
-int find_reasonable_precision(a)
-Axis a;
+int find_reasonable_precision(Axis a)
 {
   int i, b, b2, done;
@@ -293,6 +337,5 @@
 }
 
-int find_reasonable_minor_hashes(a)
-Axis a;
+int find_reasonable_minor_hashes(Axis a)
 {
   float d;  
@@ -316,7 +359,5 @@
 }
 
-process_axis1(a, g)
-Axis a;
-Graph g;
+void process_axis1(Axis a, Graph g)
 {
   float tmp;
@@ -386,7 +427,5 @@
 }
 
-process_axis2(a, g)
-Axis a;
-Graph g;
+void process_axis2(Axis a, Graph g)
 {
   float t1, t2, t3, minor_hashes, hloc, tmp;
@@ -576,8 +615,5 @@
 }
 
-process_label(l, g, adjust)
-Label l;
-Graph g;
-int adjust;
+void process_label(Label l, Graph g, int adjust)
 {
   float len, height;
@@ -618,55 +654,5 @@
 }
    
-process_label_max_n_mins(l, len, height)
-Label l;
-float len;
-float height;
-{
-  float xlen, ylen, xheight, yheight;
-  float x, y;
-
-  xlen = len * cos(l->rotate * Pi / 180.00);
-  ylen = height * cos((l->rotate + 90.0) * Pi / 180.00);
-  xheight = len * sin(l->rotate * Pi / 180.00);
-  yheight = height * sin((l->rotate + 90.0) * Pi / 180.00);
-  
-  x = l->x;
-  y = l->y;
-
-  if (l->hj == 'c') {
-    x -= xlen / 2.0;
-    y -= xheight / 2.0;
-  } else if (l->hj == 'r') {
-    x -= xlen;
-    y -= xheight;
-  }
-  if (l->vj == 'c') {
-    x -= ylen / 2.0;
-    y -= yheight / 2.0;
-  } else if (l->vj == 't') {
-    x -= ylen;
-    y -= yheight;
-  }
-
-  l->xmin = MIN(x, x + xlen);
-  l->xmin = MIN(l->xmin, x + xlen + ylen);
-  l->xmin = MIN(l->xmin, x + ylen);
-
-  l->ymin = MIN(y, y + xheight);
-  l->ymin = MIN(l->ymin, y + yheight);
-  l->ymin = MIN(l->ymin, y + xheight + yheight);
-
-  l->xmax = MAX(x, x + xlen);
-  l->xmax = MAX(l->xmax, x + xlen + ylen);
-  l->xmax = MAX(l->xmax, x + ylen);
-
-  l->ymax = MAX(y, y + xheight);
-  l->ymax = MAX(l->ymax, y + yheight);
-  l->ymax = MAX(l->ymax, y + xheight + yheight);
-
-}
-
-process_strings(g)
-Graph g;
+void process_strings(Graph g)
 {
   String s;
@@ -677,7 +663,5 @@
 }
 
-process_curve(c, g)
-Curve c;
-Graph g;
+void process_curve(Curve c, Graph g)
 {
   if (c->bezier && (c->npts < 4 || (c->npts % 3 != 1))) {
@@ -705,6 +689,5 @@
 }
 
-process_curves(g)
-Graph g;
+void process_curves(Graph g)
 {
   Curve c;
@@ -713,7 +696,15 @@
   }
 }
+
+void process_label_extrema(Label l, Graph g)
+{
+  if (l->label == CNULL) return;
+  g->yminval = MIN(g->yminval, l->ymin);
+  g->ymaxval = MAX(g->ymaxval, l->ymax);
+  g->xminval = MIN(g->xminval, l->xmin);
+  g->xmaxval = MAX(g->xmaxval, l->xmax);
+}
  
-process_extrema(g)  /* This finds all the minval/maxvals for bbox calc */
-Graph g;
+void process_extrema(Graph g)  /* Finds all the minval/maxvals for bbox calc */
 {
   Curve c;
@@ -764,17 +755,5 @@
 }
 
-process_label_extrema(l, g)
-Label l;
-Graph g;
-{
-  if (l->label == CNULL) return;
-  g->yminval = MIN(g->yminval, l->ymin);
-  g->ymaxval = MAX(g->ymaxval, l->ymax);
-  g->xminval = MIN(g->xminval, l->xmin);
-  g->xmaxval = MAX(g->xmaxval, l->xmax);
-}
-
-process_graph(g)
-Graph g;
+void process_graph(Graph g)
 {
   g->x_translate = intop(g->x_translate);
@@ -791,6 +770,5 @@
 }
 
-process_graphs(gs)
-Graphs gs;
+void process_graphs(Graphs gs)
 {
   Graphs the_g;
Index: /trunk/Jgraph/show.c
===================================================================
--- /trunk/Jgraph/show.c	(revision 419)
+++ /trunk/Jgraph/show.c	(revision 420)
@@ -10,6 +10,5 @@
 #include "jgraph.h"
 
-static spaces(nsp)
-int nsp;
+static void spaces(int nsp)
 {
   while(nsp-- > 0) putchar(' ');
@@ -44,6 +43,5 @@
 }
 
-static show_mltiline(s)
-char *s;
+static void show_mltiline(char *s)
 {
   int i;
@@ -58,6 +56,5 @@
 }
 
-show_string(s)
-char *s;
+void show_string(char *s)
 {
   int i;
@@ -75,8 +72,5 @@
     
    
-show_label(l, nsp, g)
-Label l;
-int nsp;
-Graph g;
+void show_label(Label l, int nsp, Graph g)
 {
   spaces(nsp); 
@@ -96,11 +90,7 @@
     printf("lcolor %f %f %f\n", l->gray[0], l->gray[1], l->gray[2]);
   }
-  return;
-}
-
-show_lmark(l, nsp, g)
-Label l;
-int nsp;
-Graph g;
+}
+
+void show_lmark(Label l, int nsp, Graph g)
 {
   spaces(nsp); show_string(l->label);
@@ -111,11 +101,7 @@
   spaces(nsp); printf("font %s ", l->font);
                printf("fontsize %f\n", l->fontsize);
-  return;
-}
-
-show_curve(c, nsp, g)
-Curve c;
-int nsp;
-Graph g;
+}
+
+void show_curve(Curve c, int nsp, Graph g)
 {
   Point p;
@@ -252,8 +238,5 @@
 }
 
-show_axis(a, nsp, g)
-Axis a;
-int nsp;
-Graph g;
+void show_axis(Axis a, int nsp, Graph g)
 {
   Axis other;
@@ -343,8 +326,5 @@
 }
 
-show_legend(l, nsp, g)
-Legend l;
-int nsp;
-Graph g;
+void show_legend(Legend l, int nsp, Graph g)
 {
   if (l->type == 'c') {
@@ -363,7 +343,5 @@
 }
 
-show_graph(g, nsp)
-Graph g;
-int nsp;
+void show_graph(Graph g, int nsp)
 {
 
@@ -395,6 +373,5 @@
 }
 
-show_graphs(gs)
-Graphs gs;
+void show_graphs(Graphs gs)
 {
   Graphs the_g;
Index: /trunk/Jgraph/sin.c
===================================================================
--- /trunk/Jgraph/sin.c	(revision 419)
+++ /trunk/Jgraph/sin.c	(revision 420)
@@ -1,7 +1,9 @@
+#include <stdio.h>
 #include <math.h>
-     main()
+     int main(void)
      {
        double x;
        for (x = -10.0; x < 10.0; x += .03)
          printf("%f %f\n", x, sin(x));
+       return 0;
      }
Index: /trunk/Jgraph/token.c
===================================================================
--- /trunk/Jgraph/token.c	(revision 419)
+++ /trunk/Jgraph/token.c	(revision 420)
@@ -8,4 +8,5 @@
 #include <math.h>
 #include <stdio.h>
+#include <string.h>
 
 #ifdef LCC 
@@ -36,5 +37,5 @@
 static int getnew = 1;
 static char oldchar = '\0';
-static oldcharvalid = 0;
+static int oldcharvalid = 0;
 static char pipe = 0;
 static int eof = 0;
@@ -61,8 +62,6 @@
 #endif /*VMS*/
 
-set_input_file(s)
-char *s;
-{
-  FILE *f;
+void set_input_file(char *s)
+{
   Iostack n;
 
@@ -94,5 +93,5 @@
 }
 
-error_header()
+void error_header()
 {
   fprintf(stderr, "%s,%d: ", FILENAME, line);
@@ -107,5 +106,5 @@
 }
 
-ungettokenchar()
+void ungettokenchar()
 {
   oldcharvalid = 1;
@@ -132,5 +131,5 @@
 }
 
-get_comment()
+void get_comment()
 {
   if (eof) return;
@@ -149,6 +148,5 @@
 }
 
-static push_iostack(p)
-int p;
+static void push_iostack(int p)
 {
   Iostack n;
@@ -178,5 +176,5 @@
 }
 
-static pop_iostack()
+static void pop_iostack()
 {
   Iostack n;
@@ -196,5 +194,5 @@
     n->stream = fopen(n->filename, "r");
     if (n->stream == NULL) {
-      fprintf(stderr, "Error: cannot open file \"%s\"\n", n->stream);
+      fprintf(stderr, "Error: cannot open file \"%s\"\n", n->filename);
       exit(1);
     }
@@ -211,5 +209,7 @@
 }
 
-static nexttoken()
+int getsystemstring(void);
+
+static void nexttoken()
 {
   if (eof) return;
@@ -256,9 +256,7 @@
   }
   getnew = 1;
-  return;
-}
-
-int getstring(s)
-char *s;
+}
+
+int getstring(char *s)
 {
   nexttoken();
@@ -268,6 +266,5 @@
 }
 
-int getint(i)
-int *i;
+int getint(int *i)
 {
   int j;
@@ -283,6 +280,5 @@
 }
 
-int getfloat(f)
-float *f;
+int getfloat(float *f)
 {
   int j;
@@ -335,5 +331,5 @@
 {
   char c;
-  int i, j, done, len, started;
+  int i, done, len, started;
   char *out_str;
 
@@ -375,7 +371,5 @@
 char *getlabel()
 {
-  char c;
   char *txt, *new;
-  int i;
 
   txt = getmultiline();
@@ -416,5 +410,5 @@
 }
 
-rejecttoken()
+void rejecttoken(void)
 {
   getnew = 0;
