diff options
Diffstat (limited to 'src/appconfig.c')
-rw-r--r-- | src/appconfig.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/appconfig.c b/src/appconfig.c index 40cade81..2424864b 100644 --- a/src/appconfig.c +++ b/src/appconfig.c @@ -110,8 +110,8 @@ static int appconfig_section_compare(void *a, void *b) { else return strcmp(((struct section *)a)->name, ((struct section *)b)->name); } -#define appconfig_index_add(root, cfg) (struct section *)avl_insert_lock(&root->index, (avl *)(cfg)) -#define appconfig_index_del(root, cfg) (struct section *)avl_remove_lock(&root->index, (avl *)(cfg)) +#define appconfig_index_add(root, cfg) (struct section *)avl_insert_lock(&(root)->index, (avl *)(cfg)) +#define appconfig_index_del(root, cfg) (struct section *)avl_remove_lock(&(root)->index, (avl *)(cfg)) static struct section *appconfig_index_find(struct config *root, const char *name, uint32_t hash) { struct section tmp; @@ -297,10 +297,10 @@ long long appconfig_get_number(struct config *root, const char *section, const c return strtoll(s, NULL, 0); } -long double appconfig_get_float(struct config *root, const char *section, const char *name, long double value) +LONG_DOUBLE appconfig_get_float(struct config *root, const char *section, const char *name, LONG_DOUBLE value) { char buffer[100], *s; - sprintf(buffer, "%0.5Lf", value); + sprintf(buffer, "%0.5" LONG_DOUBLE_MODIFIER, value); s = appconfig_get(root, section, name, buffer); if(!s) return value; @@ -407,10 +407,10 @@ long long appconfig_set_number(struct config *root, const char *section, const c return value; } -long double appconfig_set_float(struct config *root, const char *section, const char *name, long double value) +LONG_DOUBLE appconfig_set_float(struct config *root, const char *section, const char *name, LONG_DOUBLE value) { char buffer[100]; - sprintf(buffer, "%0.5Lf", value); + sprintf(buffer, "%0.5" LONG_DOUBLE_MODIFIER, value); appconfig_set(root, section, name, buffer); |