mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-10-14 02:27:39 -04:00
Fix compile warnings (set-but-not-used) on big endian targets
Change-Id: Ia433122d6c0af68a47d2f4a531a0787a9d3d9f72
This commit is contained in:
parent
4a3d046545
commit
ca326896d0
2 changed files with 21 additions and 17 deletions
|
@ -279,13 +279,15 @@ acceptable. Do NOT use for cryptographic purposes.
|
|||
uint32_t hashs( const void *key, size_t length, uint32_t initval)
|
||||
{
|
||||
uint32_t a,b,c; /* internal state */
|
||||
#if HASH_LITTLE_ENDIAN
|
||||
union { const void *ptr; size_t i; } u;/* needed for Mac Powerbook G4 */
|
||||
#endif
|
||||
|
||||
/* Set up the internal state */
|
||||
a = b = c = 0xdeadbeef + ((uint32_t)length) + initval;
|
||||
|
||||
u.ptr = key;
|
||||
#if HASH_LITTLE_ENDIAN
|
||||
u.ptr = key;
|
||||
if ((u.i & 0x3) == 0) {
|
||||
const uint32_t *k = (const uint32_t *)key; /* read 32-bit chunks */
|
||||
|
||||
|
@ -494,14 +496,16 @@ hashs2: return 2 32-bit hash values
|
|||
void hashs2(const void *key, size_t length, uint32_t *pc, uint32_t *pb)
|
||||
{
|
||||
uint32_t a, b, c; /* internal state */
|
||||
#if HASH_LITTLE_ENDIAN
|
||||
union { const void *ptr; size_t i; } u; /* needed for Mac Powerbook G4 */
|
||||
#endif
|
||||
|
||||
/* Set up the internal state */
|
||||
a = b = c = 0xdeadbeef + ((uint32_t)length) + *pc;
|
||||
c += *pb;
|
||||
|
||||
u.ptr = key;
|
||||
#if HASH_LITTLE_ENDIAN
|
||||
u.ptr = key;
|
||||
if (((u.i & 0x3) == 0)) {
|
||||
const uint32_t *k = (const uint32_t *)key; /* read 32-bit chunks */
|
||||
|
||||
|
|
|
@ -491,7 +491,6 @@ static int get_clip(long id, struct queue_entry *q)
|
|||
static bool load_index_table(int fd, const struct voicefile_header *hdr)
|
||||
{
|
||||
ssize_t ret;
|
||||
struct clip_entry *buf;
|
||||
|
||||
if (index_handle > 0) /* nothing to do? */
|
||||
return true;
|
||||
|
@ -505,14 +504,15 @@ static bool load_index_table(int fd, const struct voicefile_header *hdr)
|
|||
|
||||
if (ret == alloc_size)
|
||||
{
|
||||
#ifdef ROCKBOX_LITTLE_ENDIAN
|
||||
struct clip_entry *buf;
|
||||
buf = core_get_data(index_handle);
|
||||
for (int i = 0; i < hdr->id1_max + hdr->id2_max; i++)
|
||||
{
|
||||
#ifdef ROCKBOX_LITTLE_ENDIAN
|
||||
/* doesn't yield() */
|
||||
structec_convert(&buf[i], "ll", 1, true);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
}
|
||||
else
|
||||
index_handle = core_free(index_handle);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue