[file-roller] archive: fix compiler warnings



commit a904ade4c4e1d81450f678cda0e9fd32ce8496f8
Author: Aleksander Morgado <aleksander lanedo com>
Date:   Thu Sep 26 16:11:30 2013 +0200

    archive: fix compiler warnings
    
    Compiler doesn't seem to understand that 'ra' is only used after checking that
    'load_data->error == NULL'. Just silence the error initializing the variables.
    
       fr-archive-libarchive.c: In function ‘save_archive_thread’:
       fr-archive-libarchive.c:1417:40: warning: ‘ra’ may be used uninitialized in this function 
[-Wmaybe-uninitialized]
         if ((load_data->error == NULL) && (ra != ARCHIVE_EOF))
    
    https://bugzilla.gnome.org/show_bug.cgi?id=708839

 src/fr-archive-libarchive.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/src/fr-archive-libarchive.c b/src/fr-archive-libarchive.c
index 37e3008..42673df 100644
--- a/src/fr-archive-libarchive.c
+++ b/src/fr-archive-libarchive.c
@@ -1335,7 +1335,7 @@ save_archive_thread (GSimpleAsyncResult *result,
        LoadData             *load_data;
        struct archive       *a, *b;
        struct archive_entry *r_entry;
-       int                   ra, rb;
+       int                   ra = ARCHIVE_OK, rb = ARCHIVE_OK;
 
        save_data = g_simple_async_result_get_op_res_gpointer (result);
        load_data = LOAD_DATA (save_data);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]