From: H.G. Muller Date: Sun, 12 Feb 2012 21:47:44 +0000 (+0100) Subject: Fix some spurious output X-Git-Tag: v2.0~46 X-Git-Url: http://winboard.nl/cgi-bin?p=uci2wb.git;a=commitdiff_plain;h=b7c746a0f37859a73d49a9cdb03cf3b32ce1391e;hp=dc007e1364c2beb3023e8ec4535b67b1dece028f Fix some spurious output Not all debug prints towards the GUI were controlled through the "UCI2WB debug output" option. This is now repaired. The method for matching an info string is made a bit more efficient, by only looking at the beginning. --- diff --git a/UCI2WB.c b/UCI2WB.c index 10f4dd6..53b2f19 100644 --- a/UCI2WB.c +++ b/UCI2WB.c @@ -82,13 +82,13 @@ StartSearch(char *ponder) int nr = moveNr + (ponder[0] != 0); // we ponder for one move ahead! fprintf(toE, "\ngo btime %d wtime %d", stm == BLACK ^ sc=='s' ? myTime : hisTime, stm == WHITE ^ sc=='s' ? myTime : hisTime); DPRINT( "\n# go btime %d wtime %d", stm == BLACK ^ sc=='s' ? myTime : hisTime, stm == WHITE ^ sc=='s' ? myTime : hisTime); - if(sTime > 0) fprintf(toE, " movetime %d", sTime),printf(" movetime %d", sTime); else - if(mps) fprintf(toE, " movestogo %d", mps*(nr/(2*mps)+1)-nr/2),printf(" movestogo %d", mps*(nr/(2*mps)+1)-nr/2); - if(inc && !suffix) fprintf(toE, " winc %d binc %d", inc, inc),printf(" winc %d binc %d", inc, inc); - if(depth > 0) fprintf(toE, " depth %d", depth),printf(" depth %d", depth); - if(suffix) fprintf(toE, suffix, inc),printf(suffix, inc); + if(sTime > 0) { fprintf(toE, " movetime %d", sTime); DPRINT(" movetime %d", sTime); } else + if(mps) { fprintf(toE, " movestogo %d", mps*(nr/(2*mps)+1)-nr/2); DPRINT(" movestogo %d", mps*(nr/(2*mps)+1)-nr/2); } + if(inc && !suffix) { fprintf(toE, " winc %d binc %d", inc, inc); DPRINT(" winc %d binc %d", inc, inc); } + if(depth > 0) { fprintf(toE, " depth %d", depth); DPRINT(" depth %d", depth); } + if(suffix) { fprintf(toE, suffix, inc); DPRINT(suffix, inc); } fprintf(toE, "%s\n", ponder); - printf("%s\n", ponder); + DPRINT("%s\n", ponder); } void @@ -106,7 +106,7 @@ LoadPos(int moveNr) int j; fprintf(toE, "%s moves", iniPos); DPRINT( "# %s moves", iniPos); - for(j=0; j0 ? 100000 : -100000, statScore = s; else