]> git.mxchange.org Git - flightgear.git/commitdiff
fgadmin: fix compiler warnings
authorThorstenB <brehmt@gmail.com>
Sun, 18 Dec 2011 18:43:46 +0000 (19:43 +0100)
committerThorstenB <brehmt@gmail.com>
Sun, 18 Dec 2011 18:43:46 +0000 (19:43 +0100)
Also fixes mismatching "tarextract" declaration vs definition issue.

utils/fgadmin/src/fgadmin_funcs.cxx
utils/fgadmin/src/untarka.c
utils/fgadmin/src/untarka.h

index 642963597038951349b18e889633754821836890..82aacc0cbf73bd571a99ba6fb209999b70f3f2b6 100644 (file)
@@ -123,7 +123,7 @@ void FGAdminUI::select_install_dest() {
     }
 }
 
-
+#if 0
 // Like strcmp, but for strings
 static int stringCompare(const void *string1, const void *string2)
 {
@@ -133,7 +133,7 @@ static int stringCompare(const void *string1, const void *string2)
     // Compare name first, and then index.
     return strcmp(s1->c_str(), s2->c_str());
 }
-
+#endif
 
 void FGAdminUI::update_install_box() {
     set<string> file_list;
@@ -149,7 +149,8 @@ void FGAdminUI::update_install_box() {
             dirent *ent = list[i];
             strncpy( base, ent->d_name, FL_PATH_MAX );
             const char *p = fl_filename_ext( base );
-            int offset, expected_length = 0;
+            int offset;
+            string::size_type expected_length = 0;
             if ( strcmp( p, ".gz" ) == 0 ) {
                 offset = p - base;
                 base[offset] = '\0';
index 6a0bb78abe3218b72b3b4c5fe25582d30579df76..0b096784e261906c1d3a5ed5fe2e61428454e43b 100644 (file)
@@ -99,6 +99,8 @@
 #  endif
 #endif
 
+#include "untarka.h"
+
 static void error OF((const char *msg));
 
 static unsigned long total_read;
@@ -997,13 +999,12 @@ static void error(const char *msg) {
   exit(1);
 }
 
+#ifdef DOSISH
 /* This will give a benign warning */
-
 static char *TGZprefix[] = { "\0", ".tgz", ".tar.gz", ".tar.bz2", ".tar.Z", ".tar", NULL };
 
 /* Return the real name of the TGZ archive */
 /* or NULL if it does not exist. */
-
 static char *TGZfname OF((const char *fname))
 {
   static char buffer[1024];
@@ -1034,6 +1035,7 @@ static void TGZnotfound OF((const char *fname))
             TGZprefix[i]);
   exit(1);
 }
+#endif
 
 
 /* help functions */
@@ -1178,7 +1180,7 @@ static int tar (Readable* rin,int action,int arg,int argc,char **argv, char cons
   int    remaining = 0;
   FILE   *outfile = NULL;
   char   fname[BLOCKSIZE];
-  time_t tartime;
+  time_t tartime = 0;
   unsigned long last_read;
 
 #if 0
@@ -1359,6 +1361,7 @@ static int tar (Readable* rin,int action,int arg,int argc,char **argv, char cons
 }
 
 
+#ifdef DOSISH
 /* =========================================================== */
 
 static void help(int exitval)
@@ -1382,7 +1385,6 @@ static void help(int exitval)
 
 /* ====================================================================== */
 
-#ifdef DOSISH
 extern int _CRT_glob;
 int _CRT_glob = 0;     /* disable globbing of the arguments */
 #endif
@@ -1453,7 +1455,7 @@ int main(int argc,char **argv) {
 #endif
 
 void
-tarextract(char *TGZfile,char *dest,int verbose, void (*step)(void *), void *data)
+tarextract(char *TGZfile,char *dest,int verbose, void (*step)(void *,int), void *data)
 {
    Readable    r;
    if (xOpen4Read(&r,TGZfile) == 0)
index b895d0bbef9489508a668441cfed75464b708629..24dc8c6a14be0c5b12ebd98df985df9966535144 100644 (file)
@@ -1,10 +1,15 @@
-#include <string>
-
-using std::string;
-
 // list the contents of the specified tar file
 // bool tarlist( char *tarfile, char *destdir, bool verbose );
 
 // extract the specified tar file into the specified destination
 // directory
-extern "C" void tarextract( char *tarfile, char *destdir, int verbose, void (*step)(void*,int), void *data );
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void tarextract( char *tarfile, char *destdir, int verbose, void (*step)(void*,int), void *data );
+
+#ifdef __cplusplus
+}
+#endif
+