Micket
Member
Hello!
I've had some problems with libmodplug and i've found the bug that seems to be causing most problems with xm+many other formats.
This will write
3412
on my gp2x, and without const i get
5634
I find 3412 to be a rather strange result, as it's prior to the pointer.
What i'd like is the second result, even with const (i'd prefer not to hack at every other file at a bilion places to get libmodplug working)
( Compiled for my pc i get 5634 with and without const )
I.. well i simply dont know how to attack this problem at all, or why i ever get 3412 to start with.
I got some help on irc. Turns out i have to fix every unaligned read manually. Ack!
I've had some problems with libmodplug and i've found the bug that seems to be causing most problems with xm+many other formats.
Code:
#include <stdio.h>
int main() {
const char foo[] = {0x12, 0x34,0X56};
short bar = *((short*)(&foo[1]));
printf("%X\n",bar);
}
This will write
3412
on my gp2x, and without const i get
5634
I find 3412 to be a rather strange result, as it's prior to the pointer.
What i'd like is the second result, even with const (i'd prefer not to hack at every other file at a bilion places to get libmodplug working)
( Compiled for my pc i get 5634 with and without const )
I.. well i simply dont know how to attack this problem at all, or why i ever get 3412 to start with.
I got some help on irc. Turns out i have to fix every unaligned read manually. Ack!