[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gnash-dev] Test failure on amd 64 and possible fix
From: |
blue |
Subject: |
[Gnash-dev] Test failure on amd 64 and possible fix |
Date: |
Sat, 31 Mar 2007 11:45:43 -0600 |
User-agent: |
Thunderbird 1.5.0.10 (X11/20070306) |
The number test was failing on my amd64 machine. This seems to fix the
test on
my amd64 ubuntu machine. Unsigned long on 64 bit machine is 8 bytes which is
contrary to the documentation about this byte swap.
Disclaimer, I haven't touched c++ for 10+ years, so this may not be optimal.
--bruce
Index: amf.cpp
===================================================================
RCS file: /sources/gnash/gnash/libamf/amf.cpp,v
retrieving revision 1.28
diff -r1.28 amf.cpp
126c126
< unsigned long l;
---
> uint32_t l;
143,145c143,145
< l = *(unsigned long *)x;
< *(unsigned long *)x = *((unsigned long *)x + 1);
< *((unsigned long *)x + 1) = l;
---
> l = *(uint32_t *)x;
> *(uint32_t *)x = *((uint32_t *)x + 1);
> *((uint32_t *)x + 1) = l;
147c147
< swapBytes((char *)((unsigned long *)x+1), 4);
---
> swapBytes((char *)((uint32_t *)x+1), 4);