From 3354531614340b9a6b32cbf1b1d9b29a7c0b6513 Mon Sep 17 00:00:00 2001 From: Michael Sevakis Date: Tue, 20 Mar 2007 13:53:23 +0000 Subject: [PATCH] More logf fixes. speex.c wants to format 64bit args so I didn't change that one nor add any formatting for that. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@12858 a1c6a512-1295-4272-9138-f99709370657 --- apps/codecs/aac.c | 2 +- apps/tagcache.c | 6 ++-- firmware/pcm_record.c | 30 +++++++++---------- firmware/target/coldfire/i2c-coldfire.c | 8 ++--- firmware/target/coldfire/iaudio/x5/m5636-x5.c | 11 +++---- 5 files changed, 29 insertions(+), 28 deletions(-) diff --git a/apps/codecs/aac.c b/apps/codecs/aac.c index 7c64bc9a31..11a9d2888d 100644 --- a/apps/codecs/aac.c +++ b/apps/codecs/aac.c @@ -200,7 +200,7 @@ next_track: err = CODEC_OK; done: - LOGF("AAC: Decoded %d samples, %d frames\n", sound_samples_done); + LOGF("AAC: Decoded %lu samples\n", sound_samples_done); if (ci->request_next_track()) goto next_track; diff --git a/apps/tagcache.c b/apps/tagcache.c index 3a8e73599b..6f49d372e3 100644 --- a/apps/tagcache.c +++ b/apps/tagcache.c @@ -2395,7 +2395,7 @@ static int build_index(int index_type, struct tagcache_header *h, int tmpfd) { logf("too long entry!"); logf("length=%d", entry.tag_length[index_type]); - logf("pos=0x%02x", lseek(tmpfd, 0, SEEK_CUR)); + logf("pos=0x%02lx", lseek(tmpfd, 0, SEEK_CUR)); error = true; break ; } @@ -2429,7 +2429,7 @@ static int build_index(int index_type, struct tagcache_header *h, int tmpfd) idxbuf[j].tag_seek[index_type] = tempbuf_find_location(i + j); if (idxbuf[j].tag_seek[index_type] < 0) { - logf("entry not found (%d)"); + logf("entry not found (%d)", j); error = true; break ; } @@ -3496,7 +3496,7 @@ static bool load_tagcache(void) logf("read error #13"); logf("rc=0x%04x", rc); // 0x431 logf("len=0x%04x", fe->tag_length); // 0x4000 - logf("pos=0x%04x", lseek(fd, 0, SEEK_CUR)); // 0x433 + logf("pos=0x%04lx", lseek(fd, 0, SEEK_CUR)); // 0x433 logf("tag=0x%02x", tag); // 0x00 close(fd); return false; diff --git a/firmware/pcm_record.c b/firmware/pcm_record.c index f467b734c8..1c7e458067 100644 --- a/firmware/pcm_record.c +++ b/firmware/pcm_record.c @@ -796,7 +796,7 @@ static inline void pcmrec_write_chunk(void) } else if (errors == 0) { - logf("wr chk enc error %d %d", + logf("wr chk enc error %lu %lu", rec_fdata.chunk->enc_size, rec_fdata.chunk->num_pcm); errors |= PCMREC_E_ENCODER; } @@ -1680,7 +1680,7 @@ void enc_set_parameters(struct enc_parameters *params) } enc_sample_rate = params->enc_sample_rate; - logf("enc sampr:%d", enc_sample_rate); + logf("enc sampr:%lu", enc_sample_rate); SET_PCM_POS(pcm_rd_pos, dma_wr_pos); pcm_enc_pos = pcm_rd_pos; @@ -1691,7 +1691,7 @@ void enc_set_parameters(struct enc_parameters *params) ALIGN_UP_P2(ENC_CHUNK_HDR_SIZE + params->chunk_size, 2); enc_events_callback = params->events_callback; - logf("chunk size:%d", enc_chunk_size); + logf("chunk size:%lu", enc_chunk_size); /*** Configure the buffers ***/ @@ -1702,7 +1702,7 @@ void enc_set_parameters(struct enc_parameters *params) * |[[s4]:Reserved Bytes]|Filename Queue->|[space]| */ resbytes = ALIGN_UP_P2(params->reserve_bytes, 2); - logf("resbytes:%d", resbytes); + logf("resbytes:%lu", resbytes); bufsize = rec_buffer_size - (enc_buffer - pcm_buffer) - resbytes - FNQ_MIN_NUM_PATHS*MAX_PATH @@ -1716,7 +1716,7 @@ void enc_set_parameters(struct enc_parameters *params) /* get real amount used by encoder chunks */ bufsize = enc_num_chunks*enc_chunk_size; - logf("enc size:%d", bufsize); + logf("enc size:%lu", bufsize); #ifdef PCMREC_PARANOID /* add magic at wraparound */ @@ -1747,19 +1747,19 @@ void enc_set_parameters(struct enc_parameters *params) if (fnq_size > FNQ_MAX_NUM_PATHS) fnq_size = FNQ_MAX_NUM_PATHS; fnq_size *= MAX_PATH; - logf("fnq files: %d", fnq_size / MAX_PATH); + logf("fnq files:%ld", fnq_size / MAX_PATH); -#if 0 - logf("ab :%08X", (unsigned long)audiobuf); - logf("pcm:%08X", (unsigned long)pcm_buffer); - logf("enc:%08X", (unsigned long)enc_buffer); - logf("res:%08X", (unsigned long)params->reserve_buffer); +#if 1 + logf("ab :%08lX", (uintptr_t)audiobuf); + logf("pcm:%08lX", (uintptr_t)pcm_buffer); + logf("enc:%08lX", (uintptr_t)enc_buffer); + logf("res:%08lX", (uintptr_t)params->reserve_buffer); #ifdef PCMREC_PARANOID - logf("wip:%08X", (unsigned long)wrap_id_p); + logf("wip:%08lX", (uintptr_t)wrap_id_p); #endif - logf("fnq:%08X", (unsigned long)fn_queue); - logf("end:%08X", (unsigned long)fn_queue + fnq_size); - logf("abe:%08X", (unsigned long)audiobufend); + logf("fnq:%08lX", (uintptr_t)fn_queue); + logf("end:%08lX", (uintptr_t)fn_queue + fnq_size); + logf("abe:%08lX", (uintptr_t)audiobufend); #endif /* init all chunk headers and reset indexes */ diff --git a/firmware/target/coldfire/i2c-coldfire.c b/firmware/target/coldfire/i2c-coldfire.c index b4e7968d1a..d743d046a7 100644 --- a/firmware/target/coldfire/i2c-coldfire.c +++ b/firmware/target/coldfire/i2c-coldfire.c @@ -169,7 +169,7 @@ int i2c_start(volatile unsigned char *iface) ; if (!j) { - logf("i2c: bus is busy (iface=%08x)", iface); + logf("i2c: bus is busy (iface=%08lX)", (uintptr_t)iface); return -1; } @@ -190,7 +190,7 @@ int i2c_wait_for_slave(volatile unsigned char *iface) ; if (!j) { - logf("i2c: IFF not set (iface=%08x)", iface); + logf("i2c: IFF not set (iface=%08lX)", (uintptr_t)iface); i2c_stop(iface); return -2; } @@ -218,7 +218,7 @@ int i2c_outb(volatile unsigned char *iface, unsigned char byte) /* Check that transfer is complete */ if ( !(iface[O_MBSR] & ICF)) { - logf("i2c: transfer error (iface=%08x)", iface); + logf("i2c: transfer error (iface=%08lX)", (uintptr_t)iface); i2c_stop(iface); return -3; } @@ -226,7 +226,7 @@ int i2c_outb(volatile unsigned char *iface, unsigned char byte) /* Check that the byte has been ACKed */ if (iface[O_MBSR] & RXAK) { - logf("i2c: no ACK (iface=%08x)", iface); + logf("i2c: no ACK (iface=%08lX)", (uintptr_t)iface); i2c_stop(iface); return -4; } diff --git a/firmware/target/coldfire/iaudio/x5/m5636-x5.c b/firmware/target/coldfire/iaudio/x5/m5636-x5.c index d30ff360d6..02f48cf53d 100644 --- a/firmware/target/coldfire/iaudio/x5/m5636-x5.c +++ b/firmware/target/coldfire/iaudio/x5/m5636-x5.c @@ -40,11 +40,12 @@ void m5636_dump_regs(void) address < (unsigned short *)(M5636_BASE + 0x100); address++) { - logf("m5636 A:%08x D:%04x", address, (unsigned)*address); + logf("m5636 A:%08lX D:%04lX", (uintptr_t)address, + (uintptr_t)*address); } - logf("GPIO_INT_EN %08x", GPIO_INT_EN); - logf("GPIO1_OUT %08x", GPIO1_OUT); - logf("GPIO1_ENABLE %08x", GPIO1_ENABLE); - logf("GPIO1_FUNCTION %08x", GPIO1_FUNCTION); + logf("GPIO_INT_EN %08lX", GPIO_INT_EN); + logf("GPIO1_OUT %08lX", GPIO1_OUT); + logf("GPIO1_ENABLE %08lX", GPIO1_ENABLE); + logf("GPIO1_FUNCTION %08lX", GPIO1_FUNCTION); }