Windows and xslt dll

Lubomir I. Ivanov neolit123 at gmail.com
Wed Mar 6 08:47:07 PST 2013


On 6 March 2013 17:20, Linus Torvalds <torvalds at linux-foundation.org> wrote:
> On Wed, Mar 6, 2013 at 5:43 AM, Lubomir I. Ivanov <neolit123 at gmail.com> wrote:
>>
>> but since the cylinder volume is stored in milliliters, it would be
>> probably better to parse using:
>>
>> sscanf(buf, "%d.%d", &integral, &fraction)
>> cyl.size.mliter = (integral * 1000) +  fraction.
>
> This is a bad idea, unless you have a very strong reason to believe
> that the fractions are *always* shown with three digits.
>

i guess a %4d for the fraction formatting and then a possible RTN
leaving only 3 digits.
it still discards digits from the fraction thought.

> It's probably a better idea to just do
>
>     setlocale(LC_NUMERIC,"C");
>     ...
>     setlocale(LC_NUMERIC, "");
>
> around the xslt parsing.
>
> Maybe we should do it around the whole loading and saving thing too,
> so that we don't get bitten by this again by mistake...
>

not sure how thread safe that would be.
i guess it can be tested.

lubomir
--


More information about the subsurface mailing list