wesnoth-dev
[Top][All Lists]
Advanced

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

[Wesnoth-dev] locale-independant number parsing


From: Yann Dirson
Subject: [Wesnoth-dev] locale-independant number parsing
Date: Mon, 7 Feb 2005 21:23:36 +0100
User-agent: Mutt/1.5.6+20040907i

Looking around a bit, I found that glibc provides a set of functions
to specify in which language we want the number to be parsed.

So instead of using atof() we can use strtof_l() if available.

No objection to check for the availability of this function, and only
if not, then revert to the setlocale()-based workaround ?

Was there any specific reason to use atoxx() rather than strtoxx(),
appart for them to be more concise ?  I note that there are indeed a
couple of calls to strtoul(), so I guess it is not a portability
issue.  Consistently using strto*_l(), #defined to their standard
strto*() counterparts when not available, would provide an easy way to
handle this.

What do you think ?

-- 
Yann Dirson    <address@hidden> |
Debian-related: <address@hidden> |   Support Debian GNU/Linux:
                                    |  Freedom, Power, Stability, Gratis
     http://ydirson.free.fr/        | Check <http://www.debian.org/>




reply via email to

[Prev in Thread] Current Thread [Next in Thread]