]> code.delx.au - gnu-emacs/commitdiff
Eliminate some -Wall warnings.
authorDavid J. MacKenzie <djm@gnu.org>
Wed, 12 Oct 1994 20:21:51 +0000 (20:21 +0000)
committerDavid J. MacKenzie <djm@gnu.org>
Wed, 12 Oct 1994 20:21:51 +0000 (20:21 +0000)
15 files changed:
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/timer.c
lib-src/wakeup.c
lib-src/yow.c

index b6e027590a5b5a7b4a36efaf603004b1cf3a8c1f..ededf304f000c391b3274ada7f9f11216d6ffc4d 100644 (file)
@@ -40,6 +40,7 @@ int header = FALSE, printing;
 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 @@ main (argc, argv)
       if (printing)
        puts (data);
     }
+  return 0;
 }
index c1fec8792c5a348e7ab916cbe038e0ed7d7cfb8d..b6e0c58ceb3ff332ebed41dd77d3e77cb491830c 100644 (file)
@@ -36,10 +36,13 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.  */
 
 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 @@ main (argc, argv)
   FILE *mddf;
   FILE *mfilef;
   FILE *cff;
-  char pre[10], post[100];
+  char pre[10];
   char name[14];
   int c;
 
@@ -103,6 +106,7 @@ main (argc, argv)
   return 0;
 }
 
+void
 skip_to_lf (stream)
      FILE *stream;
 {
@@ -111,6 +115,26 @@ skip_to_lf (stream)
     ;
 }
 
+
+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 @@ xrealloc (ptr, size)
     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");
-}
index d7764c08a65639d87fefd64b5fc1b1160636ab4a..1d47ce0a0ce8d0b1db7133c4b16e3a23dea1af93 100644 (file)
@@ -6,6 +6,8 @@
    but in texinfo format and sorted by function/variable name.  */
 
 #include <stdio.h>
+
+int
 main ()
 {
   register int ch;
index 76d0b4e54d92b0499e805c168ea59af67bb2e36b..303ad65403075c963fbff971e48739ecde72197c 100644 (file)
@@ -55,6 +55,7 @@ main (argc, argv)
 extern char *strerror ();
 extern int errno;
 
+int
 main (argc, argv)
      int argc;
      char **argv;
@@ -167,7 +168,7 @@ main (argc, argv)
   while (str = fgets (string, BUFSIZ, out))
     printf ("%s", str);
   
-  exit (0);
+  return 0;
 }
 
 #else /* This is the SYSV IPC section */
index f893111f8e4dad4c06b75b21b5fea957c76c6d0a..3be430c11177ff4bccee6a2f83dfbbf11a2b6580 100644 (file)
@@ -55,6 +55,7 @@ char pot_etags_version[] = "@(#) pot revision number is 10.32";
 #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 *etags_getcwd ();
 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 ();
index 59bf2d661ac4d2ba806de7f0c8cc5d077b2b795b..5adcf66fbc82427da6439465bf0f35e7d1403f55 100644 (file)
@@ -23,11 +23,13 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.  */
 
 #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 ()
 {
 }
index bd6220e0ba5fc334babfc98f4985cc3fb6c1eb52..b090dae335be4b52037095c78b736fe9bfafc8d9 100644 (file)
@@ -16,6 +16,9 @@ int base = DEFAULT_BASE, un_flag = FALSE, iso_flag = FALSE, endian = 1;
 int group_by = DEFAULT_GROUPING;
 char *progname;
 
+void usage();
+
+int
 main (argc, argv)
      int argc;
      char *argv[];
@@ -231,6 +234,7 @@ main (argc, argv)
   return 0;
 }
 
+void
 usage ()
 {
   fprintf (stderr, "usage: %s [-de] [-iso]\n", progname);
index 58062efeee1a48b4cbab0ecd64e92b6d9f59697a..72be211f86891c0c5024b68353485899ab3c9f4b 100644 (file)
@@ -44,8 +44,13 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.  */
 #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 @@ main (argc, argv)
 #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 @@ char buf[128];
  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 @@ read_c_string (infile, printflag)
 /* 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 @@ write_c_args (out, func, buf, minargs, maxargs)
    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 @@ read_lisp_symbol (infile, buffer)
   skip_white (infile);
 }
 
-
+int
 scan_lisp_file (filename, mode)
      char *filename, *mode;
 {
@@ -504,7 +514,6 @@ scan_lisp_file (filename, mode)
   while (!feof (infile))
     {
       char buffer [BUFSIZ];
-      char *fillp = buffer;
       char type;
 
       if (c != '\n')
index c971c9f2b11130f344fa78e5993eb603cebe70bd..283aca21c134674e6bff1591772cafa6930c57ad 100644 (file)
@@ -546,11 +546,13 @@ popmail (user, outfile)
    *      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)
     {
index 16a74b713518df4fa705332f1030a86c5b659c45..09b094ce9347b2e71e56ee7efa866114435be033 100644 (file)
@@ -39,7 +39,7 @@ static char time_string[30];
 
 /* Reset the stopwatch to zero.  */
 
-int
+void
 reset_watch ()
 {
   EMACS_GET_TIME (TV1);
index 129ce9c83b3da61fcba58503aa983b8ffa804e25..0ba419d490738ad0105f48c8333beca07cad73c5 100644 (file)
@@ -35,17 +35,9 @@ struct docstr                        /* Allocated thing for an entry. */
 };
 
 \f
-/* 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 @@ error (s1, s2)
   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 @@ xmalloc (size)
 }
 
 char *
-strsav (str)
+xstrdup (str)
      char * str;
 {
   char *buf = xmalloc (strlen (str) + 1);
@@ -98,12 +100,12 @@ char *states[] =
   "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 @@ main ()
          else                  /* saving and changing state */
            {
              *bp = NUL;
-             bp = strsav (buf);
+             bp = xstrdup (buf);
 
              if (state == NAME_GET)
                dp->name = bp;
index 897922a3bf51725edd87b24ff2b5bd07fec251fe..33dc0a46ab407221ce5d4747d1691f98ecc1a58d 100644 (file)
@@ -32,6 +32,7 @@ cool_read (fd, buf, size)
     }
 }
 
+int
 main (argc, argv)
      int argc;
      char **argv;
@@ -63,7 +64,6 @@ have been corrupted in the files of Emacs, and it will not work.\n",
   close (fd);
 #ifdef VMS
   exit (1);                    /* On VMS, success is 1.  */
-#else
-  exit (0);
 #endif
+  return (0);
 }
index 6a3a3fba101205d6cda9b083a7b57554ed37323d..9bd547ce8f2a4826f3519ecc3804c06bb7d5e416 100644 (file)
@@ -199,7 +199,6 @@ void
 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
index c26289c84e2a7a920760adf92b9d60dbf123a896..9c8838dbc136f8e592abc80409614b4311b85cb5 100644 (file)
@@ -18,6 +18,7 @@
 
 struct tm *localtime ();
 
+void
 main (argc, argv)
      int argc;
      char **argv;
index 0f289a19358cc8ae75bede7671d9266250cbf217..05ec9d4341523c7cc4aae12b7efb0f10f3cdabc2 100644 (file)
@@ -30,6 +30,7 @@
     &res;})
 #endif
 
+int
 main (argc, argv)
      int argc;
      char *argv[];
@@ -58,7 +59,7 @@ main (argc, argv)
   setup_yow(fp);
   yow(fp);
   fclose(fp);
-  exit(0);
+  return 0;
 }
 
 static long len = -1;