From: H.G.Muller Date: Sat, 8 Dec 2018 09:12:13 +0000 (+0100) Subject: Eliminate continues from GUI loop X-Git-Tag: v4.0~18 X-Git-Url: http://winboard.nl/cgi-bin?p=uci2wb.git;a=commitdiff_plain;h=4aeefd3c3c03994a5b477935cf4d8e6c73062a14;hp=b42dab5e4509f49d27d78747e16a151962a237e2 Eliminate continues from GUI loop The 'continue' statements at the end of the code sections for handling specific commands, which caused matching for the remaining commands after it to be skipped, are now deleted, and the code to be skipped is placed in an 'else' clause. This to make restructuring of the GUI loop easier. The 'continue' statements for 'easy' and 'hard' commands were left, as these were harmless: it doesn't matter whether we call LaunchSearch() after them or not. --- diff --git a/UCI2WB.c b/UCI2WB.c index c068847..d44de74 100644 --- a/UCI2WB.c +++ b/UCI2WB.c @@ -530,13 +530,13 @@ GUI2Engine() StopPonder(1); searching = 0; } strcpy(move[moveNr++], command); // possibly overwrites ponder move - continue; - } + } else if(!strcmp(command, "resume")) { searching = 0; if(suspended == 2) StartPonder(moveNr); // restart interrupted ponder search - suspended = 0; continue; // causes thinking to start in normal way if on move or analyzing - } + suspended = 0; // causes thinking to start in normal way if on move or analyzing + } else + { if(searching == 3) { // command arrived during thinking; order abort for 'instant commands' if(!strcmp(command, "?") || !strcmp(command, "quit") || !strcmp(command, "force") || !strcmp(command, "result")) { EPRINT((f, "# stop\n")); fflush(toE); } @@ -545,6 +545,7 @@ GUI2Engine() if(qStart == qEnd) qStart = qEnd = queue; p = line; while(qEnd < queue+10000 && (*qEnd++ = *p++) != '\n') {} if(DoCommand()) goto nomove; + } } }