From 19711eb920137434104f561086d6ba79b6af5eae Mon Sep 17 00:00:00 2001 From: Andre Noll Date: Sun, 9 Sep 2007 17:24:13 +0200 Subject: [PATCH] Fix some format string warnings on x86_64. --- afs.c | 2 +- aft.c | 2 +- attribute.c | 3 ++- mood.c | 10 ++++++---- osl.c | 10 +++++----- 5 files changed, 15 insertions(+), 12 deletions(-) diff --git a/afs.c b/afs.c index c726f35f..3fc5df43 100644 --- a/afs.c +++ b/afs.c @@ -674,7 +674,7 @@ static void command_post_select(struct sched *s, struct task *t) goto out; } if (t->ret != sizeof(buf)) { - PARA_NOTICE_LOG("short read (%d bytes, expected %d)\n", + PARA_NOTICE_LOG("short read (%d bytes, expected %lu)\n", t->ret, sizeof(buf)); t->ret = 1; goto out; diff --git a/aft.c b/aft.c index e682c203..866f269f 100644 --- a/aft.c +++ b/aft.c @@ -1194,7 +1194,7 @@ static void save_audio_file_info(HASH_TYPE *hash, const char *path, pos = AFTROW_PATH_OFFSET + path_len; PARA_DEBUG_LOG("size: %zu, afhi starts at %d\n", size, pos); - PARA_DEBUG_LOG("last afhi byte: %p, pos %d\n", buf + pos + afhi_size - 1, + PARA_DEBUG_LOG("last afhi byte: %p, pos %zu\n", buf + pos + afhi_size - 1, pos + afhi_size - 1); write_u16(buf + AFTROW_AFHI_OFFSET_POS, pos); save_afhi(afhi, buf + pos); diff --git a/attribute.c b/attribute.c index 86fc36d7..cecd1aa5 100644 --- a/attribute.c +++ b/attribute.c @@ -174,7 +174,8 @@ static int com_setatt_callback(const struct osl_object *query, } if (!add_mask && !del_mask) return -E_ATTR_SYNTAX; - PARA_DEBUG_LOG("masks: %llx:%llx\n", add_mask, del_mask); + PARA_DEBUG_LOG("masks: %llx:%llx\n",(long long unsigned)add_mask, + (long long unsigned)del_mask); for (; p < (char *)query->data + query->size; p += len + 1) { /* TODO: fnmatch */ struct afs_info old_afsi, new_afsi; struct osl_row *aft_row; diff --git a/mood.c b/mood.c index decc77fc..d29b930a 100644 --- a/mood.c +++ b/mood.c @@ -858,10 +858,12 @@ static void log_statistics(void) PARA_NOTICE_LOG("no admissible files\n"); return; } - PARA_NOTICE_LOG("last_played mean: %lli, last_played sigma: %lli\n", - statistics.last_played_sum / n, int_sqrt(statistics.last_played_qd / n)); - PARA_NOTICE_LOG("num_played mean: %lli, num_played sigma: %lli\n", - statistics.num_played_sum / n, int_sqrt(statistics.num_played_qd / n)); + PARA_NOTICE_LOG("last_played mean: %lli, last_played sigma: %llu\n", + (long long int)(statistics.last_played_sum / n), + (long long unsigned)int_sqrt(statistics.last_played_qd / n)); + PARA_NOTICE_LOG("num_played mean: %lli, num_played sigma: %llu\n", + (long long int)statistics.num_played_sum / n, + (long long unsigned)int_sqrt(statistics.num_played_qd / n)); } /** diff --git a/osl.c b/osl.c index 487d0721..0ac7ead0 100644 --- a/osl.c +++ b/osl.c @@ -88,7 +88,7 @@ ssize_t para_write_all(int fd, const void *buf, size_t size) const char *b = buf; while (size) { ssize_t ret = para_write(fd, b, size); - PARA_DEBUG_LOG("ret: %d\n", ret); + PARA_DEBUG_LOG("ret: %zd\n", ret); if (ret < 0) return ret; b += ret; @@ -609,7 +609,7 @@ int read_table_desc(struct osl_object *map, struct osl_table_description *desc) ret = -E_SHORT_TABLE; if (map->size < offset + MIN_IDX_COLUMN_DESCRIPTION_SIZE) { - PARA_ERROR_LOG("map size = %u < %u = offset + min desc size\n", + PARA_ERROR_LOG("map size = %zu < %u = offset + min desc size\n", map->size, offset + MIN_IDX_COLUMN_DESCRIPTION_SIZE); goto err; } @@ -963,7 +963,7 @@ int get_mapped_object(const struct osl_table *t, unsigned col_num, obj->size, offset); return -E_INVALID_OBJECT; } - PARA_DEBUG_LOG("mapped obj row_num: %u, col %u, size: %d\n", row_num, + PARA_DEBUG_LOG("mapped obj row_num: %u, col %u, size: %zu\n", row_num, col_num, obj->size); return 1; } @@ -1374,7 +1374,7 @@ static int append_index_entry(const struct osl_table *t, char *new_index_entry) if (!t->num_mapped_columns) return 1; filename = index_filename(t->desc); - PARA_DEBUG_LOG("appending %zu bytes\n", t->index_entry_size); + PARA_DEBUG_LOG("appending %u bytes\n", t->index_entry_size); ret = append_file(filename, NULL, 0, new_index_entry, t->index_entry_size, NULL); free(filename); @@ -1507,7 +1507,7 @@ int osl_add_and_get_row(struct osl_table *t, struct osl_object *objects, goto out; } if (sf & OSL_FIXED_SIZE) { - PARA_DEBUG_LOG("fixed size. need: %d, have: %d\n", + PARA_DEBUG_LOG("fixed size. need: %zu, have: %d\n", objects[i].size, cd->data_size); ret = -E_BAD_DATA_SIZE; if (objects[i].size != cd->data_size) -- 2.39.5