From: George Koehler Date: Thu, 8 Mar 2018 23:51:07 +0000 (-0500) Subject: Solve some gcc warnings in ego. X-Git-Url: https://git.ndcode.org/public/gitweb.cgi?a=commitdiff_plain;h=refs%2Fheads%2Fkernigh-pr;p=ack.git Solve some gcc warnings in ego. Some of these are from gcc -Wimplicit --- diff --git a/util/ego/cs/cs.c b/util/ego/cs/cs.c index dfcccbbf7..068ddc3dc 100644 --- a/util/ego/cs/cs.c +++ b/util/ego/cs/cs.c @@ -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); diff --git a/util/ego/cs/cs_debug.c b/util/ego/cs/cs_debug.c index 07890395b..3d5509ddc 100644 --- a/util/ego/cs/cs_debug.c +++ b/util/ego/cs/cs_debug.c @@ -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. */ diff --git a/util/ego/cs/cs_profit.c b/util/ego/cs/cs_profit.c index a92028c36..2efabcb03 100644 --- a/util/ego/cs/cs_profit.c +++ b/util/ego/cs/cs_profit.c @@ -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" diff --git a/util/ego/share/files.c b/util/ego/share/files.c index e45f9b7fb..2dd10b25f 100644 --- a/util/ego/share/files.c +++ b/util/ego/share/files.c @@ -9,9 +9,11 @@ */ #include +#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; diff --git a/util/ego/share/files.h b/util/ego/share/files.h index 46b19917a..ab2076ea1 100644 --- a/util/ego/share/files.h +++ b/util/ego/share/files.h @@ -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); /* diff --git a/util/ego/share/get.c b/util/ego/share/get.c index 94c7aabe2..a433b0946 100644 --- a/util/ego/share/get.c +++ b/util/ego/share/get.c @@ -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--) { diff --git a/util/ego/share/go.c b/util/ego/share/go.c index 9a2107d3d..0ccd3c6e9 100644 --- a/util/ego/share/go.c +++ b/util/ego/share/go.c @@ -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 *)) { diff --git a/util/ego/share/go.h b/util/ego/share/go.h index 3bb8c1f54..55f1b48e8 100644 --- a/util/ego/share/go.h +++ b/util/ego/share/go.h @@ -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) */ diff --git a/util/ego/share/types.h b/util/ego/share/types.h index cae4d6074..cabc5818d 100644 --- a/util/ego/share/types.h +++ b/util/ego/share/types.h @@ -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;