From 3d7feff71bb8b5878c497ddd46d3d6998fd006c8 Mon Sep 17 00:00:00 2001 From: Markus Uhlin Date: Mon, 1 Apr 2024 19:32:56 +0200 Subject: Reformatted set_promote() --- FICS/variable.c | 56 ++++++++++++++++++++++++++++++-------------------------- 1 file changed, 30 insertions(+), 26 deletions(-) (limited to 'FICS') diff --git a/FICS/variable.c b/FICS/variable.c index 0d28752..f00079b 100644 --- a/FICS/variable.c +++ b/FICS/variable.c @@ -439,33 +439,37 @@ PRIVATE int set_language (int p, char *var, char *val) return VAR_OK; } -PRIVATE int set_promote(int p, char *var, char *val) +PRIVATE int +set_promote(int p, char *var, char *val) { - if (!val) - return VAR_BADVAL; - stolower(val); - switch (val[0]) { - case 'q': - parray[p].promote = QUEEN; - pprintf(p, "Promotion piece set to QUEEN.\n"); - break; - case 'r': - parray[p].promote = ROOK; - pprintf(p, "Promotion piece set to ROOK.\n"); - break; - case 'b': - parray[p].promote = BISHOP; - pprintf(p, "Promotion piece set to BISHOP.\n"); - break; - case 'n': - case 'k': - parray[p].promote = KNIGHT; - pprintf(p, "Promotion piece set to KNIGHT.\n"); - break; - default: - return VAR_BADVAL; - } - return VAR_OK; + if (!val) + return VAR_BADVAL; + + stolower(val); + + switch (val[0]) { + case 'q': + parray[p].promote = QUEEN; + pprintf(p, "Promotion piece set to QUEEN.\n"); + break; + case 'r': + parray[p].promote = ROOK; + pprintf(p, "Promotion piece set to ROOK.\n"); + break; + case 'b': + parray[p].promote = BISHOP; + pprintf(p, "Promotion piece set to BISHOP.\n"); + break; + case 'n': + case 'k': + parray[p].promote = KNIGHT; + pprintf(p, "Promotion piece set to KNIGHT.\n"); + break; + default: + return VAR_BADVAL; + } + + return VAR_OK; } PRIVATE int -- cgit v1.2.3