forked from len0rd/rockbox
Use the correct swap functions for live conversion, and fix 64 bit sims.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@12302 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
4de600b46e
commit
19417db99a
1 changed files with 6 additions and 5 deletions
|
|
@ -18,6 +18,7 @@
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
#include <inttypes.h>
|
||||||
#include "structec.h"
|
#include "structec.h"
|
||||||
#include "system.h"
|
#include "system.h"
|
||||||
#include "file.h"
|
#include "file.h"
|
||||||
|
|
@ -66,17 +67,17 @@ void structec_convert(void *structure, const char *ecinst,
|
||||||
/* Swap 2 bytes. */
|
/* Swap 2 bytes. */
|
||||||
case 's':
|
case 's':
|
||||||
{
|
{
|
||||||
unsigned short *data = (unsigned short *)buf;
|
uint16_t *data = (uint16_t *)buf;
|
||||||
*data = SWAP_16(*data);
|
*data = swap16(*data);
|
||||||
buf += 2;
|
buf += 2;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Swap 4 bytes. */
|
/* Swap 4 bytes. */
|
||||||
case 'l':
|
case 'l':
|
||||||
{
|
{
|
||||||
unsigned long *data = (unsigned long *)buf;
|
uint32_t *data = (uint32_t *)buf;
|
||||||
*data = SWAP_32(*data);
|
*data = swap32(*data);
|
||||||
buf += 4;
|
buf += 4;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue