]> git.eshelyaron.com Git - emacs.git/commitdiff
Conditionally include various headers.
authorThien-Thi Nguyen <ttn@gnuvola.org>
Wed, 12 May 2004 14:52:42 +0000 (14:52 +0000)
committerThien-Thi Nguyen <ttn@gnuvola.org>
Wed, 12 May 2004 14:52:42 +0000 (14:52 +0000)
Use "epaths.h", not <../src/epaths.h>.
(yow): Cast result of malloc and realloc.
(malloc, realloc): Declarations deleted.
(main): Use time_t, not long, to avoid a compiler warning.

lib-src/ChangeLog
lib-src/yow.c

index e914db517a6467e0ca93e0956306654754af36e5..e076d60476b01cc37bf4bd87d927c947dd988549 100644 (file)
@@ -1,3 +1,11 @@
+2004-05-12  Thien-Thi Nguyen  <ttn@gnu.org>
+
+       * yow.c: Conditionally include various headers.
+       Use "epaths.h", not <../src/epaths.h>.
+       (yow): Cast result of malloc and realloc.
+       (malloc, realloc): Declarations deleted.
+       (main): Use time_t, not long, to avoid a compiler warning.
+
 2004-05-10  Thien-Thi Nguyen  <ttn@gnu.org>
 
        * cvtmail.c, yow.c: Include config.h.
index aea3b005fbee97e20f05e4cf5c7647fd43185913..2892d76b56338d9f4c55f1b07b4ddf521e42ae11 100644 (file)
 
 #include <stdio.h>
 #include <ctype.h>
-#include <../src/epaths.h>      /* For PATH_DATA.  */
+#ifdef TIME_WITH_SYS_TIME
+#include <sys/time.h>
+#include <time.h>
+#else
+#ifdef HAVE_SYS_TIME_H
+#include <sys/time.h>
+#else
+#include <time.h>
+#endif
+#endif
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+#include "epaths.h"            /* For PATH_DATA.  */
 
 #define BUFSIZE  80
 #define SEP      '\0'
@@ -37,8 +50,6 @@
     &res;})
 #endif
 
-char *malloc(), *realloc();
-
 void yow();
 void setup_yow();
 
@@ -66,7 +77,7 @@ main (argc, argv)
   }
 
   /* initialize random seed */
-  srand((int) (getpid() + time((long *) 0)));
+  srand((int) (getpid() + time((time_t *) 0)));
 
   setup_yow(fp);
   yow(fp);
@@ -143,7 +154,7 @@ yow (fp)
   }
 
   bufsize = BUFSIZE;
-  buf = malloc(bufsize);
+  buf = (char *) malloc(bufsize);
   if (buf == (char *)0) {
     fprintf(stderr, "yow: virtual memory exhausted\n");
     exit (3);
@@ -156,7 +167,7 @@ yow (fp)
     if (i == bufsize-1) {
       /* Yow! Is this quotation too long yet? */
       bufsize *= 2;
-      buf = realloc(buf, bufsize);
+      buf = (char *) realloc(buf, bufsize);
       if (buf == (char *)0) {
        fprintf(stderr, "yow: virtual memory exhausted\n");
        exit (3);