summaryrefslogtreecommitdiffstats
path: root/src/appconfig.c
diff options
context:
space:
mode:
authorFederico Ceratto <federico.ceratto@gmail.com>2018-03-27 21:28:21 +0000
committerFederico Ceratto <federico.ceratto@gmail.com>2018-03-27 21:28:21 +0000
commitd4dd00f58a502c9ca4b63e36ce6bc7a9945dc63c (patch)
treefaac99f51f182bb8c0a03e95e393d421ac9ddf42 /src/appconfig.c
parentNew upstream version 1.9.0+dfsg (diff)
downloadnetdata-d4dd00f58a502c9ca4b63e36ce6bc7a9945dc63c.tar.xz
netdata-d4dd00f58a502c9ca4b63e36ce6bc7a9945dc63c.zip
New upstream version 1.10.0+dfsgupstream/1.10.0+dfsg
Diffstat (limited to 'src/appconfig.c')
-rw-r--r--src/appconfig.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/appconfig.c b/src/appconfig.c
index 40cade818..2424864b5 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);