]> granicus.if.org Git - fortune-mod/commitdiff
get rid of GCC warnings.
authorShlomi Fish <shlomif@shlomifish.org>
Mon, 4 Apr 2016 16:09:18 +0000 (19:09 +0300)
committerShlomi Fish <shlomif@shlomifish.org>
Tue, 5 Apr 2016 13:53:59 +0000 (16:53 +0300)
fortune-mod/util/rot.c
fortune-mod/util/strfile.c
fortune-mod/util/unstr.c

index 30641933658ca7a2b737d47f0eb96bfb70a708bc..c9d5a950031304304bb27d81ea08962a0c9208fa 100644 (file)
@@ -5,6 +5,7 @@
 
 #include <stdio.h>
 #include <ctype.h>
+#include <stdlib.h>
 
 int main(void)
 {
index 57374850a4336736978882e6683ca324bc1e3653..0441fc91d72885cc290f8de9f6158789e64bd4c0 100644 (file)
@@ -411,7 +411,7 @@ void randomize(void)
  */
 int main(int ac, char **av)
 {
-    register unsigned char *sp;
+    register char *sp;
     register FILE *inf, *outf;
     register int32_t last_off, length, pos, *p;
     register int first, cnt;
@@ -513,9 +513,9 @@ int main(int ac, char **av)
                 puts("There was 1 string");
             else
                 printf("There were %ld strings\n", Num_pts - 1);
-            printf("Longest string: %lu byte%s\n", Tbl.str_longlen,
+            printf("Longest string: %lu byte%s\n", (unsigned long)(Tbl.str_longlen),
                 Tbl.str_longlen == 1 ? "" : "s");
-            printf("Shortest string: %lu byte%s\n", Tbl.str_shortlen,
+            printf("Shortest string: %lu byte%s\n", (unsigned long)(Tbl.str_shortlen),
                 Tbl.str_shortlen == 1 ? "" : "s");
         }
     }
index baef736599e85b95864fda0bc16b2abcadc0270a..769df40d4d0469d199e2781ce995e533b67a746b 100644 (file)
@@ -95,6 +95,7 @@ static char sccsid[] = "@(#)unstr.c   8.1 (Berkeley) 5/31/93";
 #include       <stdio.h>
 #include       <ctype.h>
 #include       <string.h>
+#include       <stdlib.h>
 #include       <unistd.h>
 
 #ifndef MAXPATHLEN
@@ -174,7 +175,7 @@ void order_unstr(tbl)
      register STRFILE *tbl;
 {
     register int i;
-    register unsigned char *sp;
+    register char *sp;
     auto int32_t pos;
     char buf[BUFSIZ];
     int printedsome;