[Debburn-devel] [PATCH] misc gcc -Wall fixes

Lorenz Minder lminder at gmx.net
Wed Sep 27 21:35:54 UTC 2006


Hi,

the below patch fixes some compiler warnings with -Wall, like removing
unused variables. Those changes should be rather harmless and
straightforward.

(The "&perf_desc --> perf_desc" change is not really needed, but I find
the former very confusing.)

--Lorenz

Index: cdrecord/cdrecord.c
===================================================================
--- cdrecord/cdrecord.c	(revision 351)
+++ cdrecord/cdrecord.c	(working copy)
@@ -4773,7 +4781,6 @@
 	int	tflags;
 {
 	dstat_t	*dsp = dp->cdr_dstat;
-	int	profile;
 
 	if ((tflags & TI_PACKET) != 0) {
 		dsp->ds_wrmode = WM_PACKET;
Index: cdrecord/drv_mmc.c
===================================================================
--- cdrecord/drv_mmc.c	(revision 351)
+++ cdrecord/drv_mmc.c	(working copy)
@@ -242,14 +244,14 @@
          scsi_load,
          scsi_unload,
          read_buff_cap,
-         cmd_dummy,                              /* recovery_needed      */
-         (int(*)__PR((SCSI *, struct cdr_cmd*,int)))cmd_dummy,   /* recover              */
+         cmd_dummy,                              /* check_revcovery      */
+         (int(*)__PR((SCSI *, cdr_t *, int)))cmd_dummy,   /* recover              */
          speed_select_mdvd,
          select_secsize,
          next_wr_addr_mdvd,
          (int(*)__PR((SCSI *, Ulong)))cmd_ill,   /* reserve_track        */
          scsi_cdr_write,
-         (int(*)__PR((struct track*,void*,int)))cmd_dummy, /* gen_cue */
+         (int(*)__PR((track_t *, void *, BOOL))) cmd_dummy, /* gen_cue */
 	 (int(*)__PR((SCSI *scgp, cdr_t *, track_t *)))cmd_dummy, /* send_cue */
  	 write_leadin_mmc,
          open_track_mdvd,
@@ -635,7 +637,7 @@
 	if (profile >= 0) {
 		if (lverbose)
 			print_profiles(scgp);
-		if (profile == 0 || profile >= 0x10 && profile <= 0x15 || profile > 0x19) {
+		if (profile == 0 || (profile >= 0x10 && profile <= 0x15) || profile > 0x19) {
 		    /*
 		     * 10h DVD-ROM
 		     * 11h DVD-R
@@ -2059,10 +2065,8 @@
 	int	*speedp;
 {
   int retcode;
-  unsigned char perf_desc[28];
+  char perf_desc[28];
   int write_speed = *speedp * 1385;
-  int val = 0, val2 = 0;
-  int i;
    
   /* For the moment we just divide the CD speed by 7*/
 
@@ -2106,7 +2110,7 @@
   perf_desc[27] = 1000 & 0xFF;  
   
   /* retcode = scsi_set_streaming(scgp, NULL, 0); */
-  retcode = scsi_set_streaming(scgp, &perf_desc, sizeof(perf_desc));
+  retcode = scsi_set_streaming(scgp, perf_desc, sizeof(perf_desc));
   if (retcode == -1) return retcode;
   retcode = speed_select_mmc(scgp, dp, speedp);
   if(speedp!=NULL)
@@ -2557,7 +2561,6 @@
 	struct	cd_mode_page_05 *mp;
 	Ulong totalsize;
 	int i;
-	struct	track_info	track_info;
 	int profile;
 
 	fillbytes((caddr_t)mode, sizeof(mode), '\0');
@@ -2809,7 +2813,6 @@
 	BOOL	cdrrw	 = FALSE;	/* Read CD-RW	*/
 	BOOL	cdwrw	 = FALSE;	/* Write CD-RW	*/
 	int	ret;
-	int 	profile;
 
 	mmc_check(scgp, &cdrr, &cdwr, &cdrrw, &cdwrw, NULL, NULL);
 	if (!cdwrw)
@@ -4444,7 +4447,6 @@
 	long 	tsize;
 {
     unsigned char	xb[12];
-    int		i;
     long 	l0_size;
     
     /* Get the Layer 0 defined data zone*/
@@ -4462,10 +4464,10 @@
 	    error("track size smaller than one layer, use --force to force burning.");
 	    return 0;
 	}
-	printf("L0 size: %l (track size %l)\n", l0_size, tsize);
+	printf("L0 size: %ld (track size %ld)\n", l0_size, tsize);
 	l0_size = tsize / 2;
 	l0_size = l0_size - 1 + 16 - (l0_size - 1) % 16;
-	printf("New L0 size: %l\n", l0_size);
+	printf("New L0 size: %ld\n", l0_size);
 
 	memset (xb, 0, sizeof(xb));
 	xb[1]  = sizeof(xb) - 2;
Index: cdda2wav/toc.c
===================================================================
--- cdda2wav/toc.c	(revision 351)
+++ cdda2wav/toc.c	(working copy)
@@ -206,7 +206,6 @@
 }
 
 unsigned cdtracks = 0;
-static int have_hiddenAudioTrack = 0;
 
 int no_disguised_audiotracks()
 {
Index: cdda2wav/interface.c
===================================================================
--- cdda2wav/interface.c	(revision 351)
+++ cdda2wav/interface.c	(working copy)
@@ -451,8 +451,6 @@
 	struct stat *statstruct;
 	char *pdev_name;
 {
-    int is_scsi = 1;
-
 #if !defined (STAT_MACROS_BROKEN) || (STAT_MACROS_BROKEN != 1)
     if (!S_ISCHR(statstruct->st_mode) &&
 	!S_ISBLK(statstruct->st_mode)) {



More information about the Debburn-devel mailing list