From fc098d0755eb7ba9cca74631e706c04aec03ce8f Mon Sep 17 00:00:00 2001 From: Harald Hoyer Date: Mon, 25 Feb 2008 10:19:26 +0000 Subject: [PATCH] - patched to compile with -Werror (rhbz#429385) --- cdrkit-1.1.6-werror.patch | 1146 +++++++++++++++++++------------------ cdrkit.spec | 13 +- 2 files changed, 604 insertions(+), 555 deletions(-) diff --git a/cdrkit-1.1.6-werror.patch b/cdrkit-1.1.6-werror.patch index db45547..b39388e 100644 --- a/cdrkit-1.1.6-werror.patch +++ b/cdrkit-1.1.6-werror.patch @@ -1,377 +1,141 @@ -diff -up cdrkit-1.1.6/libhfs_iso/hfs.h.werror cdrkit-1.1.6/libhfs_iso/hfs.h ---- cdrkit-1.1.6/libhfs_iso/hfs.h.werror 2008-02-25 10:03:52.000000000 +0100 -+++ cdrkit-1.1.6/libhfs_iso/hfs.h 2008-02-25 10:03:52.000000000 +0100 -@@ -29,6 +29,8 @@ - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ -+#ifndef HFS_H -+#define HFS_H +diff -up cdrkit-1.1.6/genisoimage/boot-hppa.c.werror cdrkit-1.1.6/genisoimage/boot-hppa.c +--- cdrkit-1.1.6/genisoimage/boot-hppa.c.werror 2008-02-25 11:09:02.000000000 +0100 ++++ cdrkit-1.1.6/genisoimage/boot-hppa.c 2008-02-25 11:09:02.000000000 +0100 +@@ -177,7 +177,7 @@ static int boot_hppa_write(FILE *outfile + write_be32(length, &boot_sector[20]); - #include - #include -@@ -195,8 +197,12 @@ int hfs_delete(hfsvol *, char *); + /* Now the commandline */ +- snprintf(&boot_sector[24], 127, "%s", hppa_cmdline); ++ snprintf((char *)&boot_sector[24], 127, "%s", hppa_cmdline); - int hfs_rename(hfsvol *, char *, char *); - -+int f_trunc(hfsfile *file); -+ - #ifdef APPLE_HYB - unsigned short hfs_get_drAllocPtr(hfsfile *); - int hfs_set_drAllocPtr(hfsfile *, unsigned short, int size); - void hfs_vsetbless(hfsvol *, unsigned long); - #endif /* APPLE_HYB */ -+ -+#endif -diff -up cdrkit-1.1.6/libhfs_iso/hfs.c.werror cdrkit-1.1.6/libhfs_iso/hfs.c ---- cdrkit-1.1.6/libhfs_iso/hfs.c.werror 2008-02-25 10:03:52.000000000 +0100 -+++ cdrkit-1.1.6/libhfs_iso/hfs.c 2008-02-25 10:03:52.000000000 +0100 -@@ -50,6 +50,7 @@ - #include "node.h" - #include "record.h" - #include "volume.h" -+#include "hfs.h" - - /* High-Level Volume Routines ============================================== */ - -diff -up cdrkit-1.1.6/libusal/usal/usalops.h.werror cdrkit-1.1.6/libusal/usal/usalops.h ---- cdrkit-1.1.6/libusal/usal/usalops.h.werror 2008-02-25 10:03:52.000000000 +0100 -+++ cdrkit-1.1.6/libusal/usal/usalops.h 2008-02-25 10:03:52.000000000 +0100 -@@ -76,6 +76,8 @@ typedef struct usal_ops { - #define SCGO_ISATAPI(usalp) (*(usalp)->ops->usalo_isatapi)(usalp) - #define SCGO_RESET(usalp, what) (*(usalp)->ops->usalo_reset)(usalp, what) - -+extern int usal_fileno(SCSI *usalp, int busno, int tgt, int tlun); -+extern char * usal_natname(SCSI *usalp, int busno, int tgt, int tlun); - #ifdef __cplusplus - } - #endif -diff -up cdrkit-1.1.6/libusal/scsi-linux-ata.c.werror cdrkit-1.1.6/libusal/scsi-linux-ata.c ---- cdrkit-1.1.6/libusal/scsi-linux-ata.c.werror 2008-02-25 10:03:52.000000000 +0100 -+++ cdrkit-1.1.6/libusal/scsi-linux-ata.c 2008-02-25 10:03:52.000000000 +0100 -@@ -258,7 +258,7 @@ openbydev: - starget, - slun; - -- f = sg_open_excl(device, O_RDONLY | O_NONBLOCK); -+ f = sg_open_excl(device, O_RDONLY | O_NONBLOCK, FALSE); - - if (f < 0) { - if (usalp->errstr) -@@ -770,11 +770,11 @@ sg_amapdev(SCSI *usalp, int f, char *dev - l = 0; - #endif /* nonono */ - /* other solution, with ioctl */ -- int Chan, -- Ino, -- Bus, -- Target, -- Lun; -+ int Chan = 0, -+ Ino = 0, -+ Bus = 0, -+ Target = 0, -+ Lun = 0; - - subsystem = HOST_SCSI; - sg_amapdev_scsi(usalp, f, &Bus, &Target, &Lun, &Chan, &Ino); -@@ -1008,7 +1008,7 @@ usalo_asend(SCSI *usalp) + /* Find the dir entry for the 64-bit kernel by walking our file list */ + boot_file = search_tree_file(root, hppa_kernel_64); +diff -up cdrkit-1.1.6/genisoimage/multi.c.werror cdrkit-1.1.6/genisoimage/multi.c +--- cdrkit-1.1.6/genisoimage/multi.c.werror 2008-02-25 11:09:02.000000000 +0100 ++++ cdrkit-1.1.6/genisoimage/multi.c 2008-02-25 11:09:02.000000000 +0100 +@@ -1064,7 +1064,7 @@ check_prev_session(struct directory_entr + } + /* We found it and we can reuse the extent */ + memcpy(curr_entry->isorec.extent, ptr[i]->isorec.extent, 8); +- curr_entry->starting_block = isonum_733(ptr[i]->isorec.extent); ++ curr_entry->starting_block = isonum_733((unsigned char *)ptr[i]->isorec.extent); + curr_entry->de_flags |= SAFE_TO_REUSE_TABLE_ENTRY; + goto found_it; } +diff -up cdrkit-1.1.6/genisoimage/joliet.c.werror cdrkit-1.1.6/genisoimage/joliet.c +--- cdrkit-1.1.6/genisoimage/joliet.c.werror 2008-02-25 11:09:02.000000000 +0100 ++++ cdrkit-1.1.6/genisoimage/joliet.c 2008-02-25 11:09:02.000000000 +0100 +@@ -250,9 +250,9 @@ convert_to_unicode(unsigned char *buffer + #ifdef USE_ICONV + if (inls->iconv_d && inls->unls_cs2uni==NULL && + inls->unls_uni2cs==NULL) { +- char *inptr = tmpbuf; +- char *outptr = buffer; +- size_t inleft = strlen(tmpbuf); ++ char *inptr = (char *)tmpbuf; ++ char *outptr = (char *)buffer; ++ size_t inleft = (size_t)strlen((char *)tmpbuf); + size_t inlen = inleft; + size_t outleft = size; - sg_cgc.buflen = sp->size; -- sg_cgc.buffer = sp->addr; -+ sg_cgc.buffer = (unsigned char *)sp->addr; - - if (sp->sense_len > sizeof (sense_cgc)) - sense_cgc.add_sense_len = sizeof (sense_cgc) - 8; -diff -up cdrkit-1.1.6/libusal/scsi-linux-sg.c.werror cdrkit-1.1.6/libusal/scsi-linux-sg.c ---- cdrkit-1.1.6/libusal/scsi-linux-sg.c.werror 2008-02-25 10:03:52.000000000 +0100 -+++ cdrkit-1.1.6/libusal/scsi-linux-sg.c 2008-02-25 10:03:52.000000000 +0100 -@@ -217,13 +217,6 @@ struct usal_local { - /*#define MISALIGN*/ - /*#undef SG_GET_BUFSIZE*/ - --#if defined(USE_PG) && !defined(USE_PG_ONLY) --#include "scsi-linux-pg.c" --#endif --#ifdef USE_OLD_ATAPI --#include "scsi-linux-ata.c" --#endif +diff -up cdrkit-1.1.6/genisoimage/eltorito.c.werror cdrkit-1.1.6/genisoimage/eltorito.c +--- cdrkit-1.1.6/genisoimage/eltorito.c.werror 2008-02-25 11:09:02.000000000 +0100 ++++ cdrkit-1.1.6/genisoimage/eltorito.c 2008-02-25 11:09:02.000000000 +0100 +@@ -600,7 +600,7 @@ fill_boot_desc(struct eltorito_defaultbo + static char csum_buffer[SECTOR_SIZE]; + int len; + struct genisoimage_boot_info bi_table; - ++ int ret; + bootimage = open(de->whole_name, O_RDWR | O_BINARY); + if (bootimage == -1) { + #ifdef USE_LIBSCHILY +@@ -661,7 +661,7 @@ fill_boot_desc(struct eltorito_defaultbo + set_731(bi_table.bi_length, de->size); + set_731(bi_table.bi_csum, bi_checksum); - #ifdef MISALIGN - static int sg_getint(int *ip); -@@ -246,8 +239,14 @@ static void sg_settimeout(int f, int tim - - int sg_open_excl(char *device, int mode, BOOL beQuiet); - - static BOOL get_max_secs(char *dirpath, int *outval); - -+#if defined(USE_PG) && !defined(USE_PG_ONLY) -+#include "scsi-linux-pg.c" -+#endif -+#ifdef USE_OLD_ATAPI -+#include "scsi-linux-ata.c" -+#endif - - BOOL check_linux_26() { - int gen, tmp; -@@ -511,10 +508,9 @@ usalo_open(SCSI *usalp, char *device) - #define SCD 1 - #define SG 2 - int h; --retry_scan_open: - for(h=HDX; h <= (fake_atabus ? HDX : SG) ; h++) { -- char *pattern; -- unsigned int first, last; -+ char *pattern = NULL; -+ unsigned int first = 0, last = 0; - switch(h) { - case(HDX): - { -@@ -792,7 +788,7 @@ sg_initdev(SCSI *usalp, int f) - for (i = 0; i < 1000; i++) { /* Read at least 32k from /dev/sg* */ - int ret; - -- ret = read(f, &sg_rep, sizeof (sg_rep)); -+ ret = read(f, &sg_rep, sizeof (struct sg_rep)); - if (ret > 0) - continue; - if (ret == 0 || errno == EAGAIN || errno == EIO) -@@ -984,12 +980,14 @@ sg_raisedma(SCSI *usalp, long newmax) - } - #endif - --static void freadstring(char *fn, char *out, int len) { -+static char *freadstring(char *fn, char *out, int len) { -+ char *ret; - FILE *fd=fopen(fn, "r"); - out[0]='\0'; -- if(!fd) return; -- fgets(out, len, fd); -+ if(!fd) return NULL; -+ ret = fgets(out, len, fd); - fclose(fd); -+ return ret; - } - - static long -@@ -1017,14 +1015,13 @@ usalo_maxdma(SCSI *usalp, long amt) - major=stbuf.st_rdev>>8; - minor=stbuf.st_rdev&0xFF; - if (usalp->debug > 0) -- fprintf(stderr, "Looking for data for major:minor: %d:%d\n", major, minor); -+ fprintf(stderr, "Looking for data for major:minor: %ld:%ld\n", major, minor); - glob_t globbuf; - memset(&globbuf, 0, sizeof(glob_t)); - /* *dev files contain the major:minor strings to compare */ - glob("/sys/class/scsi_generic/*/device/block*/queue/max_sectors_kb", GLOB_DOOFFS | GLOB_NOSORT, NULL, &globbuf); - glob("/sys/block/*/device/block*/queue/max_sectors_kb", GLOB_DOOFFS | GLOB_NOSORT | GLOB_APPEND, NULL, &globbuf); - for(i=0;isense.code >= 0x70) */ -- return (char *) &(cp->sense); -+ return (unsigned char *) &(cp->sense); - } - - -diff -up cdrkit-1.1.6/icedax/toc.c.werror cdrkit-1.1.6/icedax/toc.c ---- cdrkit-1.1.6/icedax/toc.c.werror 2008-02-25 10:03:52.000000000 +0100 -+++ cdrkit-1.1.6/icedax/toc.c 2008-02-25 10:03:52.000000000 +0100 -@@ -864,7 +864,7 @@ int process_cddb_titles(int sock_fd, cha - int finished = 0; - char *p = inbuff; - int ind = 0; -- char ** target = (char **)&global.creator; -+ unsigned char ** target = &global.creator; - - do { - while (readbytes > 0) { -@@ -935,7 +935,7 @@ int process_cddb_titles(int sock_fd, cha - if (*target != NULL) - **target = '\0'; - } else { -- *target = realloc(*target, strlen(*target) + clen - 1); -+ *target = realloc(*target, strlen((char *)*target) + clen - 1); - } - if (*target != NULL) { - strcat((char *)*target, inbuff+ind+7); -@@ -943,7 +943,7 @@ int process_cddb_titles(int sock_fd, cha - - /* handle part after the delimiter, if present */ - if (res != NULL) { -- target = (char **)&global.disctitle; -+ target = (unsigned char **)&global.disctitle; - /* skip the delimiter */ - q += 3; - clen = p - q; -@@ -1070,8 +1070,9 @@ static int handle_userchoice(char *p, un - - /* get user response. */ - do { -+ int ret; - fprintf(stderr, "please choose one (0-%u): ", nr); -- scanf("%u", &user_choice); -+ ret = scanf("%u", &user_choice); - } while (user_choice > nr); - - if (user_choice == nr) -diff -up cdrkit-1.1.6/wodim/scsi_scan.h.werror cdrkit-1.1.6/wodim/scsi_scan.h ---- cdrkit-1.1.6/wodim/scsi_scan.h.werror 2008-02-25 10:03:52.000000000 +0100 -+++ cdrkit-1.1.6/wodim/scsi_scan.h 2008-02-25 10:03:52.000000000 +0100 -@@ -39,5 +39,6 @@ - extern int select_target(SCSI *usalp, FILE *f); - extern int list_devices(SCSI *usalp, FILE *f, int pickup_type); - extern SCSI * open_auto(int64_t need_size, int debug, int lverbose); -+extern int scsi_set_streaming(SCSI *usalp, caddr_t addr, int size); - - #endif /* _SCSI_SCAN_H */ -diff -up cdrkit-1.1.6/wodim/scsi_cdr.c.werror cdrkit-1.1.6/wodim/scsi_cdr.c ---- cdrkit-1.1.6/wodim/scsi_cdr.c.werror 2008-02-25 10:03:52.000000000 +0100 -+++ cdrkit-1.1.6/wodim/scsi_cdr.c 2008-02-25 10:03:52.000000000 +0100 -@@ -63,6 +63,7 @@ - - #include "scsimmc.h" - #include "wodim.h" -+#include "scsi_scan.h" - - #define strbeg(s1, s2) (strstr((s2), (s1)) == (s2)) - -diff -up cdrkit-1.1.6/wodim/wodim.c.werror cdrkit-1.1.6/wodim/wodim.c ---- cdrkit-1.1.6/wodim/wodim.c.werror 2008-02-25 10:03:52.000000000 +0100 -+++ cdrkit-1.1.6/wodim/wodim.c 2008-02-25 10:03:52.000000000 +0100 -@@ -4076,6 +4076,7 @@ audioread(SCSI *usalp, cdr_t *dp, int fl - #ifdef DEBUG - int speed = 1; - int oflags = dp->cdr_cmdflags; -+ int ret; - - dp->cdr_cmdflags &= ~F_DUMMY; - if ((*dp->cdr_set_speed_dummy)(usalp, dp, &speed) < 0) -@@ -4089,7 +4090,7 @@ audioread(SCSI *usalp, cdr_t *dp, int fl - - read_scsi(usalp, buf, 1000, 1); - printf("XXX:\n"); -- write(1, buf, 512); -+ ret = write(1, buf, 512); - unload_media(usalp, dp, flags); - comexit(0); - #endif -diff -up cdrkit-1.1.6/wodim/drv_mmc.c.werror cdrkit-1.1.6/wodim/drv_mmc.c ---- cdrkit-1.1.6/wodim/drv_mmc.c.werror 2008-02-25 10:03:52.000000000 +0100 -+++ cdrkit-1.1.6/wodim/drv_mmc.c 2008-02-25 10:03:52.000000000 +0100 -@@ -59,6 +59,7 @@ - #include "scsimmc.h" - #include "mmcvendor.h" - #include "wodim.h" -+#include "scsi_scan.h" - - extern char *driveropts; - -@@ -165,6 +166,8 @@ static int do_tattoo_yamaha(SCSI *usalp - static int yamaha_write_buffer(SCSI *usalp, int mode, int bufferid, long offset, - long parlen, void *buffer, long buflen); - static int dvd_dual_layer_split(SCSI *usalp, cdr_t *dp, long tsize); -+extern int reserve_track(SCSI *usalp, Ulong size); -+extern int scsi_format(SCSI *usalp, caddr_t addr, int size, BOOL background); - - #ifdef __needed__ - static int -@@ -2851,9 +2854,9 @@ extern char *buf; - flush(); +- write(bootimage, &bi_table, sizeof (bi_table)); ++ ret = write(bootimage, &bi_table, sizeof (bi_table)); + close(bootimage); } - if (formattype == FULL_FORMAT) { -- ret = scsi_format(usalp, &addr, sizeof(addr), FALSE); -+ ret = scsi_format(usalp, (caddr_t)&addr, sizeof(addr), FALSE); - } else { -- ret = scsi_format(usalp, &addr, sizeof(addr), TRUE); -+ ret = scsi_format(usalp, (caddr_t)&addr, sizeof(addr), TRUE); + }/* fill_boot_desc(... */ +diff -up cdrkit-1.1.6/genisoimage/write.c.werror cdrkit-1.1.6/genisoimage/write.c +--- cdrkit-1.1.6/genisoimage/write.c.werror 2008-02-25 11:09:02.000000000 +0100 ++++ cdrkit-1.1.6/genisoimage/write.c 2008-02-25 11:09:02.000000000 +0100 +@@ -303,7 +303,8 @@ xfwrite(void *buffer, int size, int coun + * which is wrong this code. (void *) introduces a compatible + * intermediate type in the cast list. + */ +- count -= got, *(char **)(void *)&buffer += size * got; ++ count -= got; ++ buffer = (void *)(((char *)buffer) + size * got); } - if (ret < 0) - return (ret); -diff -up cdrkit-1.1.6/wodim/scsi_scan.c.werror cdrkit-1.1.6/wodim/scsi_scan.c ---- cdrkit-1.1.6/wodim/scsi_scan.c.werror 2008-02-25 10:03:52.000000000 +0100 -+++ cdrkit-1.1.6/wodim/scsi_scan.c 2008-02-25 10:03:52.000000000 +0100 -@@ -50,6 +50,9 @@ - #include - #include - #include -+#include -+#include -+ + } - static void print_product(FILE *f, struct scsi_inquiry *ip); - int select_target(SCSI *usalp, FILE *f); -@@ -200,7 +203,7 @@ int list_devices(SCSI *usalp, FILE *f, i - int fd, ndevs=0; - struct stat statbuf; - char *lines[MAXDEVCOUNT]; -- char buf[256], perms[8], *p; -+ char buf[256], perms[8]; +@@ -918,8 +919,8 @@ reassign_link_addresses(struct directory + if (verbose > 2 && s_entry->size != 0) { + fprintf(stderr, "%8d %8d ", +- s_entry->starting_block, +- s_entry->starting_block + ISO_BLOCKS(s_entry->size) - 1); ++ (int)s_entry->starting_block, ++ (int)(s_entry->starting_block + ISO_BLOCKS(s_entry->size) - 1)); - usalp->silent++; -diff -up cdrkit-1.1.6/wodim/isosize.c.werror cdrkit-1.1.6/wodim/isosize.c ---- cdrkit-1.1.6/wodim/isosize.c.werror 2008-02-25 10:03:52.000000000 +0100 -+++ cdrkit-1.1.6/wodim/isosize.c 2008-02-25 10:03:52.000000000 +0100 -@@ -69,7 +69,8 @@ isosize(int f) - vp = (struct iso9660_pr_voldesc *) &vd; - - do { -- read(f, &vd, sizeof (vd)); -+ int ret; -+ ret = read(f, &vd, sizeof (vd)); - if (GET_UBYTE(vd.vd_type) == VD_PRIMARY) - break; + if (s_entry->inode != TABLE_INODE) { + fprintf(stderr, "%s\n", s_entry->whole_name); +diff -up cdrkit-1.1.6/genisoimage/tree.c.werror cdrkit-1.1.6/genisoimage/tree.c +--- cdrkit-1.1.6/genisoimage/tree.c.werror 2008-02-25 11:09:02.000000000 +0100 ++++ cdrkit-1.1.6/genisoimage/tree.c 2008-02-25 11:09:02.000000000 +0100 +@@ -41,6 +41,7 @@ + #include + #include "genisoimage.h" + #include "match.h" ++#include "udf.h" + #include "exclude.h" + #include + #include +diff -up cdrkit-1.1.6/genisoimage/md5.c.werror cdrkit-1.1.6/genisoimage/md5.c +--- cdrkit-1.1.6/genisoimage/md5.c.werror 2008-02-25 11:09:02.000000000 +0100 ++++ cdrkit-1.1.6/genisoimage/md5.c 2008-02-25 11:09:02.000000000 +0100 +@@ -352,15 +352,15 @@ int calculate_md5sum(char *filename, uns + remain = size; + while (remain > 0) + { +- use = (remain > sizeof(buffer) ? sizeof(buffer) : remain); +- if (fread(buffer, 1, use, infile) == 0) ++ use = (remain > sizeof(buffer) ? sizeof(buffer) : remain); ++ if (fread(buffer, 1, use, infile) == 0) + { +- fprintf(stderr, "cannot read from '%s'\n", filename); +- exit(1); +- } +- /* Update the checksum */ +- mk_MD5Update(&file_context, buffer, use); +- remain -= use; ++ fprintf(stderr, "cannot read from '%s'\n", filename); ++ exit(1); ++ } ++ /* Update the checksum */ ++ mk_MD5Update(&file_context, (unsigned char *)buffer, use); ++ remain -= use; + } + fclose(infile); + mk_MD5Final(&out[0], &file_context); +diff -up cdrkit-1.1.6/genisoimage/boot-mips.c.werror cdrkit-1.1.6/genisoimage/boot-mips.c +--- cdrkit-1.1.6/genisoimage/boot-mips.c.werror 2008-02-25 11:09:02.000000000 +0100 ++++ cdrkit-1.1.6/genisoimage/boot-mips.c 2008-02-25 11:09:02.000000000 +0100 +@@ -310,7 +310,7 @@ static int boot_mips_write(FILE *outfile + length = ((get_733(boot_file->isorec.size) + 2047) / 2048) * 2048; + filename = file_base_name(boot_mips_filename[i]); +- strncpy(vh.vh_vd[i].vd_name, filename, MIN(VDNAMESIZE, strlen(filename))); ++ strncpy((char *)vh.vh_vd[i].vd_name, filename, MIN(VDNAMESIZE, strlen(filename))); + write_be32(extent, (unsigned char *)&vh.vh_vd[i].vd_lbn); + write_be32(length, (unsigned char *)&vh.vh_vd[i].vd_nbytes); + diff -up cdrkit-1.1.6/genisoimage/jte.c.werror cdrkit-1.1.6/genisoimage/jte.c ---- cdrkit-1.1.6/genisoimage/jte.c.werror 2008-02-25 10:06:16.000000000 +0100 -+++ cdrkit-1.1.6/genisoimage/jte.c 2008-02-25 10:08:08.000000000 +0100 +--- cdrkit-1.1.6/genisoimage/jte.c.werror 2008-02-25 11:09:02.000000000 +0100 ++++ cdrkit-1.1.6/genisoimage/jte.c 2008-02-25 11:09:02.000000000 +0100 @@ -531,13 +531,13 @@ static void parse_md5_list(void) } @@ -427,44 +191,9 @@ diff -up cdrkit-1.1.6/genisoimage/jte.c.werror cdrkit-1.1.6/genisoimage/jte.c add_unmatched_entry(pad_size); } } -diff -up cdrkit-1.1.6/genisoimage/boot-mips.c.werror cdrkit-1.1.6/genisoimage/boot-mips.c ---- cdrkit-1.1.6/genisoimage/boot-mips.c.werror 2008-02-25 10:04:55.000000000 +0100 -+++ cdrkit-1.1.6/genisoimage/boot-mips.c 2008-02-25 10:05:05.000000000 +0100 -@@ -310,7 +310,7 @@ static int boot_mips_write(FILE *outfile - length = ((get_733(boot_file->isorec.size) + 2047) / 2048) * 2048; - filename = file_base_name(boot_mips_filename[i]); - -- strncpy(vh.vh_vd[i].vd_name, filename, MIN(VDNAMESIZE, strlen(filename))); -+ strncpy((char *)vh.vh_vd[i].vd_name, filename, MIN(VDNAMESIZE, strlen(filename))); - write_be32(extent, (unsigned char *)&vh.vh_vd[i].vd_lbn); - write_be32(length, (unsigned char *)&vh.vh_vd[i].vd_nbytes); - -diff -up cdrkit-1.1.6/genisoimage/tree.c.werror cdrkit-1.1.6/genisoimage/tree.c ---- cdrkit-1.1.6/genisoimage/tree.c.werror 2008-02-25 10:03:52.000000000 +0100 -+++ cdrkit-1.1.6/genisoimage/tree.c 2008-02-25 10:03:52.000000000 +0100 -@@ -41,6 +41,7 @@ - #include - #include "genisoimage.h" - #include "match.h" -+#include "udf.h" - #include "exclude.h" - #include - #include -diff -up cdrkit-1.1.6/genisoimage/multi.c.werror cdrkit-1.1.6/genisoimage/multi.c ---- cdrkit-1.1.6/genisoimage/multi.c.werror 2008-02-25 10:03:52.000000000 +0100 -+++ cdrkit-1.1.6/genisoimage/multi.c 2008-02-25 10:03:52.000000000 +0100 -@@ -1064,7 +1064,7 @@ check_prev_session(struct directory_entr - } - /* We found it and we can reuse the extent */ - memcpy(curr_entry->isorec.extent, ptr[i]->isorec.extent, 8); -- curr_entry->starting_block = isonum_733(ptr[i]->isorec.extent); -+ curr_entry->starting_block = isonum_733((unsigned char *)ptr[i]->isorec.extent); - curr_entry->de_flags |= SAFE_TO_REUSE_TABLE_ENTRY; - goto found_it; - } diff -up cdrkit-1.1.6/genisoimage/genisoimage.c.werror cdrkit-1.1.6/genisoimage/genisoimage.c ---- cdrkit-1.1.6/genisoimage/genisoimage.c.werror 2008-02-25 10:03:52.000000000 +0100 -+++ cdrkit-1.1.6/genisoimage/genisoimage.c 2008-02-25 10:03:52.000000000 +0100 +--- cdrkit-1.1.6/genisoimage/genisoimage.c.werror 2008-02-25 11:09:02.000000000 +0100 ++++ cdrkit-1.1.6/genisoimage/genisoimage.c 2008-02-25 11:09:02.000000000 +0100 @@ -2451,8 +2451,8 @@ parse_input_files: if (stream_filename) { if (strlen(stream_filename) > MAX_ISONAME) @@ -476,110 +205,9 @@ diff -up cdrkit-1.1.6/genisoimage/genisoimage.c.werror cdrkit-1.1.6/genisoimage/ if (strchr(stream_filename, '/')) comerrno(EX_BAD, "Illegal character '/' in stream-file-name.\n"); iso9660_level = 4; -diff -up cdrkit-1.1.6/genisoimage/eltorito.c.werror cdrkit-1.1.6/genisoimage/eltorito.c ---- cdrkit-1.1.6/genisoimage/eltorito.c.werror 2008-02-25 10:03:52.000000000 +0100 -+++ cdrkit-1.1.6/genisoimage/eltorito.c 2008-02-25 10:03:52.000000000 +0100 -@@ -600,7 +600,7 @@ fill_boot_desc(struct eltorito_defaultbo - static char csum_buffer[SECTOR_SIZE]; - int len; - struct genisoimage_boot_info bi_table; -- -+ int ret; - bootimage = open(de->whole_name, O_RDWR | O_BINARY); - if (bootimage == -1) { - #ifdef USE_LIBSCHILY -@@ -661,7 +661,7 @@ fill_boot_desc(struct eltorito_defaultbo - set_731(bi_table.bi_length, de->size); - set_731(bi_table.bi_csum, bi_checksum); - -- write(bootimage, &bi_table, sizeof (bi_table)); -+ ret = write(bootimage, &bi_table, sizeof (bi_table)); - close(bootimage); - } - }/* fill_boot_desc(... */ -diff -up cdrkit-1.1.6/genisoimage/boot-hppa.c.werror cdrkit-1.1.6/genisoimage/boot-hppa.c ---- cdrkit-1.1.6/genisoimage/boot-hppa.c.werror 2008-02-25 10:03:52.000000000 +0100 -+++ cdrkit-1.1.6/genisoimage/boot-hppa.c 2008-02-25 10:03:52.000000000 +0100 -@@ -177,7 +177,7 @@ static int boot_hppa_write(FILE *outfile - write_be32(length, &boot_sector[20]); - - /* Now the commandline */ -- snprintf(&boot_sector[24], 127, "%s", hppa_cmdline); -+ snprintf((char *)&boot_sector[24], 127, "%s", hppa_cmdline); - - /* Find the dir entry for the 64-bit kernel by walking our file list */ - boot_file = search_tree_file(root, hppa_kernel_64); -diff -up cdrkit-1.1.6/genisoimage/joliet.c.werror cdrkit-1.1.6/genisoimage/joliet.c ---- cdrkit-1.1.6/genisoimage/joliet.c.werror 2008-02-25 10:03:52.000000000 +0100 -+++ cdrkit-1.1.6/genisoimage/joliet.c 2008-02-25 10:03:52.000000000 +0100 -@@ -250,9 +250,9 @@ convert_to_unicode(unsigned char *buffer - #ifdef USE_ICONV - if (inls->iconv_d && inls->unls_cs2uni==NULL && - inls->unls_uni2cs==NULL) { -- char *inptr = tmpbuf; -- char *outptr = buffer; -- size_t inleft = strlen(tmpbuf); -+ char *inptr = (char *)tmpbuf; -+ char *outptr = (char *)buffer; -+ size_t inleft = (size_t)strlen((char *)tmpbuf); - size_t inlen = inleft; - size_t outleft = size; - -diff -up cdrkit-1.1.6/genisoimage/md5.c.werror cdrkit-1.1.6/genisoimage/md5.c ---- cdrkit-1.1.6/genisoimage/md5.c.werror 2008-02-25 10:05:15.000000000 +0100 -+++ cdrkit-1.1.6/genisoimage/md5.c 2008-02-25 10:06:07.000000000 +0100 -@@ -352,15 +352,15 @@ int calculate_md5sum(char *filename, uns - remain = size; - while (remain > 0) - { -- use = (remain > sizeof(buffer) ? sizeof(buffer) : remain); -- if (fread(buffer, 1, use, infile) == 0) -+ use = (remain > sizeof(buffer) ? sizeof(buffer) : remain); -+ if (fread(buffer, 1, use, infile) == 0) - { -- fprintf(stderr, "cannot read from '%s'\n", filename); -- exit(1); -- } -- /* Update the checksum */ -- mk_MD5Update(&file_context, buffer, use); -- remain -= use; -+ fprintf(stderr, "cannot read from '%s'\n", filename); -+ exit(1); -+ } -+ /* Update the checksum */ -+ mk_MD5Update(&file_context, (unsigned char *)buffer, use); -+ remain -= use; - } - fclose(infile); - mk_MD5Final(&out[0], &file_context); -diff -up cdrkit-1.1.6/genisoimage/diag/isovfy.c.werror cdrkit-1.1.6/genisoimage/diag/isovfy.c ---- cdrkit-1.1.6/genisoimage/diag/isovfy.c.werror 2008-02-25 10:03:52.000000000 +0100 -+++ cdrkit-1.1.6/genisoimage/diag/isovfy.c 2008-02-25 10:03:52.000000000 +0100 -@@ -583,6 +583,7 @@ check_path_tables(int typel_extent, int - char *pnt; - char *typel; - char *typem; -+ int ret; - - /* Now read in the path tables */ - -@@ -591,11 +592,11 @@ check_path_tables(int typel_extent, int - readsecs(typel_extent * blocksize / 2048, typel, ISO_BLOCKS(path_table_size)); - #else - lseek(fileno(infile), (off_t)((off_t)typel_extent) * blocksize, SEEK_SET); -- read(fileno(infile), typel, path_table_size); -+ ret = read(fileno(infile), typel, path_table_size); - #endif - typem = (char *) malloc(path_table_size); - lseek(fileno(infile), (off_t)((off_t)typem_extent) * blocksize, SEEK_SET); -- read(fileno(infile), typem, path_table_size); -+ ret = read(fileno(infile), typem, path_table_size); - - j = path_table_size; - pnt = typel; diff -up cdrkit-1.1.6/genisoimage/diag/isodump.c.werror cdrkit-1.1.6/genisoimage/diag/isodump.c ---- cdrkit-1.1.6/genisoimage/diag/isodump.c.werror 2008-02-25 10:03:52.000000000 +0100 -+++ cdrkit-1.1.6/genisoimage/diag/isodump.c 2008-02-25 10:03:52.000000000 +0100 +--- cdrkit-1.1.6/genisoimage/diag/isodump.c.werror 2008-02-25 11:09:02.000000000 +0100 ++++ cdrkit-1.1.6/genisoimage/diag/isodump.c 2008-02-25 11:09:02.000000000 +0100 @@ -652,10 +652,11 @@ main(int argc, char *argv[]) on_comerr((void(*)(int, void *))reset_tty, NULL); @@ -619,29 +247,9 @@ diff -up cdrkit-1.1.6/genisoimage/diag/isodump.c.werror cdrkit-1.1.6/genisoimage while (search[strlen((char *)search)-1] == '\n') search[strlen((char *)search)-1] = 0; crsr2(20, 1); -diff -up cdrkit-1.1.6/genisoimage/diag/isoinfo.c.werror cdrkit-1.1.6/genisoimage/diag/isoinfo.c ---- cdrkit-1.1.6/genisoimage/diag/isoinfo.c.werror 2008-02-25 10:03:52.000000000 +0100 -+++ cdrkit-1.1.6/genisoimage/diag/isoinfo.c 2008-02-25 10:03:52.000000000 +0100 -@@ -641,6 +641,7 @@ extract_file(struct iso_directory_record - len = isonum_733((unsigned char *)idr->size); - - while (len > 0) { -+ int ret; - #ifdef USE_SCG - readsecs(extent - sector_offset, buff, ISO_BLOCKS(sizeof (buff))); - tlen = (len > sizeof (buff) ? sizeof (buff) : len); -@@ -651,7 +652,7 @@ extract_file(struct iso_directory_record - #endif - len -= tlen; - extent++; -- write(STDOUT_FILENO, buff, tlen); -+ ret = write(STDOUT_FILENO, buff, tlen); - } - } - diff -up cdrkit-1.1.6/genisoimage/diag/dump.c.werror cdrkit-1.1.6/genisoimage/diag/dump.c ---- cdrkit-1.1.6/genisoimage/diag/dump.c.werror 2008-02-25 10:03:52.000000000 +0100 -+++ cdrkit-1.1.6/genisoimage/diag/dump.c 2008-02-25 10:03:52.000000000 +0100 +--- cdrkit-1.1.6/genisoimage/diag/dump.c.werror 2008-02-25 11:09:02.000000000 +0100 ++++ cdrkit-1.1.6/genisoimage/diag/dump.c 2008-02-25 11:09:02.000000000 +0100 @@ -366,9 +366,10 @@ main(int argc, char *argv[]) on_comerr((void(*)(int, void *))reset_tty, NULL); @@ -680,23 +288,274 @@ diff -up cdrkit-1.1.6/genisoimage/diag/dump.c.werror cdrkit-1.1.6/genisoimage/di while (search[strlen((char *)search)-1] == '\n') search[strlen((char *)search)-1] = 0; crsr2(20, 1); -diff -up cdrkit-1.1.6/genisoimage/write.c.werror cdrkit-1.1.6/genisoimage/write.c ---- cdrkit-1.1.6/genisoimage/write.c.werror 2008-02-25 10:03:52.000000000 +0100 -+++ cdrkit-1.1.6/genisoimage/write.c 2008-02-25 10:03:52.000000000 +0100 -@@ -918,8 +918,8 @@ reassign_link_addresses(struct directory +diff -up cdrkit-1.1.6/genisoimage/diag/isoinfo.c.werror cdrkit-1.1.6/genisoimage/diag/isoinfo.c +--- cdrkit-1.1.6/genisoimage/diag/isoinfo.c.werror 2008-02-25 11:09:02.000000000 +0100 ++++ cdrkit-1.1.6/genisoimage/diag/isoinfo.c 2008-02-25 11:09:02.000000000 +0100 +@@ -641,6 +641,7 @@ extract_file(struct iso_directory_record + len = isonum_733((unsigned char *)idr->size); + + while (len > 0) { ++ int ret; + #ifdef USE_SCG + readsecs(extent - sector_offset, buff, ISO_BLOCKS(sizeof (buff))); + tlen = (len > sizeof (buff) ? sizeof (buff) : len); +@@ -651,7 +652,7 @@ extract_file(struct iso_directory_record + #endif + len -= tlen; + extent++; +- write(STDOUT_FILENO, buff, tlen); ++ ret = write(STDOUT_FILENO, buff, tlen); + } + } + +diff -up cdrkit-1.1.6/genisoimage/diag/isovfy.c.werror cdrkit-1.1.6/genisoimage/diag/isovfy.c +--- cdrkit-1.1.6/genisoimage/diag/isovfy.c.werror 2008-02-25 11:09:02.000000000 +0100 ++++ cdrkit-1.1.6/genisoimage/diag/isovfy.c 2008-02-25 11:09:02.000000000 +0100 +@@ -583,6 +583,7 @@ check_path_tables(int typel_extent, int + char *pnt; + char *typel; + char *typem; ++ int ret; + + /* Now read in the path tables */ + +@@ -591,11 +592,11 @@ check_path_tables(int typel_extent, int + readsecs(typel_extent * blocksize / 2048, typel, ISO_BLOCKS(path_table_size)); + #else + lseek(fileno(infile), (off_t)((off_t)typel_extent) * blocksize, SEEK_SET); +- read(fileno(infile), typel, path_table_size); ++ ret = read(fileno(infile), typel, path_table_size); + #endif + typem = (char *) malloc(path_table_size); + lseek(fileno(infile), (off_t)((off_t)typem_extent) * blocksize, SEEK_SET); +- read(fileno(infile), typem, path_table_size); ++ ret = read(fileno(infile), typem, path_table_size); + + j = path_table_size; + pnt = typel; +diff -up cdrkit-1.1.6/include/libport.h.werror cdrkit-1.1.6/include/libport.h +--- cdrkit-1.1.6/include/libport.h.werror 2008-02-25 11:09:02.000000000 +0100 ++++ cdrkit-1.1.6/include/libport.h 2008-02-25 11:09:02.000000000 +0100 +@@ -67,9 +67,11 @@ + /* Linux MAXHOSTNAMELEN */ + #endif + #ifdef MAXHOSTNAMELEN ++#ifndef HOST_NAME_MAX + #define HOST_NAME_MAX MAXHOSTNAMELEN + #endif + #endif ++#endif + + #ifndef HOST_NAME_MAX + #define HOST_NAME_MAX 255 +diff -up cdrkit-1.1.6/libusal/scsi-linux-ata.c.werror cdrkit-1.1.6/libusal/scsi-linux-ata.c +--- cdrkit-1.1.6/libusal/scsi-linux-ata.c.werror 2008-02-25 11:09:02.000000000 +0100 ++++ cdrkit-1.1.6/libusal/scsi-linux-ata.c 2008-02-25 11:09:02.000000000 +0100 +@@ -258,7 +258,7 @@ openbydev: + starget, + slun; + +- f = sg_open_excl(device, O_RDONLY | O_NONBLOCK); ++ f = sg_open_excl(device, O_RDONLY | O_NONBLOCK, FALSE); + + if (f < 0) { + if (usalp->errstr) +@@ -770,11 +770,11 @@ sg_amapdev(SCSI *usalp, int f, char *dev + l = 0; + #endif /* nonono */ + /* other solution, with ioctl */ +- int Chan, +- Ino, +- Bus, +- Target, +- Lun; ++ int Chan = 0, ++ Ino = 0, ++ Bus = 0, ++ Target = 0, ++ Lun = 0; + + subsystem = HOST_SCSI; + sg_amapdev_scsi(usalp, f, &Bus, &Target, &Lun, &Chan, &Ino); +@@ -1008,7 +1008,7 @@ usalo_asend(SCSI *usalp) + } + + sg_cgc.buflen = sp->size; +- sg_cgc.buffer = sp->addr; ++ sg_cgc.buffer = (unsigned char *)sp->addr; + + if (sp->sense_len > sizeof (sense_cgc)) + sense_cgc.add_sense_len = sizeof (sense_cgc) - 8; +diff -up cdrkit-1.1.6/libusal/scsi-linux-sg.c.werror cdrkit-1.1.6/libusal/scsi-linux-sg.c +--- cdrkit-1.1.6/libusal/scsi-linux-sg.c.werror 2008-02-25 11:09:02.000000000 +0100 ++++ cdrkit-1.1.6/libusal/scsi-linux-sg.c 2008-02-25 11:14:41.000000000 +0100 +@@ -181,7 +181,7 @@ typedef struct { + struct usal_local { + int usalfile; /* Used for SG_GET_BUFSIZE ioctl()*/ + short usalfiles[MAX_SCG][MAX_TGT][MAX_LUN]; +- char *filenames[MAX_SCG][MAX_TGT][MAX_LUN]; ++ char *filenames[MAX_SCG][MAX_TGT][MAX_LUN]; + short buscookies[MAX_SCG]; + int pgbus; + int pack_id; /* Should be a random number */ +@@ -217,13 +217,6 @@ struct usal_local { + /*#define MISALIGN*/ + /*#undef SG_GET_BUFSIZE*/ + +-#if defined(USE_PG) && !defined(USE_PG_ONLY) +-#include "scsi-linux-pg.c" +-#endif +-#ifdef USE_OLD_ATAPI +-#include "scsi-linux-ata.c" +-#endif +- + + #ifdef MISALIGN + static int sg_getint(int *ip); +@@ -248,6 +241,12 @@ int sg_open_excl(char *device, int mo + + static BOOL get_max_secs(char *dirpath, int *outval); + ++#if defined(USE_PG) && !defined(USE_PG_ONLY) ++#include "scsi-linux-pg.c" ++#endif ++#ifdef USE_OLD_ATAPI ++#include "scsi-linux-ata.c" ++#endif + + BOOL check_linux_26() { + int gen, tmp; +@@ -465,9 +464,10 @@ usalo_open(SCSI *usalp, char *device) + for (b = 0; b < MAX_SCG; b++) { + usallocal(usalp)->buscookies[b] = (short)-1; + for (t = 0; t < MAX_TGT; t++) { +- for (l = 0; l < MAX_LUN; l++) ++ for (l = 0; l < MAX_LUN; l++) { + usallocal(usalp)->usalfiles[b][t][l] = (short)-1; + usallocal(usalp)->filenames[b][t][l] = NULL; ++ } + } + } + } +@@ -511,10 +511,9 @@ usalo_open(SCSI *usalp, char *device) + #define SCD 1 + #define SG 2 + int h; +-retry_scan_open: + for(h=HDX; h <= (fake_atabus ? HDX : SG) ; h++) { +- char *pattern; +- unsigned int first, last; ++ char *pattern = NULL; ++ unsigned int first = 0, last = 0; + switch(h) { + case(HDX): + { +@@ -792,7 +791,7 @@ sg_initdev(SCSI *usalp, int f) + for (i = 0; i < 1000; i++) { /* Read at least 32k from /dev/sg* */ + int ret; + +- ret = read(f, &sg_rep, sizeof (sg_rep)); ++ ret = read(f, &sg_rep, sizeof (struct sg_rep)); + if (ret > 0) + continue; + if (ret == 0 || errno == EAGAIN || errno == EIO) +@@ -984,12 +983,14 @@ sg_raisedma(SCSI *usalp, long newmax) + } + #endif + +-static void freadstring(char *fn, char *out, int len) { ++static char *freadstring(char *fn, char *out, int len) { ++ char *ret; + FILE *fd=fopen(fn, "r"); + out[0]='\0'; +- if(!fd) return; +- fgets(out, len, fd); ++ if(!fd) return NULL; ++ ret = fgets(out, len, fd); + fclose(fd); ++ return ret; + } + + static long +@@ -1017,14 +1018,13 @@ usalo_maxdma(SCSI *usalp, long amt) + major=stbuf.st_rdev>>8; + minor=stbuf.st_rdev&0xFF; + if (usalp->debug > 0) +- fprintf(stderr, "Looking for data for major:minor: %d:%d\n", major, minor); ++ fprintf(stderr, "Looking for data for major:minor: %ld:%ld\n", major, minor); + glob_t globbuf; + memset(&globbuf, 0, sizeof(glob_t)); + /* *dev files contain the major:minor strings to compare */ + glob("/sys/class/scsi_generic/*/device/block*/queue/max_sectors_kb", GLOB_DOOFFS | GLOB_NOSORT, NULL, &globbuf); + glob("/sys/block/*/device/block*/queue/max_sectors_kb", GLOB_DOOFFS | GLOB_NOSORT | GLOB_APPEND, NULL, &globbuf); + for(i=0;iops->usalo_isatapi)(usalp) + #define SCGO_RESET(usalp, what) (*(usalp)->ops->usalo_reset)(usalp, what) + ++extern int usal_fileno(SCSI *usalp, int busno, int tgt, int tlun); ++extern char * usal_natname(SCSI *usalp, int busno, int tgt, int tlun); + #ifdef __cplusplus + } + #endif +diff -up cdrkit-1.1.6/libusal/scsitransp.c.werror cdrkit-1.1.6/libusal/scsitransp.c +--- cdrkit-1.1.6/libusal/scsitransp.c.werror 2008-02-25 11:09:02.000000000 +0100 ++++ cdrkit-1.1.6/libusal/scsitransp.c 2008-02-25 11:09:02.000000000 +0100 +@@ -1154,7 +1154,7 @@ usal_sense_table(SCSI *usalp) + return (0); + + /* if (cp->sense.code >= 0x70) */ +- return (char *) &(cp->sense); ++ return (unsigned char *) &(cp->sense); + } - if (verbose > 2 && s_entry->size != 0) { - fprintf(stderr, "%8d %8d ", -- s_entry->starting_block, -- s_entry->starting_block + ISO_BLOCKS(s_entry->size) - 1); -+ (int)s_entry->starting_block, -+ (int)(s_entry->starting_block + ISO_BLOCKS(s_entry->size) - 1)); - if (s_entry->inode != TABLE_INODE) { - fprintf(stderr, "%s\n", s_entry->whole_name); diff -up cdrkit-1.1.6/librols/fexec.c.werror cdrkit-1.1.6/librols/fexec.c ---- cdrkit-1.1.6/librols/fexec.c.werror 2008-02-25 10:03:52.000000000 +0100 -+++ cdrkit-1.1.6/librols/fexec.c 2008-02-25 10:03:52.000000000 +0100 +--- cdrkit-1.1.6/librols/fexec.c.werror 2008-02-25 11:09:02.000000000 +0100 ++++ cdrkit-1.1.6/librols/fexec.c 2008-02-25 11:09:02.000000000 +0100 @@ -204,6 +204,8 @@ fexecve(name, in, out, err, av, env) int o[3]; int f[3]; @@ -706,21 +565,9 @@ diff -up cdrkit-1.1.6/librols/fexec.c.werror cdrkit-1.1.6/librols/fexec.c #endif fflush(out); -diff -up cdrkit-1.1.6/librols/default.c.werror cdrkit-1.1.6/librols/default.c ---- cdrkit-1.1.6/librols/default.c.werror 2008-02-25 10:03:52.000000000 +0100 -+++ cdrkit-1.1.6/librols/default.c 2008-02-25 10:03:52.000000000 +0100 -@@ -56,7 +56,7 @@ static char *get_value(FILE *srcfile, co - next_line: - while(fgets(linebuf, sizeof(linebuf)-1, srcfile)) { - int i; -- int keybeg; -+ int keybeg=0; - int s=KEYBEGINSEARCH; - char *ret=NULL; - int lastchar=0; diff -up cdrkit-1.1.6/librols/raisecond.c.werror cdrkit-1.1.6/librols/raisecond.c ---- cdrkit-1.1.6/librols/raisecond.c.werror 2008-02-25 10:03:52.000000000 +0100 -+++ cdrkit-1.1.6/librols/raisecond.c 2008-02-25 10:03:52.000000000 +0100 +--- cdrkit-1.1.6/librols/raisecond.c.werror 2008-02-25 11:09:02.000000000 +0100 ++++ cdrkit-1.1.6/librols/raisecond.c 2008-02-25 11:09:02.000000000 +0100 @@ -58,8 +58,8 @@ #ifndef STDERR_FILENO #define STDERR_FILENO 2 @@ -742,3 +589,200 @@ diff -up cdrkit-1.1.6/librols/raisecond.c.werror cdrkit-1.1.6/librols/raisecond. abort(); /* NOTREACHED */ } +diff -up cdrkit-1.1.6/librols/default.c.werror cdrkit-1.1.6/librols/default.c +--- cdrkit-1.1.6/librols/default.c.werror 2008-02-25 11:09:02.000000000 +0100 ++++ cdrkit-1.1.6/librols/default.c 2008-02-25 11:09:02.000000000 +0100 +@@ -56,7 +56,7 @@ static char *get_value(FILE *srcfile, co + next_line: + while(fgets(linebuf, sizeof(linebuf)-1, srcfile)) { + int i; +- int keybeg; ++ int keybeg=0; + int s=KEYBEGINSEARCH; + char *ret=NULL; + int lastchar=0; +diff -up cdrkit-1.1.6/libhfs_iso/hfs.h.werror cdrkit-1.1.6/libhfs_iso/hfs.h +--- cdrkit-1.1.6/libhfs_iso/hfs.h.werror 2008-02-25 11:09:02.000000000 +0100 ++++ cdrkit-1.1.6/libhfs_iso/hfs.h 2008-02-25 11:09:02.000000000 +0100 +@@ -29,6 +29,8 @@ + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ ++#ifndef HFS_H ++#define HFS_H + + #include + #include +@@ -195,8 +197,12 @@ int hfs_delete(hfsvol *, char *); + + int hfs_rename(hfsvol *, char *, char *); + ++int f_trunc(hfsfile *file); ++ + #ifdef APPLE_HYB + unsigned short hfs_get_drAllocPtr(hfsfile *); + int hfs_set_drAllocPtr(hfsfile *, unsigned short, int size); + void hfs_vsetbless(hfsvol *, unsigned long); + #endif /* APPLE_HYB */ ++ ++#endif +diff -up cdrkit-1.1.6/libhfs_iso/hfs.c.werror cdrkit-1.1.6/libhfs_iso/hfs.c +--- cdrkit-1.1.6/libhfs_iso/hfs.c.werror 2008-02-25 11:09:02.000000000 +0100 ++++ cdrkit-1.1.6/libhfs_iso/hfs.c 2008-02-25 11:09:02.000000000 +0100 +@@ -50,6 +50,7 @@ + #include "node.h" + #include "record.h" + #include "volume.h" ++#include "hfs.h" + + /* High-Level Volume Routines ============================================== */ + +diff -up cdrkit-1.1.6/wodim/drv_mmc.c.werror cdrkit-1.1.6/wodim/drv_mmc.c +--- cdrkit-1.1.6/wodim/drv_mmc.c.werror 2008-02-25 11:09:02.000000000 +0100 ++++ cdrkit-1.1.6/wodim/drv_mmc.c 2008-02-25 11:09:02.000000000 +0100 +@@ -59,6 +59,7 @@ + #include "scsimmc.h" + #include "mmcvendor.h" + #include "wodim.h" ++#include "scsi_scan.h" + + extern char *driveropts; + +@@ -165,6 +166,8 @@ static int do_tattoo_yamaha(SCSI *usalp + static int yamaha_write_buffer(SCSI *usalp, int mode, int bufferid, long offset, + long parlen, void *buffer, long buflen); + static int dvd_dual_layer_split(SCSI *usalp, cdr_t *dp, long tsize); ++extern int reserve_track(SCSI *usalp, Ulong size); ++extern int scsi_format(SCSI *usalp, caddr_t addr, int size, BOOL background); + + #ifdef __needed__ + static int +@@ -2851,9 +2854,9 @@ extern char *buf; + flush(); + } + if (formattype == FULL_FORMAT) { +- ret = scsi_format(usalp, &addr, sizeof(addr), FALSE); ++ ret = scsi_format(usalp, (caddr_t)&addr, sizeof(addr), FALSE); + } else { +- ret = scsi_format(usalp, &addr, sizeof(addr), TRUE); ++ ret = scsi_format(usalp, (caddr_t)&addr, sizeof(addr), TRUE); + } + if (ret < 0) + return (ret); +diff -up cdrkit-1.1.6/wodim/wodim.c.werror cdrkit-1.1.6/wodim/wodim.c +--- cdrkit-1.1.6/wodim/wodim.c.werror 2008-02-25 11:09:02.000000000 +0100 ++++ cdrkit-1.1.6/wodim/wodim.c 2008-02-25 11:09:02.000000000 +0100 +@@ -4076,6 +4076,7 @@ audioread(SCSI *usalp, cdr_t *dp, int fl + #ifdef DEBUG + int speed = 1; + int oflags = dp->cdr_cmdflags; ++ int ret; + + dp->cdr_cmdflags &= ~F_DUMMY; + if ((*dp->cdr_set_speed_dummy)(usalp, dp, &speed) < 0) +@@ -4089,7 +4090,7 @@ audioread(SCSI *usalp, cdr_t *dp, int fl + + read_scsi(usalp, buf, 1000, 1); + printf("XXX:\n"); +- write(1, buf, 512); ++ ret = write(1, buf, 512); + unload_media(usalp, dp, flags); + comexit(0); + #endif +diff -up cdrkit-1.1.6/wodim/scsi_cdr.c.werror cdrkit-1.1.6/wodim/scsi_cdr.c +--- cdrkit-1.1.6/wodim/scsi_cdr.c.werror 2008-02-25 11:09:02.000000000 +0100 ++++ cdrkit-1.1.6/wodim/scsi_cdr.c 2008-02-25 11:09:02.000000000 +0100 +@@ -63,6 +63,7 @@ + + #include "scsimmc.h" + #include "wodim.h" ++#include "scsi_scan.h" + + #define strbeg(s1, s2) (strstr((s2), (s1)) == (s2)) + +diff -up cdrkit-1.1.6/wodim/scsi_scan.c.werror cdrkit-1.1.6/wodim/scsi_scan.c +--- cdrkit-1.1.6/wodim/scsi_scan.c.werror 2008-02-25 11:09:02.000000000 +0100 ++++ cdrkit-1.1.6/wodim/scsi_scan.c 2008-02-25 11:09:02.000000000 +0100 +@@ -50,6 +50,9 @@ + #include + #include + #include ++#include ++#include ++ + + static void print_product(FILE *f, struct scsi_inquiry *ip); + int select_target(SCSI *usalp, FILE *f); +@@ -200,7 +203,7 @@ int list_devices(SCSI *usalp, FILE *f, i + int fd, ndevs=0; + struct stat statbuf; + char *lines[MAXDEVCOUNT]; +- char buf[256], perms[8], *p; ++ char buf[256], perms[8]; + + + usalp->silent++; +diff -up cdrkit-1.1.6/wodim/scsi_scan.h.werror cdrkit-1.1.6/wodim/scsi_scan.h +--- cdrkit-1.1.6/wodim/scsi_scan.h.werror 2008-02-25 11:09:02.000000000 +0100 ++++ cdrkit-1.1.6/wodim/scsi_scan.h 2008-02-25 11:09:02.000000000 +0100 +@@ -39,5 +39,6 @@ + extern int select_target(SCSI *usalp, FILE *f); + extern int list_devices(SCSI *usalp, FILE *f, int pickup_type); + extern SCSI * open_auto(int64_t need_size, int debug, int lverbose); ++extern int scsi_set_streaming(SCSI *usalp, caddr_t addr, int size); + + #endif /* _SCSI_SCAN_H */ +diff -up cdrkit-1.1.6/wodim/isosize.c.werror cdrkit-1.1.6/wodim/isosize.c +--- cdrkit-1.1.6/wodim/isosize.c.werror 2008-02-25 11:09:02.000000000 +0100 ++++ cdrkit-1.1.6/wodim/isosize.c 2008-02-25 11:09:02.000000000 +0100 +@@ -69,7 +69,8 @@ isosize(int f) + vp = (struct iso9660_pr_voldesc *) &vd; + + do { +- read(f, &vd, sizeof (vd)); ++ int ret; ++ ret = read(f, &vd, sizeof (vd)); + if (GET_UBYTE(vd.vd_type) == VD_PRIMARY) + break; + +diff -up cdrkit-1.1.6/icedax/toc.c.werror cdrkit-1.1.6/icedax/toc.c +--- cdrkit-1.1.6/icedax/toc.c.werror 2008-02-25 11:09:02.000000000 +0100 ++++ cdrkit-1.1.6/icedax/toc.c 2008-02-25 11:09:02.000000000 +0100 +@@ -864,7 +864,7 @@ int process_cddb_titles(int sock_fd, cha + int finished = 0; + char *p = inbuff; + int ind = 0; +- char ** target = (char **)&global.creator; ++ unsigned char ** target = &global.creator; + + do { + while (readbytes > 0) { +@@ -935,7 +935,7 @@ int process_cddb_titles(int sock_fd, cha + if (*target != NULL) + **target = '\0'; + } else { +- *target = realloc(*target, strlen(*target) + clen - 1); ++ *target = realloc(*target, strlen((char *)*target) + clen - 1); + } + if (*target != NULL) { + strcat((char *)*target, inbuff+ind+7); +@@ -943,7 +943,7 @@ int process_cddb_titles(int sock_fd, cha + + /* handle part after the delimiter, if present */ + if (res != NULL) { +- target = (char **)&global.disctitle; ++ target = (unsigned char **)&global.disctitle; + /* skip the delimiter */ + q += 3; + clen = p - q; +@@ -1070,8 +1070,9 @@ static int handle_userchoice(char *p, un + + /* get user response. */ + do { ++ int ret; + fprintf(stderr, "please choose one (0-%u): ", nr); +- scanf("%u", &user_choice); ++ ret = scanf("%u", &user_choice); + } while (user_choice > nr); + + if (user_choice == nr) diff --git a/cdrkit.spec b/cdrkit.spec index 651fdc1..b23ee56 100644 --- a/cdrkit.spec +++ b/cdrkit.spec @@ -1,7 +1,7 @@ Summary: A collection of CD/DVD utilities Name: cdrkit Version: 1.1.6 -Release: 9%{?dist} +Release: 10%{?dist} License: GPLv2 Group: Applications/System URL: http://cdrkit.org/ @@ -11,6 +11,7 @@ Patch1: genisoimage-dlength.patch Patch2: icedax-segfault.patch Patch3: wodim-prtypo.patch Patch4: cdrkit-1.1.6-oldsyn.patch +Patch5: cdrkit-1.1.6-werror.patch BuildRequires: cmake libcap-devel zlib-devel perl file-devel @@ -75,6 +76,7 @@ rates. Icedax can also be used as a CD player. %patch2 -p1 -b .segf %patch3 -p1 -b .prtypo %patch4 -p1 -b .oldsyn +%patch5 -p1 -b .werror find . -type f -print0 | xargs -0 perl -pi -e 's#/usr/local/bin/perl#/usr/bin/perl#g' find doc -type f -print0 | xargs -0 chmod a-x @@ -82,9 +84,9 @@ find doc -type f -print0 | xargs -0 chmod a-x %build mkdir fedora cd fedora -export CFLAGS="$RPM_OPT_FLAGS" -export CXXFLAGS="$RPM_OPT_FLAGS" -export FFLAGS="$RPM_OPT_FLAGS" +export CFLAGS="$RPM_OPT_FLAGS -Werror -Wno-unused-function -Wno-unused-variable" +export CXXFLAGS="$CFLAGS" +export FFLAGS="$CFLAGS" cmake .. \ -DCMAKE_INSTALL_PREFIX:PATH=%{_prefix} \ -DBUILD_SHARED_LIBS:BOOL=ON @@ -211,6 +213,9 @@ fi %{_mandir}/man1/readmult.* %changelog +* Mon Feb 25 2008 Harald Hoyer 1.1.6-10 +- patched to compile with -Werror (rhbz#429385) + * Thu Feb 21 2008 Harald Hoyer 1.1.6-9 - fixed loop on error message for old dev syntax (rhbz#429386)