Package: dvdisaster / 0.79.5-10

17-fix-all-but-deprecated-api-warnings.patch Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
From: Carlos Maddela <e7appew@gmail.com>
Date: Thu, 22 Dec 2016 11:19:20 +1100
Subject: Fix all warnings except for those related to deprecated API.

Description: Fix all warnings except for those related to deprecated API.
Author: Carlos Maddela <e7appew@gmail.com>
Bug-Debian: https://bugs.debian.org/748416
Forwarded: no
Last-Update: 2017-01-05
---
This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
---
 closure.c     |  8 +++++---
 curve.c       |  2 +-
 menubar.c     |  2 +-
 rs01-create.c | 10 +++++-----
 rs01-verify.c |  2 +-
 rs03-create.c | 24 ++++++++++++------------
 rs03-fix.c    |  8 ++++----
 scsi-layer.c  |  4 ++++
 smart-lec.c   | 10 +++++-----
 9 files changed, 38 insertions(+), 32 deletions(-)

diff --git a/closure.c b/closure.c
index 51e91a2..40bb225 100644
--- a/closure.c
+++ b/closure.c
@@ -196,7 +196,7 @@ void ReadDotfile()
       /* Get first MAX_LINE_LEN bytes of line, discard the rest */
      
       line[MAX_LINE_LEN-1] = 1;
-      fgets(line, MAX_LINE_LEN, dotfile);
+      if(!fgets(line, MAX_LINE_LEN, dotfile)) break;
       if(!line[MAX_LINE_LEN-1])  /* line longer than buffer */
 	while(!feof(dotfile) && fgetc(dotfile) != '\n')
 	  ;
@@ -225,12 +225,14 @@ void ReadDotfile()
       if(!strcmp(symbol, "last-image"))      { g_free(Closure->imageName);
 	                                       if(!strcmp(value, "none"))
 						    Closure->imageName = g_strdup("");
-					       else Closure->imageName = g_strdup(value); continue; 
+					       else Closure->imageName = g_strdup(value);
+					       continue;
                                              }
       if(!strcmp(symbol, "last-ecc"))        { g_free(Closure->eccName);
 	                                       if(!strcmp(value, "none"))
 						    Closure->eccName = g_strdup("");
-                                               else Closure->eccName = g_strdup(value); continue; 
+                                               else Closure->eccName = g_strdup(value);
+					       continue;
                                              }
       if(!strcmp(symbol, "adaptive-read"))   { Closure->adaptiveRead   = atoi(value); continue; }
       if(!strcmp(symbol, "auto-suffix"))     { Closure->autoSuffix  = atoi(value); continue; }
diff --git a/curve.c b/curve.c
index 668bc40..61b81a9 100644
--- a/curve.c
+++ b/curve.c
@@ -123,7 +123,7 @@ int CurveLogY(Curve *curve, gdouble y) /* not really a log */
    hfact = (gdouble)(curve->bottomLY - curve->topLY);
  
    if(y==1) return curve->bottomLY - ((log(2)/log(curve->logMaxY)) * hfact)/2;
-            return curve->bottomLY - (log(y)/log(curve->logMaxY)) * hfact;
+   return curve->bottomLY - (log(y)/log(curve->logMaxY)) * hfact;
 }
 
 /***
diff --git a/menubar.c b/menubar.c
index 8258cfd..12f1933 100644
--- a/menubar.c
+++ b/menubar.c
@@ -414,7 +414,7 @@ void set_path(GtkWidget *entry, char *path)
    else
    {  char buf[PATH_MAX + strlen(path) + 2];
 
-      getcwd(buf, PATH_MAX);
+      if(!getcwd(buf, PATH_MAX)) return;
       strcat(buf,"/");
 
       strcat(buf,path);
diff --git a/rs01-create.c b/rs01-create.c
index 5cad591..88c352a 100644
--- a/rs01-create.c
+++ b/rs01-create.c
@@ -107,12 +107,12 @@ static void unlink_image(GtkWidget *label)
 		       _("\nImage file %s deleted.\n"), Closure->imageName);
    }
    else 
-   {  if(!Closure->guiMode)
-       PrintLog("\n");
+   {    if(!Closure->guiMode)
+	  PrintLog("\n");
 
-       ModalWarning(GTK_MESSAGE_ERROR, GTK_BUTTONS_OK, NULL,
-		    _("Image file %s not deleted: %s\n"),
-		    Closure->imageName, strerror(errno));
+        ModalWarning(GTK_MESSAGE_ERROR, GTK_BUTTONS_OK, NULL,
+		     _("Image file %s not deleted: %s\n"),
+		     Closure->imageName, strerror(errno));
    }
 }
 
diff --git a/rs01-verify.c b/rs01-verify.c
index 3315659..431a6d0 100644
--- a/rs01-verify.c
+++ b/rs01-verify.c
@@ -830,7 +830,7 @@ process_ecc:
       {  if(!Closure->guiMode)
 	      PrintProgress(_("- ecc md5sum       : %3d%%"),percent);
 	 else SetLabelText(GTK_LABEL(wl->cmpEccMd5Sum), "%3d%%", percent);
-	      last_percent = percent;
+	 last_percent = percent;
       }
 
       if(Closure->stopActions)   
diff --git a/rs03-create.c b/rs03-create.c
index 40066d2..b2c6033 100644
--- a/rs03-create.c
+++ b/rs03-create.c
@@ -31,9 +31,9 @@
 
 //#define VERBOSE 1
 #ifdef VERBOSE
-  #define verbose(format,args...) printf(format, ## args)
+  #define verbose(format,...) printf(format, __VA_ARGS__)
 #else
-  #define verbose(format,args...)
+  #define verbose(format,...)
 #endif
 
 #ifdef HAVE_MMAP
@@ -688,7 +688,7 @@ static void flush_crc(ecc_closure *ec, LargeFile *file_out)
 
    /* Write out the CRC layer */
       
-   verbose("IO: writing CRC layer\n");
+   verbose("%s", "IO: writing CRC layer\n");
    crc_sect = 2048*(ec->encoderChunk+lay->firstCrcPos);
    if(!LargeSeek(file_out, crc_sect))
    {  ec->abortImmediately = TRUE;
@@ -709,7 +709,7 @@ static void flush_parity(ecc_closure *ec, LargeFile *file_out)
 
    /* Write out the created parity. */
 
-   verbose("IO: writing parity...\n");
+   verbose("%s", "IO: writing parity...\n");
    for(k=0; k<lay->nroots; k++)
    {  gint64 idx=0;
 
@@ -726,7 +726,7 @@ static void flush_parity(ecc_closure *ec, LargeFile *file_out)
 	 }
       }
    }
-   verbose("IO: parity written.\n");
+   verbose("%s", "IO: parity written.\n");
 }
 
 static gpointer io_thread(ecc_closure *ec)
@@ -741,7 +741,7 @@ static gpointer io_thread(ecc_closure *ec)
    int parity_available = 0;
    int i;
 
-   verbose("Reader thread initializing\n");
+   verbose("%s", "Reader thread initializing\n");
 
    /*** Allocate local parity buffer aligned at 128bit boundary */
 
@@ -809,7 +809,7 @@ static gpointer io_thread(ecc_closure *ec)
       {  read_next_chunk(ec, chunk);
 	 //	 flush_crc(ec, file_out);  // FIXME
 	 needs_preload = 0;
-	 verbose("IO: first chunk loaded\n");
+	 verbose("%s", "IO: first chunk loaded\n");
 	 continue;
       }
 
@@ -856,7 +856,7 @@ static gpointer io_thread(ecc_closure *ec)
       g_mutex_lock(ec->lock);
       cpu_bound = ec->buffersToEncode;
       while(ec->buffersToEncode)
-      {  verbose("IO: Waiting for encoders to finish\n");
+      {  verbose("%s", "IO: Waiting for encoders to finish\n");
 	 g_cond_wait(ec->ioCond, ec->lock);
       }
       g_mutex_unlock(ec->lock);
@@ -898,7 +898,7 @@ static gpointer io_thread(ecc_closure *ec)
    ec->slicesFree = TRUE;  /* we have saved the slices; go ahead */
    g_cond_broadcast(ec->ioCond);
    while(ec->buffersToEncode)
-   {  verbose("IO: Waiting for encoders to finish last chunk\n");
+   {  verbose("%s", "IO: Waiting for encoders to finish last chunk\n");
       g_cond_wait(ec->ioCond, ec->lock);
    }
    g_mutex_unlock(ec->lock);
@@ -911,7 +911,7 @@ static gpointer io_thread(ecc_closure *ec)
    flush_crc(ec, file_out);
    flush_parity(ec, file_out);
 
-   verbose("IO: finished\n"); fflush(stdout);
+   verbose("%s", "IO: finished\n"); fflush(stdout);
    return NULL;
 }
 
@@ -1098,7 +1098,7 @@ static gpointer encoder_thread(ecc_closure *ec)
       ec->buffersToEncode-=enc_size;
       if(!ec->buffersToEncode)
       {  g_cond_broadcast(ec->ioCond);
-	 verbose("ENC: processed last buffer; telling IO process.\n");
+	 verbose("%s", "ENC: processed last buffer; telling IO process.\n");
 	 fflush(stdout);
       }
       g_mutex_unlock(ec->lock);
@@ -1198,7 +1198,7 @@ static void create_reed_solomon(ecc_closure *ec)
       verbose("SCHED: joined with worker %d\n", i);
       fflush(stdout);
    }
-   verbose("SCHED: scheduler finished.\n");
+   verbose("%s", "SCHED: scheduler finished.\n");
 }
 
 /***
diff --git a/rs03-fix.c b/rs03-fix.c
index 0a7a1d3..e162e5e 100644
--- a/rs03-fix.c
+++ b/rs03-fix.c
@@ -829,10 +829,10 @@ void RS03Fix(Image *image)
 	      if we were processing an augmented image. */
 
 	   if(lay->target == ECC_FILE && i >= ndata-1)
-	   {  
-              if(!LargeSeek(image->eccFile, (gint64)(2048*sec)))
-		 Stop(_("Failed seeking to sector %lld in ecc file [%s]: %s"),
-		      sec, "FW", strerror(errno));
+	   {
+		 if(!LargeSeek(image->eccFile, (gint64)(2048*sec)))
+		    Stop(_("Failed seeking to sector %lld in ecc file [%s]: %s"),
+			 sec, "FW", strerror(errno));
 
 		 n = LargeWrite(image->eccFile, cache_offset+fc->imgBlock[i], 2048);
 		 if(n != 2048)
diff --git a/scsi-layer.c b/scsi-layer.c
index 64a3dba..3be21ff 100644
--- a/scsi-layer.c
+++ b/scsi-layer.c
@@ -31,7 +31,9 @@
 
 static int query_type(DeviceHandle*, int);
 static gint64 query_size(Image*);
+#if 0
 static int query_copyright(DeviceHandle*);
+#endif
 
 static int read_dvd_sector(DeviceHandle*, unsigned char*, int, int);
 static int read_cd_sector(DeviceHandle*, unsigned char*, int, int);
@@ -1649,6 +1651,7 @@ reset_mode_page:
  * Find out whether we are allowed to create an image from the DVD.
  */
 
+#if 0
 static int query_copyright(DeviceHandle *dh)
 {  Sense sense;
    AlignedBuffer *ab = CreateAlignedBuffer(2048);
@@ -1709,6 +1712,7 @@ static int query_copyright(DeviceHandle *dh)
 
    return result;
 }
+#endif
 
 /*
  * See whether a sector lies within the user area.
diff --git a/smart-lec.c b/smart-lec.c
index 8da74ff..0355879 100644
--- a/smart-lec.c
+++ b/smart-lec.c
@@ -27,9 +27,9 @@
 
 #define VERBOSE 1
 #ifdef VERBOSE
-  #define verbose(format,args...) printf(format, ## args)
+  #define verbose(format,...) printf(format, __VA_ARGS__)
 #else
-  #define verbose(format,args...)
+  #define verbose(format,...)
 #endif
 
 /***
@@ -432,7 +432,7 @@ static void update_pq_state(sh_context *shc)
 static void print_pq_state(sh_context *shc)
 {  int i;
 
-   verbose("PQ states: \n");
+   verbose("%s", "PQ states: \n");
 
    for(i=0; i<N_P_VECTORS; i++)
    {  if(shc->pState[i] == 1)
@@ -1354,7 +1354,7 @@ static void swap_p_for_new_improvement(sh_context *shc)
 		  count++;
 
 	    if(count < 2)
-	    {  verbose(" pruned");
+	    {  verbose("%s", " pruned");
 	       goto decrement;
 	    }
 
@@ -1417,7 +1417,7 @@ decrement:
 	    if(index >= n_q) break;
 	    selection[index]=0;
 
-	    verbose("\n");
+	    verbose("%s", "\n");
 	 }
       }
    }