mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2024-11-18 10:08:29 +01:00
Take endienness into account when converting dicts so can do from ARM
too.
This commit is contained in:
parent
ec19669d4f
commit
036856d9b0
1 changed files with 8 additions and 4 deletions
|
@ -448,7 +448,8 @@ convertOneDict( UInt16 cardNo, LocalID dbID )
|
|||
MemHandleResize( h, sizeof(*header) );
|
||||
}
|
||||
|
||||
tmp.flags = 0x0002;
|
||||
tmp.flags = XP_HTONS(0x0002);
|
||||
XP_ASSERT( sizeof(tmp.flags) == 2 );
|
||||
header = (dawg_header*)MemHandleLock(h);
|
||||
charTableRecNum = header->charTableRecNum;
|
||||
firstEdgeRecNum = header->firstEdgeRecNum;
|
||||
|
@ -465,13 +466,16 @@ convertOneDict( UInt16 cardNo, LocalID dbID )
|
|||
XP_ASSERT( err == errNone );
|
||||
|
||||
if ( err == errNone ) {
|
||||
XP_U16 buf[MAX_UNIQUE_TILES+1];
|
||||
XP_U8 buf[(MAX_UNIQUE_TILES+1)*2];
|
||||
XP_S16 i;
|
||||
XP_U8* ptr = (XP_U8*)MemHandleLock( h );
|
||||
|
||||
XP_MEMSET( buf, 0, sizeof(buf) );
|
||||
|
||||
for ( i = 0; i < nChars; ++i ) {
|
||||
buf[i] = ptr[i];
|
||||
buf[(i*2)+1] = ptr[i];
|
||||
}
|
||||
DmWrite( ptr, 0, buf, nChars * sizeof(buf[0]) );
|
||||
DmWrite( ptr, 0, buf, nChars * 2 );
|
||||
MemHandleUnlock(h);
|
||||
}
|
||||
err = DmReleaseRecord( ref, charTableRecNum, true );
|
||||
|
|
Loading…
Reference in a new issue