diff lib-src/sorted-doc.c @ 9491:dd3b83e4ceb0

Eliminate some -Wall warnings.
author David J. MacKenzie <djm@gnu.org>
date Wed, 12 Oct 1994 20:21:51 +0000
parents c4535b4417d2
children b0652f55a85d
line wrap: on
line diff
--- a/lib-src/sorted-doc.c	Wed Oct 12 19:20:24 1994 +0000
+++ b/lib-src/sorted-doc.c	Wed Oct 12 20:21:51 1994 +0000
@@ -35,17 +35,9 @@
 };
 
 
-/* Print error message and exit.  */
-
-fatal (s1, s2)
-     char *s1, *s2;
-{
-  error (s1, s2);
-  exit (1);
-}
-
 /* Print error message.  `s1' is printf control string, `s2' is arg for it. */
 
+void
 error (s1, s2)
      char *s1, *s2;
 {
@@ -54,6 +46,16 @@
   fprintf (stderr, "\n");
 }
 
+/* Print error message and exit.  */
+
+void
+fatal (s1, s2)
+     char *s1, *s2;
+{
+  error (s1, s2);
+  exit (1);
+}
+
 /* Like malloc but get fatal error if memory is exhausted.  */
 
 char *
@@ -67,7 +69,7 @@
 }
 
 char *
-strsav (str)
+xstrdup (str)
      char * str;
 {
   char *buf = xmalloc (strlen (str) + 1);
@@ -98,12 +100,12 @@
   "WAITING", "BEG_NAME", "NAME_GET", "BEG_DESC", "DESC_GET"
 };
     
+int
 main ()
 {
   register DOCSTR *dp = NULL;	/* allocated DOCSTR */
   register LINE *lp = NULL;	/* allocated line */
   register char *bp;		/* ptr inside line buffer */
-  int notfirst = 0;		/* set after read something */
   register enum state state = WAITING; /* state at start */
   int cnt = 0;			/* number of DOCSTRs read */
 
@@ -169,7 +171,7 @@
 	  else			/* saving and changing state */
 	    {
 	      *bp = NUL;
-	      bp = strsav (buf);
+	      bp = xstrdup (buf);
 
 	      if (state == NAME_GET)
 		dp->name = bp;