> Looks like a problem with the new def_max_anisotropy option. It's the
> first floating-point option. I don't understand why this is happening,
> though. It works just fine in the radeon driver and the definitions of
> __driConfigOptions are identical in both drivers (see r200_screen.c).
>
> Also, you should see the same problem with any OpenGL app. If this is
> application-specific then it's really mysterious.
>
> Can you send the output of "xdriinfo options r200"?

I have just experienced the same problem. The problem is that character
which strtod recognise as decimal point depends on current locale.

And in xmlconfig.c there is this part of code:
      case DRI_FLOAT:
        v->_float = strtod (string, (char **)&tail);
        break;
And if the locale is set (which could be done by application or library
like Xt), the parser will fail.

Because of that I think that this code shouldn't depend on strtod(). The
GNU extensions that allow to select locale in strtod call are non-standard.
I think that best approach would be to have internal strtod do the conversion.
Here is small trivial patch that do it.

Sincerely

Pavel Palát

P.S.: This is my first post and patch here, so sorry for any inconvenience
;-)

 --
Pavel "harry_x" Palát
    [EMAIL PROTECTED]
    irc: #mistral.cz on IRCnet

    The only way of finding the limits to the possible is by going beyond them to the 
impossible
                                                  Arthur C. Clark
--- src/mesa/drivers/dri/common/xmlconfig.c     12 Dec 2003 16:38:57 -0000      1.2
+++ src/mesa/drivers/dri/common/xmlconfig.c     7 Jan 2004 15:38:29 -0000
@@ -137,6 +137,29 @@
        return count;
 }
 
+double __strtod(const char *s, char **tail) {
+        int radix=strlen(s);
+        int x,neg=0;
+        double res=0.0;
+        
+        for (x=0; x < strlen(s); x++)
+                if (s[x]>='0' && s[x]<='9') {
+                        res*=10.0;
+                        res+=s[x]-'0';
+                } else if (s[x]=='.')
+                        radix=x;
+                else if (s[x]=='-')
+                       neg=1;
+               else
+                        break;
+       for (radix++;radix < x; radix++)
+               res/=10.0;
+       if (neg)
+               res*=-1.0;
+        *tail=(char *)&s[x];
+        return res;
+}
+
 /** \brief Parse a value of a given type. */
 static GLboolean parseValue (driOptionValue *v, driOptionType type,
                             const XML_Char *string) {
@@ -160,7 +183,7 @@
        v->_int = strtol (string, (char **)&tail, 0);
        break;
       case DRI_FLOAT:
-       v->_float = strtod (string, (char **)&tail);
+       v->_float = __strtod (string, (char **)&tail);
        break;
     }
 

Reply via email to