diff --git a/alloc.c b/alloc.c index e6759ff..931ed07 100644 --- a/alloc.c +++ b/alloc.c @@ -15,7 +15,8 @@ void *tmp; tmp = calloc(n, s); if (tmp==NULL) { - fprintf(stderr, "Failure to allocate %d objects of %d bytes ", n, s); + fprintf(stderr, "Failure to allocate %lu objects of %lu bytes ", + (unsigned long) n, (unsigned long) s); fprintf(stderr, "on line %d of %s\n", l, f); fprintf(stderr, "Emergency stop.\n"); exit(1); diff --git a/gambit.c b/gambit.c index 2a8d231..3e3f1d5 100644 --- a/gambit.c +++ b/gambit.c @@ -4,6 +4,7 @@ */ #include +#include #include "rat.h" #include "treedef.h" diff --git a/interface.c b/interface.c index b55256b..b9ed8b8 100644 --- a/interface.c +++ b/interface.c @@ -4,6 +4,7 @@ */ #include +#include #include "rat.h" #include "treedef.h" /* PLAYERS */ diff --git a/leaves.c b/leaves.c index 0cbdb32..3cd2355 100644 --- a/leaves.c +++ b/leaves.c @@ -14,6 +14,7 @@ #include "leaves.h" /* test if input properly processed by generating what should be an echo */ +#ifdef UNUSED static void testreadequil (int docuseed) { printf("BEQ>%4d<1>", docuseed); @@ -21,6 +22,7 @@ static void testreadequil (int docuseed) printf(" <2>"); outbehavstrat(2, realplan[2], 1); } +#endif /* UNUSED */ void leavesfrominput (void) { @@ -104,7 +106,7 @@ void outleavesreached (int docuseed) if ( reachprob.num ) /* nonzero probability of reaching leaf */ { rattoa(reachprob, s); - printf(" %d~%s", o - outcomes, s) ; + printf(" %ld~%s", o - outcomes, s) ; } } printf("\n") ; diff --git a/main.c b/main.c index b28b688..d308b3d 100644 --- a/main.c +++ b/main.c @@ -118,13 +118,13 @@ int stopwatch(Bool bprint) void infotree() { int pl; - printf("\nGame tree has %d nodes, ", lastnode - root); - printf("of which %d are terminal nodes.\n", lastoutcome - outcomes); + printf("\nGame tree has %ld nodes, ", lastnode - root); + printf("of which %ld are terminal nodes.\n", lastoutcome - outcomes); for (pl = 0; pl < PLAYERS; pl++) { printf(" Player %d has ", pl); - printf("%3d information sets, ", firstiset[pl+1] - firstiset[pl]); - printf("%3d moves in total\n", firstmove[pl+1] - firstmove[pl] - 1); + printf("%3ld information sets, ", firstiset[pl+1] - firstiset[pl]); + printf("%3ld moves in total\n", firstmove[pl+1] - firstmove[pl] - 1); } } @@ -324,7 +324,7 @@ int main(int argc, char *argv[]) int multipriors = 0; /* parameter for -M option */ int seed = 0; /* payoff seed for bintree (-s option) */ int newpayoffs = 0; /* number of payoffs to be replaced (-p)*/ - int *newp1, *newp2; /* arrays for entering new payoffs */ + int *newp1 = 0, *newp2 = 0; /* arrays for entering new payoffs */ /* whichform currently not used (later for RSF) */ int whichform = 0; /* 0: SF, 1: NF, 2: RSF */ diff --git a/mp.c b/mp.c index f344039..3d0d0ab 100644 --- a/mp.c +++ b/mp.c @@ -118,12 +118,12 @@ void prat(char name[],mp Nt,mp Dt) /*print the long precision rational Nt/Dt * long i; printf("%s",name); if (sign(Nt)==NEG) printf("-"); - printf("%u",Nt[length(Nt)-1]); + printf("%ld",Nt[length(Nt)-1]); for (i=length(Nt)-2;i>=1;i--) printf(FORMAT,Nt[i]); if( !(Dt[0]==2 && Dt[1]==1)) /* rational */ { printf("/"); if (sign(Dt)==NEG) printf("-"); - printf("%u",Dt[length(Dt)-1]); + printf("%ld",Dt[length(Dt)-1]); for (i=length(Dt)-2;i>=1;i--) printf(FORMAT,Dt[i]); } printf(" "); @@ -146,7 +146,7 @@ void pmp(char name[],mp a) /*print the long precision integer a*/ long i; printf("%s",name); if (sign(a)==NEG) printf("-"); - printf("%u",a[length(a)-1]); + printf("%ld",a[length(a)-1]); for (i=length(a)-2;i>=1;i--) printf(FORMAT,a[i]); } @@ -157,7 +157,7 @@ int mptoa(mp x, char s[]) int i, pos=0; if (sign(x)==NEG) pos = sprintf(s, "-"); -pos += sprintf(&s[pos], "%u", x[length(x)-1] ); +pos += sprintf(&s[pos], "%ld", x[length(x)-1] ); for (i=length(x)-2; i>=1; i--) pos += sprintf(&s[pos], FORMAT, x[i]); return pos; @@ -197,7 +197,7 @@ void gcd(mp u, mp v) bigu: if(zero(v)) return; - if ((i=length(u))father - nodes); - printf("is larger than node %d itself.\n", u - nodes); + printf("is larger than node %ld itself.\n", u - nodes); } /* update sequence triple, new only for move leading to u */ @@ -113,10 +113,10 @@ Bool genseqin(void) { isnotok = 1; /* need output routines for isets, moves, later */ - printf("imperfect recall in info set no. %d ", h-isets); + printf("imperfect recall in info set no. %ld ", h-isets); printf("named %s\n", h->name); - printf("different sequences no. %d,", seq-moves); - printf(" %d\n", h->seqin-moves); + printf("different sequences no. %ld,", seq-moves); + printf(" %ld\n", h->seqin-moves); } } /* end of "u decision node" */ } /* end of "for all nodes u" */ @@ -184,7 +184,7 @@ int movetoa (Move c, int pl, char *s) return sprintf(s, "*"); if (c == firstmove[pl]) return sprintf(s, "()"); - return sprintf(s, "%s%d", c->atiset->name, c - c->atiset->move0); + return sprintf(s, "%s%ld", c->atiset->name, c - c->atiset->move0); } /* end of int movetoa (c, pl, *s) */ int seqtoa (Move seq, int pl, char *s) diff --git a/treegen.c b/treegen.c index 3155305..9f71700 100644 --- a/treegen.c +++ b/treegen.c @@ -116,7 +116,7 @@ void createbintree (int levels, int seed) } /* consistency check */ if (currout != lastoutcome) - printf("wrong number %d of outcomes!!!\n", currout-outcomes ); + printf("wrong number %ld of outcomes!!!\n", currout-outcomes ); } /* end of createbintree(levels, seed) */