Fix alignment issues in message sending/reading that would crash IRIX, thanks to Canavan for supplying a shell where I could fix this (#5077)

This commit is contained in:
Thilo Schulz 2011-07-17 01:41:39 +00:00
parent 4c5e9963e3
commit 242c938d7f
3 changed files with 51 additions and 18 deletions

View file

@ -129,6 +129,24 @@ float BigFloat (const float *l) {return _BigFloat(l);}
float LittleFloat (const float *l) {return _LittleFloat(l);}
*/
void CopyShortSwap(void *dest, void *src)
{
byte *to = dest, *from = src;
to[0] = from[1];
to[1] = from[0];
}
void CopyLongSwap(void *dest, void *src)
{
byte *to = dest, *from = src;
to[0] = from[3];
to[1] = from[2];
to[2] = from[1];
to[3] = from[0];
}
short ShortSwap (short l)
{
byte b1,b2;