diff options
-rw-r--r-- | src/module.c | 3 | ||||
-rw-r--r-- | tests/modules/misc.c | 4 |
2 files changed, 6 insertions, 1 deletions
diff --git a/src/module.c b/src/module.c index e78ac0c57..0ee38a5eb 100644 --- a/src/module.c +++ b/src/module.c @@ -1022,7 +1022,8 @@ RedisModuleString *RM_CreateStringFromLongLong(RedisModuleCtx *ctx, long long ll * RedisModule_CreateString() documentation for more info. */ RedisModuleString *RM_CreateStringFromLongDouble(RedisModuleCtx *ctx, long double ld, int humanfriendly) { char buf[MAX_LONG_DOUBLE_CHARS]; - size_t len = ld2string(buf,sizeof(buf),ld,humanfriendly); + size_t len = ld2string(buf,sizeof(buf),ld, + (humanfriendly ? LD_STR_HUMAN : LD_STR_AUTO)); return RM_CreateString(ctx,buf,len); } diff --git a/tests/modules/misc.c b/tests/modules/misc.c index 52a4c4d41..ba0710538 100644 --- a/tests/modules/misc.c +++ b/tests/modules/misc.c @@ -6,6 +6,8 @@ #include <unistd.h> #include <errno.h> +#define UNUSED(x) (void)(x) + int test_call_generic(RedisModuleCtx *ctx, RedisModuleString **argv, int argc) { if (argc<2) { @@ -41,6 +43,8 @@ int test_call_info(RedisModuleCtx *ctx, RedisModuleString **argv, int argc) } int test_ld_conv(RedisModuleCtx *ctx, RedisModuleString **argv, int argc) { + UNUSED(argv); + UNUSED(argc); long double ld = 0.00000000000000001L; const char *ldstr = "0.00000000000000001"; RedisModuleString *s1 = RedisModule_CreateStringFromLongDouble(ctx, ld, 1); |