changeset 9491:dd3b83e4ceb0

Eliminate some -Wall warnings.
author David J. MacKenzie <djm@gnu.org>
date Wed, 12 Oct 1994 20:21:51 +0000
parents 4e70299f958d
children be695247b717
files lib-src/=timer.c lib-src/=wakeup.c lib-src/b2m.c lib-src/cvtmail.c lib-src/digest-doc.c lib-src/emacsclient.c lib-src/etags.c lib-src/fakemail.c lib-src/hexl.c lib-src/make-docfile.c lib-src/movemail.c lib-src/profile.c lib-src/sorted-doc.c lib-src/test-distrib.c lib-src/yow.c
diffstat 15 files changed, 75 insertions(+), 39 deletions(-) [+]
line wrap: on
line diff
--- a/lib-src/=timer.c	Wed Oct 12 19:20:24 1994 +0000
+++ b/lib-src/=timer.c	Wed Oct 12 20:21:51 1994 +0000
@@ -199,7 +199,6 @@
 getevent ()
 {
   int i;
-  int n_events;
 
   /* In principle the itimer should be disabled on entry to this
      function, but it really doesn't make any important difference
--- a/lib-src/=wakeup.c	Wed Oct 12 19:20:24 1994 +0000
+++ b/lib-src/=wakeup.c	Wed Oct 12 20:21:51 1994 +0000
@@ -18,6 +18,7 @@
 
 struct tm *localtime ();
 
+void
 main (argc, argv)
      int argc;
      char **argv;
--- a/lib-src/b2m.c	Wed Oct 12 19:20:24 1994 +0000
+++ b/lib-src/b2m.c	Wed Oct 12 20:21:51 1994 +0000
@@ -40,6 +40,7 @@
 time_t ltoday;
 char from[MAX_DATA_LEN], labels[MAX_DATA_LEN], data[MAX_DATA_LEN], *p, *today;
 
+int
 main (argc, argv)
      int argc;
      char **argv;
@@ -117,4 +118,5 @@
       if (printing)
 	puts (data);
     }
+  return 0;
 }
--- a/lib-src/cvtmail.c	Wed Oct 12 19:20:24 1994 +0000
+++ b/lib-src/cvtmail.c	Wed Oct 12 20:21:51 1994 +0000
@@ -36,10 +36,13 @@
 
 char *malloc ();
 char *realloc ();
+char *getenv ();
+
 char *xmalloc ();
 char *xrealloc ();
-char *getenv ();
+void skip_to_lf ();
 
+int
 main (argc, argv)
      int argc;
      char *argv[];
@@ -53,7 +56,7 @@
   FILE *mddf;
   FILE *mfilef;
   FILE *cff;
-  char pre[10], post[100];
+  char pre[10];
   char name[14];
   int c;
 
@@ -103,6 +106,7 @@
   return 0;
 }
 
+void
 skip_to_lf (stream)
      FILE *stream;
 {
@@ -111,6 +115,26 @@
     ;
 }
 
+
+void
+error (s1, s2)
+     char *s1, *s2;
+{
+  fprintf (stderr, "cvtmail: ");
+  fprintf (stderr, s1, s2);
+  fprintf (stderr, "\n");
+}
+
+/* Print error message and exit.  */
+
+void
+fatal (s1, s2)
+     char *s1, *s2;
+{
+  error (s1, s2);
+  exit (1);
+}
+
 char *
 xmalloc (size)
      unsigned size;
@@ -131,20 +155,3 @@
     fatal ("virtual memory exhausted");
   return result;
 }
-
-/* Print error message and exit.  */
-
-fatal (s1, s2)
-     char *s1, *s2;
-{
-  error (s1, s2);
-  exit (1);
-}
-
-error (s1, s2)
-     char *s1, *s2;
-{
-  fprintf (stderr, "cvtmail: ");
-  fprintf (stderr, s1, s2);
-  fprintf (stderr, "\n");
-}
--- a/lib-src/digest-doc.c	Wed Oct 12 19:20:24 1994 +0000
+++ b/lib-src/digest-doc.c	Wed Oct 12 20:21:51 1994 +0000
@@ -6,6 +6,8 @@
    but in texinfo format and sorted by function/variable name.  */
 
 #include <stdio.h>
+
+int
 main ()
 {
   register int ch;
--- a/lib-src/emacsclient.c	Wed Oct 12 19:20:24 1994 +0000
+++ b/lib-src/emacsclient.c	Wed Oct 12 20:21:51 1994 +0000
@@ -55,6 +55,7 @@
 extern char *strerror ();
 extern int errno;
 
+int
 main (argc, argv)
      int argc;
      char **argv;
@@ -167,7 +168,7 @@
   while (str = fgets (string, BUFSIZ, out))
     printf ("%s", str);
   
-  exit (0);
+  return 0;
 }
 
 #else /* This is the SYSV IPC section */
--- a/lib-src/etags.c	Wed Oct 12 19:20:24 1994 +0000
+++ b/lib-src/etags.c	Wed Oct 12 20:21:51 1994 +0000
@@ -55,6 +55,7 @@
 #include "getopt.h"
 
 extern char *getenv ();
+char *malloc (), *realloc ();
 
 /* Define CTAGS to make the program "ctags" compatible with the usual one.
  Let it undefined to make the program "etags", which makes emacs-style
@@ -161,6 +162,9 @@
 char *relative_filename (), *absolute_filename (), *absolute_dirname ();
 char *xmalloc (), *xrealloc ();
 int total_size_of_entries ();
+int string_numeric_p ();
+int substr ();
+int prestr ();
 long readline ();
 
 void Asm_labels ();
--- a/lib-src/fakemail.c	Wed Oct 12 19:20:24 1994 +0000
+++ b/lib-src/fakemail.c	Wed Oct 12 20:21:51 1994 +0000
@@ -23,11 +23,13 @@
 
 #if defined (BSD) && !defined (BSD4_1) && !defined (USE_FAKEMAIL)
 /* This program isnot used in BSD, so just avoid loader complaints.  */
+void
 main ()
 {
 }
 #else /* not BSD 4.2 (or newer) */
 #ifdef MSDOS
+void
 main ()
 {
 }
--- a/lib-src/hexl.c	Wed Oct 12 19:20:24 1994 +0000
+++ b/lib-src/hexl.c	Wed Oct 12 20:21:51 1994 +0000
@@ -16,6 +16,9 @@
 int group_by = DEFAULT_GROUPING;
 char *progname;
 
+void usage();
+
+int
 main (argc, argv)
      int argc;
      char *argv[];
@@ -231,6 +234,7 @@
   return 0;
 }
 
+void
 usage ()
 {
   fprintf (stderr, "usage: %s [-de] [-iso]\n", progname);
--- a/lib-src/make-docfile.c	Wed Oct 12 19:20:24 1994 +0000
+++ b/lib-src/make-docfile.c	Wed Oct 12 20:21:51 1994 +0000
@@ -44,8 +44,13 @@
 #define READ_BINARY "r"
 #endif /* not MSDOS */
 
+int scan_file ();
+int scan_lisp_file ();
+int scan_c_file ();
+
 FILE *outfile;
 
+int
 main (argc, argv)
      int argc;
      char **argv;
@@ -83,11 +88,13 @@
 #ifndef VMS
   exit (err_count);			/* see below - shane */
 #endif /* VMS */
+  return err_count;
 }
 
 /* Read file FILENAME and output its doc strings to outfile.  */
 /* Return 1 if file is not found, 0 if it is found.  */
 
+int
 scan_file (filename)
      char *filename;
 {
@@ -109,6 +116,7 @@
  Convert escape sequences \n and \t to newline and tab;
  discard \ followed by newline.  */
 
+int
 read_c_string (infile, printflag)
      FILE *infile;
      int printflag;
@@ -156,6 +164,7 @@
 /* Write to file OUT the argument names of function FUNC, whose text is in BUF.
    MINARGS and MAXARGS are the minimum and maximum number of arguments.  */
 
+void
 write_c_args (out, func, buf, minargs, maxargs)
      FILE *out;
      char *func, *buf;
@@ -240,6 +249,7 @@
    Looks for DEFUN constructs such as are defined in ../src/lisp.h.
    Accepts any word starting DEF... so it finds DEFSIMPLE and DEFPRED.  */
 
+int
 scan_c_file (filename, mode)
      char *filename, *mode;
 {
@@ -486,7 +496,7 @@
   skip_white (infile);
 }
 
-
+int
 scan_lisp_file (filename, mode)
      char *filename, *mode;
 {
@@ -504,7 +514,6 @@
   while (!feof (infile))
     {
       char buffer [BUFSIZ];
-      char *fillp = buffer;
       char type;
 
       if (c != '\n')
--- a/lib-src/movemail.c	Wed Oct 12 19:20:24 1994 +0000
+++ b/lib-src/movemail.c	Wed Oct 12 20:21:51 1994 +0000
@@ -546,11 +546,13 @@
    *      directories have lost mail when over quota because these checks were
    *      not made in previous versions of movemail. */
 
+#ifdef BSD
   if (fsync (mbfi) < 0)
     {
       error ("Error in fsync: %s", strerror (errno));
       return (1);
     }
+#endif
 
   if (close (mbfi) == -1)
     {
--- a/lib-src/profile.c	Wed Oct 12 19:20:24 1994 +0000
+++ b/lib-src/profile.c	Wed Oct 12 20:21:51 1994 +0000
@@ -39,7 +39,7 @@
 
 /* Reset the stopwatch to zero.  */
 
-int
+void
 reset_watch ()
 {
   EMACS_GET_TIME (TV1);
--- 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;
--- a/lib-src/test-distrib.c	Wed Oct 12 19:20:24 1994 +0000
+++ b/lib-src/test-distrib.c	Wed Oct 12 20:21:51 1994 +0000
@@ -32,6 +32,7 @@
     }
 }
 
+int
 main (argc, argv)
      int argc;
      char **argv;
@@ -63,7 +64,6 @@
   close (fd);
 #ifdef VMS
   exit (1);			/* On VMS, success is 1.  */
-#else
-  exit (0);
 #endif
+  return (0);
 }
--- a/lib-src/yow.c	Wed Oct 12 19:20:24 1994 +0000
+++ b/lib-src/yow.c	Wed Oct 12 20:21:51 1994 +0000
@@ -30,6 +30,7 @@
     &res;})
 #endif
 
+int
 main (argc, argv)
      int argc;
      char *argv[];
@@ -58,7 +59,7 @@
   setup_yow(fp);
   yow(fp);
   fclose(fp);
-  exit(0);
+  return 0;
 }
 
 static long len = -1;