[Scummvm-devel] Symbian: proper sscanf implementation

Adrian Astley adastley at gmail.com
Tue Sep 22 23:27:39 CEST 2015


I'll have to re-check the strings for the couple ZVision game localization
I have, but I don't believe it requires hex or exponents. I'll check this
week and get back to you guys.


Regards,
Adrian (RichieSams)

On Tue, Sep 22, 2015 at 3:39 PM, Федор <fedor_qd at mail.ru> wrote:

>  " - It does not respect the current locale and assumes"
> On Symbian only LC_ALL locale used in C-apps. Changind locale doesn't work
> by libc design. But dot and comma as decimal separator may used at same
> time. Add in todo list
>
> StrtoF - I want write strtoD. My mistake
>
> " - It does not support hexadecimal numbers.  - It does not support having
> an exponent (power of 10 for decimal numbers and power of 2 for hexadecimal
> numbers)."
> If Zvision requred - that will be added.
>
>
> Fedor Strizhnev
> Федор Стрижнёв.
>
> Аўторак, 22 верасня 2015, 20:23 +01:00 ад Thierry Crozat <
> criezy at scummvm.org>:
>
> Hi,
>
> I only had a quick look but your implementation of strtof__ does not
> behave in the expected way in several respects:
>   - It does not respect the current locale and assumes the decimal point
> separator is a dot. In some locale, for example in French (and I believe in
> Russian?) the decimal point separator would bd a coma. To be honest I find
> it a pain, but C function such as strtof and sscanf respect the current
> locale.
>   - It does not support hexadecimal numbers.
>   - It does not support having an exponent (power of 10 for decimal
> numbers and power of 2 for hexadecimal numbers).
>   - You don't handle the "nan", "inf" and "infinity" case either.
>
> So for example all the followings are not correctly parsed (not even
> considering the locale issue):
> -1.234e+12
> 0x12C4.0Fp-1B2
> NAN
> INF
>
> The locale, hexadecimal and nan/inf cases are maybe not an issue for
> ScummVM (?). Not supporting the exponent might be a bigger issue.
> But otherwise it looks like the code would work.
>
> Thierry
>
>
> On 22 Sep 2015, at 10:42, Федор <fedor_qd at mail.ru
> <https://e.mail.ru/compose/?mailto=mailto%3afedor_qd@mail.ru>> wrote:
>
> Hi! I need fresh eye on my code.
> Some times ago I found Symbian sscanf don't parses floating point numbers
> in strings.
> I'm using as start point sscanf implementation in tizen port. I try
> strtod() in libc and find it seems also broken.
> I write own strod() but it works bad.
> Error checking missing now.
> Fedor Strizhnev
> Федор Стрижнёв.
>
>
> <main.cpp>
> ------------------------------------------------------------------------------
> _______________________________________________
> Scummvm-devel mailing list
> Scummvm-devel at lists.sourceforge.net
> <https://e.mail.ru/compose/?mailto=mailto%3aScummvm%2ddevel@lists.sourceforge.net>
> https://lists.sourceforge.net/lists/listinfo/scummvm-devel
>
>
>
>
>
> ------------------------------------------------------------------------------
>
> _______________________________________________
> Scummvm-devel mailing list
> Scummvm-devel at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/scummvm-devel
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.scummvm.org/pipermail/scummvm-devel/attachments/20150922/69641878/attachment.html>


More information about the Scummvm-devel mailing list