|
From: Jose M. <ho...@us...> - 2005-06-24 22:02:23
|
Update of /cvsroot/ganc/ganc/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23731/src Modified Files: display.c main.c parser_stuff.c Log Message: main.c: Added fix so numbers always use locale "C", i.e. numbers use character '.' for decimal point regardless of current locale. In the future this should be a configurable option display.c: Eliminated a compile warning to do with a const variable Index: parser_stuff.c =================================================================== RCS file: /cvsroot/ganc/ganc/src/parser_stuff.c,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** parser_stuff.c 22 Jun 2005 22:52:42 -0000 1.20 --- parser_stuff.c 24 Jun 2005 22:02:12 -0000 1.21 *************** *** 116,120 **** break; } ! printf ("decimal_char: %c\n", decimal_char); } --- 116,120 ---- break; } ! //printf ("decimal_char: %c\n", decimal_char); } Index: display.c =================================================================== RCS file: /cvsroot/ganc/ganc/src/display.c,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** display.c 2 Dec 2004 20:29:54 -0000 1.7 --- display.c 24 Jun 2005 22:02:12 -0000 1.8 *************** *** 19,23 **** * ***********************************************************************/ ! static const char prompt[]="> "; static char *parse_errors[]={ // Texts of parse errors "unknown variable", // 1 --- 19,23 ---- * ***********************************************************************/ ! static char prompt[]="> "; static char *parse_errors[]={ // Texts of parse errors "unknown variable", // 1 Index: main.c =================================================================== RCS file: /cvsroot/ganc/ganc/src/main.c,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** main.c 22 Jun 2005 22:52:42 -0000 1.14 --- main.c 24 Jun 2005 22:02:12 -0000 1.15 *************** *** 6,9 **** --- 6,10 ---- #include <string.h> #include <stdio.h> + #include <locale.h> #include <sys/wait.h> *************** *** 176,182 **** --- 177,193 ---- #ifdef BUILD_GUI + + // In theory we need this function to stop gtk_init from setting locale + // In practice it doesn't do anything + //gtk_disable_setlocale (); // Start gnome and gtk stuff gnome_init (PACKAGE, VERSION, argc, argv); + + // set LC_NUMERIC category to use C locale, i.e. '.' for deciman numbers + // according to gtk manual this is bad practice (set it after gtk_init) + // but it seems to be the only way to get it to work + setlocale (LC_NUMERIC, "C"); + SetUpInterface (); GetDecimalPoint (); |