From b95943a47081125e0923098f2ebac1657b6d8a23 Mon Sep 17 00:00:00 2001 From: Markus Uhlin Date: Mon, 1 Apr 2024 21:47:01 +0200 Subject: Reformatted functions and deleted disabled code --- FICS/variable.c | 57 ++++++++++++++++++++++----------------------------------- 1 file changed, 22 insertions(+), 35 deletions(-) (limited to 'FICS') diff --git a/FICS/variable.c b/FICS/variable.c index 0eb82ca..547db76 100644 --- a/FICS/variable.c +++ b/FICS/variable.c @@ -311,47 +311,34 @@ PRIVATE int set_highlight(int p, char *var, char *val) return VAR_OK; } -PRIVATE int set_style(int p, char *var, char *val) +PRIVATE int +set_style(int p, char *var, char *val) { - int v = -1; + int v = -1; - if (!val) - return VAR_BADVAL; - if (sscanf(val, "%d", &v) != 1) - return VAR_BADVAL; - if ((v < 1) || (v > MAX_STYLES)) - return VAR_BADVAL; - parray[p].style = v - 1; - pprintf(p, "Style %d set.\n", v); - return VAR_OK; -} + if (!val) + return VAR_BADVAL; + if (sscanf(val, "%d", &v) != 1) + return VAR_BADVAL; + if (v < 1 || v > MAX_STYLES) + return VAR_BADVAL; -PRIVATE int set_flip(int p, char *var, char *val) -{ - if (set_boolean_var(&parray[p].flip, val) < 0) - return VAR_BADVAL; - if (parray[p].flip) - pprintf(p, "Flip on.\n"); - else - pprintf(p, "Flip off.\n"); - return VAR_OK; + parray[p].style = (v - 1); + pprintf(p, "Style %d set.\n", v); + return VAR_OK; } -/* -PRIVATE int set_uscf(int p, char *var, char *val) -{ - int v = -1; - if (!val) - return VAR_BADVAL; - if (sscanf(val, "%d", &v) != 1) - return VAR_BADVAL; - if ((v < 0) || (v > 3000)) - return VAR_BADVAL; - parray[p].uscfRating = v; - pprintf(p, "USCF Rating set to %d.\n", v); - return VAR_OK; +PRIVATE int +set_flip(int p, char *var, char *val) +{ + if (set_boolean_var(&parray[p].flip, val) < 0) + return VAR_BADVAL; + if (parray[p].flip) + pprintf(p, "Flip on.\n"); + else + pprintf(p, "Flip off.\n"); + return VAR_OK; } -*/ PRIVATE int set_time(int p, char *var, char *val) -- cgit v1.2.3