From a2396edde4f9746cfeb416ece9e20916de3216a4 Mon Sep 17 00:00:00 2001 From: Vincent Sanders Date: Thu, 29 Sep 2016 22:37:10 +0100 Subject: complete transition to locale independant core operation The netsurf core no longer uses any locale dependant operations excepting the mall number or cases where such operations are explicitly wanted. the netsurf_init now calls setlocale with the empty string and lets the c library setup as per its specific implementation. any core functionality that specificaly processes ascii text must use the utils/ascii.h header to do so. --- frontends/riscos/wimp.c | 12 ------------ 1 file changed, 12 deletions(-) (limited to 'frontends') diff --git a/frontends/riscos/wimp.c b/frontends/riscos/wimp.c index 2579c672e..abf099a55 100644 --- a/frontends/riscos/wimp.c +++ b/frontends/riscos/wimp.c @@ -360,12 +360,8 @@ void ro_gui_set_icon_integer(wimp_w w, wimp_i i, int value) { char buffer[20]; // Big enough for 64-bit int - setlocale(LC_NUMERIC, ""); - sprintf(buffer, "%d", value); - setlocale(LC_NUMERIC, "C"); - ro_gui_set_icon_string(w, i, buffer, true); } @@ -382,8 +378,6 @@ void ro_gui_set_icon_decimal(wimp_w w, wimp_i i, int value, int decimal_places) { char buffer[20]; // Big enough for 64-bit int - setlocale(LC_NUMERIC, ""); - switch (decimal_places) { case 0: sprintf(buffer, "%d", value); @@ -399,8 +393,6 @@ void ro_gui_set_icon_decimal(wimp_w w, wimp_i i, int value, int decimal_places) break; } - setlocale(LC_NUMERIC, "C"); - ro_gui_set_icon_string(w, i, buffer, true); } @@ -421,12 +413,8 @@ int ro_gui_get_icon_decimal(wimp_w w, wimp_i i, int decimal_places) for (; decimal_places > 0; decimal_places--) multiple *= 10; - setlocale(LC_NUMERIC, ""); - value = atof(ro_gui_get_icon_string(w, i)) * multiple; - setlocale(LC_NUMERIC, "C"); - return (int)value; } -- cgit v1.2.3