From b5a9b4cb4863e2af220ff50f51b68c0035caa927 Mon Sep 17 00:00:00 2001 From: Markus Uhlin Date: Tue, 26 Dec 2023 16:22:52 +0100 Subject: Reformatted GameMatchesFormula() --- FICS/formula.c | 47 +++++++++++++++++++++++++++-------------------- 1 file changed, 27 insertions(+), 20 deletions(-) diff --git a/FICS/formula.c b/FICS/formula.c index 77cf89f..447caba 100644 --- a/FICS/formula.c +++ b/FICS/formula.c @@ -514,27 +514,34 @@ void ExplainFormula (game *g, textlist *eval) } #endif -/* GameMatchesFormula converts parameters to a game structure - and passes a pointer to this game to CheckFormula for - evaluation. It returns the evaluated formula. -*/ -PUBLIC int GameMatchesFormula (int w, int b, int wTime, int wInc, int bTime, - int bInc, int rated, int gametype, textlist **clauseList) +/* + * GameMatchesFormula() converts parameters to a game structure and + * passes a pointer to this game to CheckFormula() for evaluation. It + * returns the evaluated formula. + */ +PUBLIC int +GameMatchesFormula(int w, int b, int wTime, int wInc, int bTime, int bInc, + int rated, int gametype, textlist **clauseList) { - game g; - int index=0, ret; - - g.white = w; g.black = b; - g.wInitTime = wTime; g.bInitTime = bTime; - g.wIncrement = wInc; g.bIncrement = bInc; - g.rated = rated; - g.type = gametype; - - if (CheckFormula(&g, MAX_FORMULA, &index, OPTYPE_NONE, &ret, 1) != ERR_NONE) - return (0); - if (ret == 0) ExplainFormula (&g, clauseList); - return (ret); -} /* end of function GameMatchesFormula. */ + game g; + int index = 0, ret; + + g.white = w; + g.black = b; + g.wInitTime = wTime; + g.bInitTime = bTime; + g.wIncrement = wInc; + g.bIncrement = bInc; + g.rated = rated; + g.type = gametype; + + if (CheckFormula(&g, MAX_FORMULA, &index, OPTYPE_NONE, &ret, 1) != + ERR_NONE) + return 0; + if (ret == 0) + ExplainFormula (&g, clauseList); + return ret; +} /* * SetValidFormula() sets a clause of player 'p' and creates a game -- cgit v1.2.3