--- libs/iovm/source/IoNumber.c.orig 2008-04-26 15:56:13.000000000 +0100 +++ libs/iovm/source/IoNumber.c 2008-04-26 16:25:42.000000000 +0100 @@ -423,6 +423,20 @@ return string; } +static int countBytes(long ld) +{ + int n = 1; + for (;;) + { + ld >>= 8; + if (ld == 0) + { + return n; + } + n++; + } +} + IoObject *IoNumber_asCharacter(IoNumber *self, IoObject *locals, IoMessage *m) { /*doc Number asCharacter @@ -441,7 +455,7 @@ else { uint32_t i = io_uint32InBigEndian((uint32_t)d); - int bytes = d > 0 ? log2(d) / 8 : 1; + int bytes = countBytes(ld); IoSeq *s; if (bytes == 0) --- libs/iovm/source/IoState_exceptions.h.orig 2008-04-26 18:35:41.000000000 +0100 +++ libs/iovm/source/IoState_exceptions.h 2008-04-26 18:35:50.000000000 +0100 @@ -8,4 +8,4 @@ IOVM_API void IoState_error_(IoState *self, IoMessage *m, const char *format, ...); -IOVM_API IoObject *IoState_setErrorDescription_(IoState *self, const char *format, ...); \ No newline at end of file +IOVM_API IoObject *IoState_setErrorDescription_(IoState *self, const char *format, ...); --- build/Project.io.orig 2008-04-26 20:00:28.000000000 +0100 +++ build/Project.io 2008-04-26 20:00:53.000000000 +0100 @@ -74,7 +74,7 @@ if (platform == "windows", "-MD -Zi -DWIN32 -DNDEBUG -DIOBINDINGS -D_CRT_SECURE_NO_DEPRECATE" , - "-Os -g -Wall -DSANE_POPEN -DIOBINDINGS" + "-Os -g -Wall -pipe -fno-strict-aliasing -DSANE_POPEN -DIOBINDINGS" ) )