From: <icu...@du...> - 2009-01-27 16:47:09
|
Hi all, Not sure if there's something wrong here or I'm doing something stupid! I've used genccode (on Linux and win32) to create a C file. Some of it looks like this: " const struct { double bogus; uint8_t bytes[9568]; } root_dat={ 0.0, { " When I call udata_setAppData passing in root_dat as the data pointer, I get U_INVALID_FORMAT_ERROR. I have tracked this down to udata_checkCommonData where udm->pHeader->dataHeader does not contain the correct magic numbers. Instead of the correct magic, there are zeros, because the first 8 bytes are the "bogus" double. This bogus double was added to genccode under ticket 157 (http://bugs.icu-project.org/trac/ticket/157) nine years ago, svn log thus: r416 | srl | 1999-12-15 05:14:03 +0000 (Wed, 15 Dec 1999) | 2 lines ticket:157: UDATA updates for Machines with Alignment Problems, and to align cnv/ucmp data. I'm guessing this can't be a problem because someone would have noticed in 9 years :) What am I doing wrong? Surely I don't have to add sizeof(double) to root_dat do I? Thanks in advance, Duncan |