From 440c0070df3e0d5afedcda5b7ea40b728a0501c4 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Tue, 16 Jun 2009 18:52:29 +0000 Subject: Don't kludge locale around queries. git-svn-id: http://svn.drobilla.net/lad/trunk/slv2@2116 a436a847-0d15-0410-975c-d299462d15a1 --- src/value.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'src/value.c') 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"); -- cgit v1.2.1