summaryrefslogtreecommitdiffstats
path: root/src/value.c
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2009-06-16 18:52:29 +0000
committerDavid Robillard <d@drobilla.net>2009-06-16 18:52:29 +0000
commit440c0070df3e0d5afedcda5b7ea40b728a0501c4 (patch)
treedd93808b7f5307f32e57e58367fcc0b41480d3a7 /src/value.c
parent762819dcfde67013d8c9ee1f752272abbaf3d82d (diff)
downloadlilv-440c0070df3e0d5afedcda5b7ea40b728a0501c4.tar.gz
lilv-440c0070df3e0d5afedcda5b7ea40b728a0501c4.tar.bz2
lilv-440c0070df3e0d5afedcda5b7ea40b728a0501c4.zip
Don't kludge locale around queries.
git-svn-id: http://svn.drobilla.net/lad/trunk/slv2@2116 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/value.c')
-rw-r--r--src/value.c10
1 files changed, 6 insertions, 4 deletions
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");