summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/query.c9
-rw-r--r--src/scalepoint.c1
-rw-r--r--src/value.c10
3 files changed, 6 insertions, 14 deletions
diff --git a/src/query.c b/src/query.c
index ee709cb..34cb260 100644
--- a/src/query.c
+++ b/src/query.c
@@ -145,17 +145,8 @@ slv2_plugin_query_sparql(SLV2Plugin plugin,
return NULL;
}
- // Reset numeric locale to correctly interpret turtle numeric constants
- char* locale = strdup(setlocale(LC_NUMERIC, NULL));
- setlocale(LC_NUMERIC, "POSIX");
-
librdf_query_results* results = librdf_query_execute(query, plugin->rdf);
- // Restore numeric locale
- setlocale(LC_NUMERIC, locale);
-
- free(locale);
-
librdf_free_query(query);
free(query_str);
diff --git a/src/scalepoint.c b/src/scalepoint.c
index 769ed1f..3fdbd4f 100644
--- a/src/scalepoint.c
+++ b/src/scalepoint.c
@@ -21,7 +21,6 @@
#include <stdlib.h>
#include <string.h>
#include <assert.h>
-#include <locale.h>
#include <raptor.h>
#include "slv2/types.h"
#include "slv2/value.h"
diff --git a/src/value.c b/src/value.c
index 3ef7542..9c5b202 100644
--- a/src/value.c
+++ b/src/value.c
@@ -32,7 +32,7 @@
static void
slv2_value_set_numerics_from_string(SLV2Value val)
{
- // FIXME: locale kludges to work around librdf bug
+ // FIXME: locale kludge, need a locale independent strtol and strtod
char* locale = strdup(setlocale(LC_NUMERIC, NULL));
if (val->type == SLV2_VALUE_INT) {
@@ -227,9 +227,7 @@ slv2_value_get_turtle_token(SLV2Value value)
{
size_t len = 0;
char* result = NULL;
- char* locale = strdup(setlocale(LC_NUMERIC, NULL));
-
- // FIXME: locale kludges to work around librdf bug
+ char* locale = NULL;
switch (value->type) {
case SLV2_VALUE_URI:
@@ -243,6 +241,8 @@ slv2_value_get_turtle_token(SLV2Value value)
break;
case SLV2_VALUE_INT:
// INT64_MAX is 9223372036854775807 (19 digits) + 1 for sign
+ // FIXME: locale kludge, need a locale independent snprintf
+ locale = strdup(setlocale(LC_NUMERIC, NULL));
len = 20;
result = calloc(len, sizeof(char));
setlocale(LC_NUMERIC, "POSIX");
@@ -250,6 +250,8 @@ slv2_value_get_turtle_token(SLV2Value value)
setlocale(LC_NUMERIC, locale);
break;
case SLV2_VALUE_FLOAT:
+ // FIXME: locale kludge, need a locale independent snprintf
+ locale = strdup(setlocale(LC_NUMERIC, NULL));
len = 20; // FIXME: proper maximum value?
result = calloc(len, sizeof(char));
setlocale(LC_NUMERIC, "POSIX");