From dc9e16a4e1c14aa3cc21b4df40528f5074927925 Mon Sep 17 00:00:00 2001 From: iceman1001 Date: Sun, 4 Oct 2020 10:57:21 +0200 Subject: [PATCH] add some defines to get double --- client/deps/cliparser/cliparser.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/client/deps/cliparser/cliparser.h b/client/deps/cliparser/cliparser.h index 51c2ed8d5..90b74f774 100644 --- a/client/deps/cliparser/cliparser.h +++ b/client/deps/cliparser/cliparser.h @@ -19,9 +19,15 @@ #define arg_getsize(a) (sizeof(a) / sizeof(a[0])) #define arg_get_lit(ctx, n) (((struct arg_lit*)((ctx)->argtable)[n])->count) + #define arg_get_int_count(ctx, n)(((struct arg_int*)((ctx)->argtable)[n])->count) #define arg_get_int(ctx, n) (((struct arg_int*)((ctx)->argtable)[n])->ival[0]) #define arg_get_int_def(ctx, n, def)(arg_get_int_count((ctx), n) ? (arg_get_int((ctx), n)) : (def)) + +#define arg_get_dbl_count(ctx, n)(((struct arg_dbl*)((ctx)->argtable)[n])->count) +#define arg_get_dbl(ctx, n) (((struct arg_dbl*)((ctx)->argtable)[n])->dval[0]) +#define arg_get_dbl_def(ctx, n, def)(arg_get_dbl_count((ctx), n) ? (arg_get_dbl((ctx), n)) : (def)) + #define arg_get_str(ctx, n) ((struct arg_str*)((ctx)->argtable)[n]) #define arg_get_str_len(ctx, n) (strlen(((struct arg_str*)((ctx)->argtable)[n])->sval[0]))