Accidentally clicked on Reply in place of Reply to All. My bad.
On Dec 14, 2007 12:39 AM, Pedro Alves <[EMAIL PROTECTED]> wrote:
> Ivan Vucica wrote:
>
> > In that sad case, I'll leave the code as it is.
> >
>
> Now that's silly. You've been told the compiler is not
> at fault here.
Which I accept ;)
> Why don't you just do something like:
>
> uint8_t* buffer = (uint8_t*)msg.getBuffer();
>
> int read_post = 0;
> while (read_pos < messageLength) {
> uint32_t v0 = read32(buffer);
> uint32_t v1 = read32(buffer + 4);
>
> (...)
>
> write32(buffer, v0);
> write32(buffer + 4, v1);
> read_pos += 8;
> }
>
> ... and write read32/write32 as macros or inline functions that
> just copy and just a few bytes:
>
> uin32_t read32(uint8_t*);
> void write32(uint8_t*, uin32_t);
Woah! Amazement! Disbelief! Someone who's not in the OpenTibia
community actually looked at our code! Yay :)
The advice is great, thanks! I'll look at it soon, and for the time
being, I'll leave a FIXME and a copy of your text in the code, for
other devs to read.
> Could you at least remove the comment
> mentioning the (non-existing) compiler bug ?
Hum, yes, no problem, I'll commit a correction right away :)
(I'll mention an "ARM architectural difference" until I implement your advice)
> --
> Pedro Alves
I guess you "saved our code" from my stupidity, or something like that :)
(My stupidity only since I'm the only one with a WinCE device)
--
Ivan Vučica
-- Croatia --
-------------------------------------------------------------------------
SF.Net email is sponsored by:
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services
for just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
_______________________________________________
Cegcc-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/cegcc-devel