summaryrefslogtreecommitdiff
path: root/web/web_opts.c
diff options
context:
space:
mode:
authorDavid Vazgenovich Shakaryan <dvshakaryan@gmail.com>2022-05-18 15:45:21 -0700
committerDavid Vazgenovich Shakaryan <dvshakaryan@gmail.com>2022-05-18 15:45:21 -0700
commitcbbb37271bdfd5b51824f8b5a3ee5354236beff0 (patch)
treeb5514e2a9d104d36b4877c691a1d44e8ee762926 /web/web_opts.c
parent46d5c38b80b2e5f6b237ea0313ba23c408bdf7fe (diff)
downloaddartboat-cbbb37271bdfd5b51824f8b5a3ee5354236beff0.tar.gz
dartboat-cbbb37271bdfd5b51824f8b5a3ee5354236beff0.tar.xz
web: remove active leg ptr; various cleanup
Diffstat (limited to 'web/web_opts.c')
-rw-r--r--web/web_opts.c20
1 files changed, 10 insertions, 10 deletions
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);