Fossil SCM

Fix harmless compiler warnings in tar.c.

drh 2011-08-12 12:13 trunk
Commit 073725ae0cf983c683ad31d0cab8321ae846d4ce
1 file changed +7 -5
+7 -5
--- src/tar.c
+++ src/tar.c
@@ -201,11 +201,10 @@
201201
int split;
202202
203203
/* if this is a Pax Interchange header prepend "PaxHeader/"
204204
** so we can tell files apart from metadata */
205205
if( bHeader ){
206
- int n;
207206
blob_reset(&tball.pax);
208207
blob_appendf(&tball.pax, "PaxHeader/%*.*s", nName, nName, zName);
209208
zName = blob_buffer(&tball.pax);
210209
nName = blob_size(&tball.pax);
211210
}
@@ -288,15 +287,17 @@
288287
/* set mode and modification time */
289288
sqlite3_snprintf(8, (char*)&tball.aHdr[100], "%07o", iMode);
290289
sqlite3_snprintf(12, (char*)&tball.aHdr[136], "%011o", mTime);
291290
292291
/* see if we need to output a Pax Interchange Header */
293
- if( !is_iso646_name(zName, nName) ||
294
- !tar_split_path(zName, nName, tball.aHdr, &tball.aHdr[345]) ){
292
+ if( !is_iso646_name(zName, nName)
293
+ || !tar_split_path(zName, nName, (char*)tball.aHdr, (char*)&tball.aHdr[345])
294
+ ){
295295
int lastPage;
296296
/* add a file name for interoperability with older programs */
297
- approximate_split_path(zName, nName, tball.aHdr, &tball.aHdr[345], 1);
297
+ approximate_split_path(zName, nName, (char*)tball.aHdr,
298
+ (char*)&tball.aHdr[345], 1);
298299
299300
/* generate the Pax Interchange path header */
300301
blob_reset(&tball.pax);
301302
add_pax_header("path", zName, nName);
302303
@@ -311,11 +312,12 @@
311312
if( lastPage!=0 ){
312313
gzip_step(tball.zSpaces, 512 - lastPage);
313314
}
314315
315316
/* generate an approximate path for the regular header */
316
- approximate_split_path(zName, nName, tball.aHdr, &tball.aHdr[345], 0);
317
+ approximate_split_path(zName, nName, (char*)tball.aHdr,
318
+ (char*)&tball.aHdr[345], 0);
317319
}
318320
/* set the size */
319321
sqlite3_snprintf(12, (char*)&tball.aHdr[124], "%011o", iSize);
320322
321323
/* write the regular header */
322324
--- src/tar.c
+++ src/tar.c
@@ -201,11 +201,10 @@
201 int split;
202
203 /* if this is a Pax Interchange header prepend "PaxHeader/"
204 ** so we can tell files apart from metadata */
205 if( bHeader ){
206 int n;
207 blob_reset(&tball.pax);
208 blob_appendf(&tball.pax, "PaxHeader/%*.*s", nName, nName, zName);
209 zName = blob_buffer(&tball.pax);
210 nName = blob_size(&tball.pax);
211 }
@@ -288,15 +287,17 @@
288 /* set mode and modification time */
289 sqlite3_snprintf(8, (char*)&tball.aHdr[100], "%07o", iMode);
290 sqlite3_snprintf(12, (char*)&tball.aHdr[136], "%011o", mTime);
291
292 /* see if we need to output a Pax Interchange Header */
293 if( !is_iso646_name(zName, nName) ||
294 !tar_split_path(zName, nName, tball.aHdr, &tball.aHdr[345]) ){
 
295 int lastPage;
296 /* add a file name for interoperability with older programs */
297 approximate_split_path(zName, nName, tball.aHdr, &tball.aHdr[345], 1);
 
298
299 /* generate the Pax Interchange path header */
300 blob_reset(&tball.pax);
301 add_pax_header("path", zName, nName);
302
@@ -311,11 +312,12 @@
311 if( lastPage!=0 ){
312 gzip_step(tball.zSpaces, 512 - lastPage);
313 }
314
315 /* generate an approximate path for the regular header */
316 approximate_split_path(zName, nName, tball.aHdr, &tball.aHdr[345], 0);
 
317 }
318 /* set the size */
319 sqlite3_snprintf(12, (char*)&tball.aHdr[124], "%011o", iSize);
320
321 /* write the regular header */
322
--- src/tar.c
+++ src/tar.c
@@ -201,11 +201,10 @@
201 int split;
202
203 /* if this is a Pax Interchange header prepend "PaxHeader/"
204 ** so we can tell files apart from metadata */
205 if( bHeader ){
 
206 blob_reset(&tball.pax);
207 blob_appendf(&tball.pax, "PaxHeader/%*.*s", nName, nName, zName);
208 zName = blob_buffer(&tball.pax);
209 nName = blob_size(&tball.pax);
210 }
@@ -288,15 +287,17 @@
287 /* set mode and modification time */
288 sqlite3_snprintf(8, (char*)&tball.aHdr[100], "%07o", iMode);
289 sqlite3_snprintf(12, (char*)&tball.aHdr[136], "%011o", mTime);
290
291 /* see if we need to output a Pax Interchange Header */
292 if( !is_iso646_name(zName, nName)
293 || !tar_split_path(zName, nName, (char*)tball.aHdr, (char*)&tball.aHdr[345])
294 ){
295 int lastPage;
296 /* add a file name for interoperability with older programs */
297 approximate_split_path(zName, nName, (char*)tball.aHdr,
298 (char*)&tball.aHdr[345], 1);
299
300 /* generate the Pax Interchange path header */
301 blob_reset(&tball.pax);
302 add_pax_header("path", zName, nName);
303
@@ -311,11 +312,12 @@
312 if( lastPage!=0 ){
313 gzip_step(tball.zSpaces, 512 - lastPage);
314 }
315
316 /* generate an approximate path for the regular header */
317 approximate_split_path(zName, nName, (char*)tball.aHdr,
318 (char*)&tball.aHdr[345], 0);
319 }
320 /* set the size */
321 sqlite3_snprintf(12, (char*)&tball.aHdr[124], "%011o", iSize);
322
323 /* write the regular header */
324

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button