[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

gEDA-dev: [Patch] Gerbx: Use LC_NUMERIC for drill.c too( was: Gerbvans strtod)



Hallo,

appended patch defined LC_NUMERIC also for gerbv.c.

This makes the warnings 
> Tool is wrong size: 0
> Warning: Tool 01 used without being defined

go away.

Bye
-- 
Uwe Bonnes                bon@elektron.ikp.physik.tu-darmstadt.de

Institut fuer Kernphysik  Schlossgartenstrasse 9  64289 Darmstadt
--------- Tel. 06151 162516 -------- Fax. 06151 164321 ----------
--- gerbv-1.0.2.orig/src/drill.c	2006-07-25 23:47:59.000000000 +0200
+++ gerbv-1.0.2/src/drill.c	2007-05-16 19:53:02.000000000 +0200
@@ -39,7 +39,7 @@
 #ifdef HAVE_UNISTD_H
 #include <unistd.h>
 #endif
-
+#include <locale.h> 
 
 #include "drill.h"
 #include "gerb_error.h"
@@ -106,6 +106,14 @@
     int read;
     double x_scale = 1, y_scale = 1;
 
+    /*
+     * many locales redefine "." as "," and so on,
+     * so sscanf and strtod has problems when
+     * reading files using %f format    
+     * Observed by t.motylewski at bfad dot de
+     */
+    setlocale(LC_NUMERIC, "C" );
+ 
     state = new_state(state);
     if (state == NULL)
 	GERB_FATAL_ERROR("malloc state failed\n");


_______________________________________________
geda-dev mailing list
geda-dev@moria.seul.org
http://www.seul.org/cgi-bin/mailman/listinfo/geda-dev