From 9448cbd851e7d2557853e7b3c2c6fa7b9eccbd19 Mon Sep 17 00:00:00 2001 From: H.G. Muller Date: Mon, 11 Feb 2013 14:12:48 +0100 Subject: [PATCH] Fix some warnings --- fairymax.c | 29 +++++++++++++---------------- 1 files changed, 13 insertions(+), 16 deletions(-) diff --git a/fairymax.c b/fairymax.c index cbedcbd..47b9ca5 100644 --- a/fairymax.c +++ b/fairymax.c @@ -140,7 +140,7 @@ n[]=".*XKNBRQEWFMACHG?x+knbrqewfmachg"; /* piece symbols on printout*/ int pv[10000],*sp=pv; // triangular array int margin; -pboard() +void pboard() {int i; i=-1;W(++i<128)printf(" %c",(i&15)==BW&&(i+=15-BW)?10:n[b[i]&31]); } @@ -324,7 +324,7 @@ if(z&4*S)K=X,L=Y&~S; int PrintResult(int s) { - int i, j, k, cnt=0; + int j, k, cnt=0; /* search last 50 states with this stm for third repeat */ for(j=2; j<=100 && j <= HistPtr; j+=2) @@ -377,17 +377,15 @@ int PrintResult(int s) } -InitEngine() +void InitEngine() { - int i, j; - N=32*S+7;W(N-->S+3)T[N]=rand()>>9; srand(GetTickCount()); } -InitGame() +void InitGame() { - int i,j,k=0; + int i,k=0; Side = WHITE; Q=0; O=S; Fifty = 0; R = 0; @@ -413,7 +411,7 @@ InitGame() void CopyBoard(int s) { - int i, j, k, cnt=0; + int i, j; /* copy game representation of engine to HistoryBoard */ /* don't forget castling rights and e.p. state! */ @@ -424,7 +422,7 @@ void CopyBoard(int s) void PrintVariants(int combo) { - int i, j, count=0, total=0; char c=EOF+1, buf[80]; + int count=0, total=0; char c=EOF+1, buf[80]; FILE *f; f = fopen(INI_FILE, "r"); @@ -461,7 +459,7 @@ void PrintOptions() printf("feature done=1\n"); } -int LoadGame(char *name) +void LoadGame(char *name) { int i, j, ptc, count=0; char c, buf[80], pieceToChar[80]; static int currentVariant; @@ -531,11 +529,10 @@ int LoadGame(char *name) int main(int argc, char **argv) { - int Computer, MaxTime, MaxMoves, TimeInc, sec, i, j; - char line[256], command[256], c, cc; - int m, nr, hh; + int Computer, MaxTime, MaxMoves, TimeInc, sec, i; + char line[256], command[256], c; + int m, nr; double cpuT; - FILE *f; if(argc>1 && sscanf(argv[1], "%d", &m)==1) { U = (1<