summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorMichael Smith <mikesmiffy128@gmail.com>2023-04-28 23:26:03 +0100
committerMichael Smith <mikesmiffy128@gmail.com>2023-04-28 23:26:03 +0100
commit700e2f8b235bb344c2a59947c7157d34a651d75d (patch)
treec735bcdf4e1855fcfa6a535754910c6231d5a386
parent5c62ab15b29466f7f294b754685366655aa603ff (diff)
Fix default float values for cvars
This has been a known issue for a long time. Let's finally fix it!
-rw-r--r--src/con_.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/con_.h b/src/con_.h
index a43294c..793df91 100644
--- a/src/con_.h
+++ b/src/con_.h
@@ -240,15 +240,15 @@ extern void *_con_vtab_iconvar[];
.vtable_iconvar = _con_vtab_iconvar, \
.parent = &_cvar_##name_, /* bizarre, but how the engine does it */ \
.defaultval = _Generic(value, char *: value, int: #value, \
- float: #value), \
+ double: #value), \
/* N.B. the NOLINT comment below isn't for you, the reader, it's for the
computer, because clangd decided the only way to turn off a bogus
warning is to write a bogus comment. Also note, this comment you're
reading now isn't very useful either, I'm just angry. */ \
.strlen = _Generic(value, char *: sizeof(value), /*NOLINT*/ \
default: sizeof(#value)), \
- .fval = _Generic(value, char *: 0, int: value, float: value), \
- .ival = _Generic(value, char *: 0, int: value, float: (int)value), \
+ .fval = _Generic(value, char *: 0, int: value, double: value), \
+ .ival = _Generic(value, char *: 0, int: value, double: (int)value), \
.hasmin = hasmin_, .minval = (min), .hasmax = hasmax_, .maxval = (max) \
}; \
struct con_var *name_ = &_cvar_##name_;