Solve some gcc warnings in ego. kernigh-linuxppc kernigh-pr
authorGeorge Koehler <xkernigh@netscape.net>
Thu, 8 Mar 2018 23:51:07 +0000 (18:51 -0500)
committerGeorge Koehler <xkernigh@netscape.net>
Thu, 8 Mar 2018 23:51:07 +0000 (18:51 -0500)
Some of these are from gcc -Wimplicit

util/ego/cs/cs.c
util/ego/cs/cs_debug.c
util/ego/cs/cs_profit.c
util/ego/share/files.c
util/ego/share/files.h
util/ego/share/get.c
util/ego/share/go.c
util/ego/share/go.h
util/ego/share/types.h

index dfcccbb..068ddc3 100644 (file)
@@ -25,7 +25,7 @@
 
 int Scs; /* Number of optimizations found. */
 
-STATIC cs_clear()
+STATIC void cs_clear()
 {
        clr_avails();
        clr_entities();
@@ -74,9 +74,7 @@ STATIC void cs_optimize(void *vp)
        }
 }
 
-main(argc, argv)
-       int     argc;
-       char    *argv[];
+int main(int argc, char *argv[])
 {
        Scs = 0;
        go(argc, argv, no_action, cs_optimize, cs_machinit, no_action);
index 0789039..3d5509d 100644 (file)
@@ -11,6 +11,7 @@
 #include "cs.h"
 #include "cs_aux.h"
 #include "cs_avail.h"
+#include "cs_debug.h"
 #include "cs_entity.h"
 
 #ifdef VERBOSE
@@ -48,7 +49,7 @@ STATIC void showinstr(line_p lnp)
        fprintf(stderr,"\n");
 }
 
-SHOWOCCUR(occur_p ocp)
+void SHOWOCCUR(occur_p ocp)
 {
        /* Shows all instructions in an occurrence. */
 
index a92028c..2efabcb 100644 (file)
@@ -14,6 +14,7 @@
 #include "../share/cset.h"
 #include "../share/lset.h"
 #include "cs.h"
+#include "cs_alloc.h"
 #include "cs_aux.h"
 #include "cs_debug.h"
 #include "cs_avail.h"
index e45f9b7..2dd10b2 100644 (file)
@@ -9,9 +9,11 @@
  */
 
 #include <stdio.h>
+#include "types.h"
+#include "debug.h"
 #include "files.h"
 
-struct files* findfiles(int argc, const char** argv)
+struct files* findfiles(int argc, char * const *argv)
 {
        static struct files files;
 
index 46b1991..ab2076e 100644 (file)
@@ -33,11 +33,11 @@ struct files
 
        /* The rest of the arguments. */
 
-       const char** argv;
+       char * const *argv;
        int argc;
 };
 
-struct files* findfiles(int argc, const char** argv);
+struct files* findfiles(int argc, char * const *argv);
 
 FILE *openfile(const char *name, const char *mode);
                                /*
index 94c7aab..a433b09 100644 (file)
@@ -285,7 +285,7 @@ dblock_p getdtable(const char *dname)
 
 /* getbblocks */
 
-STATIC argstring(short length, argb_p abp)
+STATIC void argstring(short length, argb_p abp)
 {
 
        while (length--) {
index 9a2107d..0ccd3c6 100644 (file)
@@ -42,7 +42,7 @@ STATIC void mach_init(char* machfile, void (*phase_machinit)(void *))
        fclose(f);
 }
 
-void go(int argc, const char** argv,
+void go(int argc, char * const *argv,
        void (*initialize)(void *), void (*optimize)(void *),
        void (*phase_machinit)(void *), void (*proc_flag)(void *))
 {
index 3bb8c1f..55f1b48 100644 (file)
@@ -22,7 +22,7 @@
  * and 'optimize' is called with the current procedure
  * as parameter.
  */
-void go(int argc, const char** argv,
+void go(int argc, char * const *argv,
        void (*initialize)(void *null),
        void (*optimize)(void *),       /* (proc_p *p) */
        void (*phase_machinit)(void *), /* (FILE *f) */
index cae4d60..cabc581 100644 (file)
@@ -46,7 +46,7 @@ typedef struct elemholder *lset;
 typedef struct bitvector  *cset;
 typedef elem_p Lindex;
 typedef short  Cindex;
-typedef char   *Lelem_t;
+typedef void   *Lelem_t;
 typedef short  Celem_t;
 
 typedef union pext_t *pext_p;