[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Chicken-users] Re: Problem w/ Utf8 egg: couldn't load case-map-1.da
From: |
Alex Shinn |
Subject: |
Re: [Chicken-users] Re: Problem w/ Utf8 egg: couldn't load case-map-1.dat |
Date: |
Thu, 15 Sep 2005 20:36:00 -0500 |
User-agent: |
Wanderlust/2.10.1 (Watching The Wheels) SEMI/1.14.6 (Maruoka) FLIM/1.14.6 (Marutamachi) APEL/10.6 Emacs/21.3 (i386-pc-linux-gnu) MULE/5.0 (SAKAKI) |
At Wed, 7 Sep 2005 10:06:51 -0700, Kon Lovett wrote:
>
> The exception is raised in (read-block! ...): (u32vector-set! vec i
> (read-binary-uint32 port))
> (read-binary-uint32 ...) is returning a negative #, (u32vector-set!
> ...) only accepts positive #
The bug is in arithmetic-shift on 32-bit platforms:
(arithmetic-shift 181 24)
=> -1258291200.0
On my x86-64 machine it gives the correct answer:
(arithmetic-shift 181 24)
=> 3036676096
It seems if both arguments are fixnums and the second is positive,
arithmetic-shift translates to C_fixnum_shift_left, which is
#define C_fixnum_shift_left(n1, n2) (C_fix(C_unfix(n1) << C_unfix(n2)))
This causes the overflow into negative.
----
Note the case-map library was originally written for Gauche, and it's
a headache for me to maintain it under two separate platforms. I'm
considering leaving it out of the next utf8 egg and moving it to the
common-scheme network. Is anyone else currently using Chicken's
utf8 case-map or char-set?
I'm also considering breaking the utf8 module into 3 modules:
utf8
utf8-srfi-13
utf8-srfi-14
which will speed compile and load times (it's a pretty huge module).
This is also because I plan to write a string-cursor based alternative
to srfi-13 - string indexes are not a good way to work with utf8
strings. Does anyone have any thoughts on this?
--
Alex