lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


> Amazing, that was my whole prob.  It started working once I put in
> source-code

I'm surprised that the files loaded ok with no complaints of header mismatch.
So, do the ARM and the PC have the same endianness?

Also, are you sure you want to use 8-byte doubles in the ARM? I seem to
recall that doubles are done in software in the ARM, but I may be mixing
it with the PSP or some other platform.

> Has anybody ever recompiled luac to support switching endian states?

Yes, search the archives, but it won't solve your problem because
the issue is that the doubles are stored in this order: 87561234, or
something like that, not 12345678 or 87654321.

Try this in lundump.c on the ARM side:

static lua_Number LoadNumber (LoadState* S)
{
 union { lua_Number x; int b[2]; } u;
 int t;
 LoadVarlock(S,u.x);
 t=u.b[0]; u.b[0]=u.b[1]; u.b[1]=t;
 return u.x;
}