From cbbb37271bdfd5b51824f8b5a3ee5354236beff0 Mon Sep 17 00:00:00 2001 From: David Vazgenovich Shakaryan Date: Wed, 18 May 2022 15:45:21 -0700 Subject: web: remove active leg ptr; various cleanup --- web/web_opts.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'web/web_opts.c') diff --git a/web/web_opts.c b/web/web_opts.c index b459305..b593306 100644 --- a/web/web_opts.c +++ b/web/web_opts.c @@ -14,9 +14,9 @@ #define PREFIX "dartboat_" int delay_ms = 1000; -static int difficulty = 32; -struct { int diff; double stdev; } DIFF_PRESETS[] = { +static int difficulty = 32; +static struct { int diff; double stdev; } DIFF_PRESETS[] = { { 0, 66.80}, // 10 { 8, 40.24}, // 20 {16, 28.14}, // 30 @@ -33,12 +33,12 @@ struct { int diff; double stdev; } DIFF_PRESETS[] = { }; #define NUM_DIFF_PRESETS (sizeof(DIFF_PRESETS) / sizeof(*DIFF_PRESETS)) -void set_delay(char *val) +static void set_delay(char *val) { delay_ms = atoi(val); } -void set_stdev(int diff) +static void set_stdev(int diff) { if (diff < DIFF_PRESETS[0].diff) diff = DIFF_PRESETS[0].diff; @@ -55,7 +55,7 @@ void set_stdev(int diff) ((diff - DIFF_PRESETS[ind - 1].diff) * step); } -void set_difficulty(char *val) +static void set_difficulty(char *val) { int diff = atoi(val); difficulty = diff < 0 ? 0 : diff > 99 ? 99 : diff; @@ -63,7 +63,7 @@ void set_difficulty(char *val) set_stdev(difficulty); } -char *prefix_opt(char *opt) +static char *prefix_opt(char *opt) { char len = strlen(opt); char *s = malloc(len + sizeof(PREFIX)); @@ -73,7 +73,7 @@ char *prefix_opt(char *opt) return s; } -char *read_opt(char *opt) +static char *read_opt(char *opt) { char *s = prefix_opt(opt); char *val = (char *)EM_ASM_INT({return readOpt($0)}, s); @@ -81,7 +81,7 @@ char *read_opt(char *opt) return val; } -bool read_delay() +static bool read_delay() { char *val = read_opt("delay"); if (!val) return false; @@ -91,7 +91,7 @@ bool read_delay() return true; } -bool read_difficulty() +static bool read_difficulty() { char *val = read_opt("difficulty"); if (!val) return false; @@ -115,7 +115,7 @@ void opts_init() dom_set_value("#difficulty", buf); } -void store_opt(char *opt, char *val) +static void store_opt(char *opt, char *val) { char *s = prefix_opt(opt); EM_ASM({storeOpt($0, $1)}, s, val); -- cgit v1.2.3-70-g09d2