From ac665916a611de7b80f3f32ca3bb794aca1bfe9b Mon Sep 17 00:00:00 2001 From: Thomas Schmitt Date: Thu, 12 May 2011 13:46:59 +0000 Subject: [PATCH] Reacted on -Wsign-compare warnings of gcc --- cdrskin/cdrskin_timestamp.h | 2 +- libburn/drive.c | 10 +++++----- libburn/init.c | 4 ++-- libburn/mmc.c | 10 +++++----- libburn/sg-linux.c | 6 +++--- libburn/structure.c | 2 +- 6 files changed, 17 insertions(+), 17 deletions(-) diff --git a/cdrskin/cdrskin_timestamp.h b/cdrskin/cdrskin_timestamp.h index 98f1e9d..ef35acf 100644 --- a/cdrskin/cdrskin_timestamp.h +++ b/cdrskin/cdrskin_timestamp.h @@ -1 +1 @@ -#define Cdrskin_timestamP "2011.05.12.120503" +#define Cdrskin_timestamP "2011.05.12.134723" diff --git a/libburn/drive.c b/libburn/drive.c index 7478d97..cb89d39 100644 --- a/libburn/drive.c +++ b/libburn/drive.c @@ -1,7 +1,7 @@ /* -*- indent-tabs-mode: t; tab-width: 8; c-basic-offset: 8; -*- */ /* Copyright (c) 2004 - 2006 Derek Foreman, Ben Jansens - Copyright (c) 2006 - 2010 Thomas Schmitt + Copyright (c) 2006 - 2011 Thomas Schmitt Provided under GPL version 2 or later. */ @@ -1092,7 +1092,7 @@ int burn_drive_scan_sync(struct burn_drive_info *drives[], *n_drives = 0; /* ts A70907 : wether to scan from scratch or to extend */ - for (i = 0; i < sizeof(scanned); i++) + for (i = 0; i < (int) sizeof(scanned); i++) scanned[i] = 0; if (flag & 1) { burn_drive_free_all(); @@ -1120,12 +1120,12 @@ int burn_drive_scan_sync(struct burn_drive_info *drives[], "Out of virtual memory", 0, 0); return -1; } else - for (i = 0; i <= count; i++) /* invalidate */ + for (i = 0; i <= (int) count; i++) /* invalidate */ (*drives)[i].drive = NULL; } else *drives = NULL; - for (i = 0; i < count; ++i) { + for (i = 0; i < (int) count; ++i) { if (scanned[i / 8] & (1 << (i % 8))) continue; /* device already scanned by previous run */ if (drive_array[i].global_index < 0) @@ -1773,7 +1773,7 @@ int burn_drive_resolve_link(char *path, char adr[], int *recursion_count, path); return 0; } - if (ret >= sizeof(link_target) - 1) { + if (ret >= (int) sizeof(link_target) - 1) { sprintf(msg,"readlink( %s ) returns %d (too much)", path, ret); if (flag & 1) burn_drive_adr_debug_msg(msg, NULL); diff --git a/libburn/init.c b/libburn/init.c index 35cff90..234872b 100644 --- a/libburn/init.c +++ b/libburn/init.c @@ -1,7 +1,7 @@ /* -*- indent-tabs-mode: t; tab-width: 8; c-basic-offset: 8; -*- */ /* Copyright (c) 2004 - 2006 Derek Foreman, Ben Jansens - Copyright (c) 2006 - 2010 Thomas Schmitt + Copyright (c) 2006 - 2011 Thomas Schmitt Provided under GPL version 2 or later. */ @@ -354,7 +354,7 @@ char *burn_util_thread_id(pid_t pid, pthread_t tid, char text[80]) sprintf(text, "[%lu,", (unsigned long int) getpid()); l= strlen(text); - for(i= 0; i < sizeof(pthread_t) && 2 * i < 80 - l - 3; i++) + for(i= 0; i < ((int) sizeof(pthread_t)) && 2 * i < 80 - l - 3; i++) sprintf(text + l + 2 * i, "%2.2X", ((unsigned char *) &tid)[i]); diff --git a/libburn/mmc.c b/libburn/mmc.c index 1b3fa69..db9905d 100644 --- a/libburn/mmc.c +++ b/libburn/mmc.c @@ -1,7 +1,7 @@ /* -*- indent-tabs-mode: t; tab-width: 8; c-basic-offset: 8; -*- */ /* Copyright (c) 2004 - 2006 Derek Foreman, Ben Jansens - Copyright (c) 2006 - 2010 Thomas Schmitt + Copyright (c) 2006 - 2011 Thomas Schmitt Provided under GPL version 2 or later. */ @@ -768,9 +768,9 @@ static int mmc_wait_for_buffer_free(struct burn_drive *d, struct buffer *buf) /* >>> learn about buffer progress and adjust usec */ - if (usec < d->wfb_min_usec) + if (usec < (int) d->wfb_min_usec) usec = d->wfb_min_usec; - else if (usec > d->wfb_max_usec) + else if (usec > (int) d->wfb_max_usec) usec = d->wfb_max_usec; usleep(usec); if (d->waited_usec < 0xf0000000) @@ -3759,9 +3759,9 @@ static int mmc_get_write_performance_al(struct burn_drive *d, sd->read_speed = read_speed; } - if (end_lba > d->mdata->max_end_lba) + if ((int) end_lba > d->mdata->max_end_lba) d->mdata->max_end_lba = end_lba; - if (end_lba < d->mdata->min_end_lba) + if ((int) end_lba < d->mdata->min_end_lba) d->mdata->min_end_lba = end_lba; if (write_speed < min_write_speed) min_write_speed = write_speed; diff --git a/libburn/sg-linux.c b/libburn/sg-linux.c index e8142a8..073c625 100644 --- a/libburn/sg-linux.c +++ b/libburn/sg-linux.c @@ -1,7 +1,7 @@ /* -*- indent-tabs-mode: t; tab-width: 8; c-basic-offset: 8; -*- */ /* Copyright (c) 2004 - 2006 Derek Foreman, Ben Jansens - Copyright (c) 2006 - 2010 Thomas Schmitt + Copyright (c) 2006 - 2011 Thomas Schmitt Provided under GPL version 2 or later. */ @@ -1133,7 +1133,7 @@ static int proc_sys_dev_cdrom_info(char ***list, int *count, int flag) if (*cpt == 0 || *cpt == '\n') break; sscanf(cpt, "%s", fname + 5); - if (strlen(fname) > maxl) + if ((int) strlen(fname) > maxl) maxl = strlen(fname); if (pass == 1) strcpy((*list)[*count], fname); @@ -1369,7 +1369,7 @@ next_proc_info:; if ((idx->info_list)[i][0] == 0) continue; if (baseno == idx->pos) { - if (adr_size < strlen((idx->info_list)[i]) + 1) + if (adr_size < (int) strlen((idx->info_list)[i]) + 1) return -1; strcpy(adr, (idx->info_list)[i]); return 1; diff --git a/libburn/structure.c b/libburn/structure.c index d9070af..0ad924e 100644 --- a/libburn/structure.c +++ b/libburn/structure.c @@ -33,7 +33,7 @@ extern struct libdax_msgs *libdax_messenger; return 0;\ if (pos == BURN_POS_END)\ pos = TO->NEW##s;\ - if (pos > TO->NEW##s)\ + if ((int) pos > TO->NEW##s)\ return 0;\ \ tmp = realloc(TO->NEW, sizeof(struct NEW *) * (TO->NEW##s + 1));\