aboutsummaryrefslogtreecommitdiff
path: root/src/stdlib/cli.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/stdlib/cli.c')
-rw-r--r--src/stdlib/cli.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/stdlib/cli.c b/src/stdlib/cli.c
index 22ed9b94..8301a2c2 100644
--- a/src/stdlib/cli.c
+++ b/src/stdlib/cli.c
@@ -17,7 +17,7 @@
#include "cli.h"
#include "integers.h"
#include "metamethods.h"
-#include "nums.h"
+#include "floats.h"
#include "optionals.h"
#include "paths.h"
#include "print.h"
@@ -209,8 +209,8 @@ static List_t parse_arg_list(List_t args, const char *flag, void *dest, const Ty
if (type->tag == OptionalInfo) {
const TypeInfo_t *nonnull = type->OptionalInfo.type;
if (streq(arg, "none")) {
- if (nonnull == &Num$info) *(double *)dest = (double)NAN;
- else if (nonnull == &Num32$info) *(float *)dest = (float)NAN;
+ if (nonnull == &Float64$info) *(double *)dest = (double)NAN;
+ else if (nonnull == &Float32$info) *(float *)dest = (float)NAN;
else memset(dest, 0, (size_t)type->size);
return List$from(args, I(2));
} else {
@@ -258,14 +258,14 @@ static List_t parse_arg_list(List_t args, const char *flag, void *dest, const Ty
OptionalBool_t parsed = Bool$parse(Text$from_str(arg), NULL);
if (parsed == NONE_BOOL) print_err("Could not parse argument for ", flag, ": ", arg);
*(Bool_t *)dest = parsed;
- } else if (type == &Num$info) {
- OptionalNum_t parsed = Num$parse(Text$from_str(arg), NULL);
+ } else if (type == &Float64$info) {
+ OptionalFloat64_t parsed = Float64$parse(Text$from_str(arg), NULL);
if (isnan(parsed)) print_err("Could not parse argument for ", flag, ": ", arg);
- *(Num_t *)dest = parsed;
- } else if (type == &Num32$info) {
- OptionalNum32_t parsed = Num32$parse(Text$from_str(arg), NULL);
+ *(Float64_t *)dest = parsed;
+ } else if (type == &Float32$info) {
+ OptionalFloat32_t parsed = Float32$parse(Text$from_str(arg), NULL);
if (isnan(parsed)) print_err("Could not parse argument for ", flag, ": ", arg);
- *(Num32_t *)dest = parsed;
+ *(Float32_t *)dest = parsed;
} else if (type->tag == PointerInfo) {
// For pointers, we can just allocate memory for the value and then parse the value
void *value = GC_MALLOC((size_t)type->PointerInfo.pointed->size);