diff options
author | Jan Holesovsky <kendy@collabora.com> | 2015-07-22 07:17:23 +0200 |
---|---|---|
committer | Jan Holesovsky <kendy@collabora.com> | 2015-07-22 07:18:36 +0200 |
commit | 8be5ec39051cc0eb70ec9882a45a95c661f7398f (patch) | |
tree | 01ea25c3d20dbb62d931fd77702a275e1c287f81 /onlineupdate/source/update | |
parent | b59955bf2124b558147033782bf067a3723e4730 (diff) |
online update: Fix many warnings.
Not all yet, though.
Change-Id: Ic4f0fe3ded31d585faefd8bda8ab87f54b88dc6c
Diffstat (limited to 'onlineupdate/source/update')
5 files changed, 17 insertions, 21 deletions
diff --git a/onlineupdate/source/update/common/updatelogging.cxx b/onlineupdate/source/update/common/updatelogging.cxx index 9ed8f3e8fcea..4044e26882bc 100644 --- a/onlineupdate/source/update/common/updatelogging.cxx +++ b/onlineupdate/source/update/common/updatelogging.cxx @@ -18,7 +18,7 @@ UpdateLog::UpdateLog() : logFP(nullptr) { } -void UpdateLog::Init(NS_tchar* sourcePath, +void UpdateLog::Init(NS_tchar* sourcePathParam, const NS_tchar* fileName, const NS_tchar* alternateFileName, bool append) @@ -26,14 +26,14 @@ void UpdateLog::Init(NS_tchar* sourcePath, if (logFP) return; - this->sourcePath = sourcePath; + sourcePath = sourcePathParam; NS_tchar logFile[MAXPATHLEN]; NS_tsnprintf(logFile, sizeof(logFile)/sizeof(logFile[0]), - NS_T("%s/%s"), sourcePath, fileName); + NS_T("%s/%s"), sourcePathParam, fileName); if (alternateFileName && NS_taccess(logFile, F_OK)) { NS_tsnprintf(logFile, sizeof(logFile)/sizeof(logFile[0]), - NS_T("%s/%s"), sourcePath, alternateFileName); + NS_T("%s/%s"), sourcePathParam, alternateFileName); } logFP = NS_tfopen(logFile, append ? NS_T("a") : NS_T("w")); diff --git a/onlineupdate/source/update/inc/mozilla/Attributes.h b/onlineupdate/source/update/inc/mozilla/Attributes.h index b34e7d5af07a..4d38632dbc4b 100644 --- a/onlineupdate/source/update/inc/mozilla/Attributes.h +++ b/onlineupdate/source/update/inc/mozilla/Attributes.h @@ -83,7 +83,7 @@ # define MOZ_HAVE_NORETURN __attribute__((noreturn)) # endif #elif defined(__GNUC__) -# if defined(__GXX_EXPERIMENTAL_CXX0X__) || __cplusplus >= 201103L +# if defined(__GXX_EXPERIMENTAL_CXX0X__) || (defined(__cplusplus) && __cplusplus >= 201103L) # define MOZ_HAVE_CXX11_CONSTEXPR # if MOZ_GCC_VERSION_AT_LEAST(4, 8, 0) # define MOZ_HAVE_CXX11_CONSTEXPR_IN_TEMPLATES diff --git a/onlineupdate/source/update/src/mar_extract.c b/onlineupdate/source/update/src/mar_extract.c index f3512e99122c..af2276614bdb 100644 --- a/onlineupdate/source/update/src/mar_extract.c +++ b/onlineupdate/source/update/src/mar_extract.c @@ -40,6 +40,8 @@ static int mar_test_callback(MarFile *mar, const MarItem *item, void *unused) { char buf[BLOCKSIZE]; int fd, len, offset = 0; + (void) unused; // avoid warnings + if (mar_ensure_parent_dir(item->name)) return -1; diff --git a/onlineupdate/source/update/updater/progressui_gtk.cxx b/onlineupdate/source/update/updater/progressui_gtk.cxx index 362b3ba5ba19..29ed219d9e35 100644 --- a/onlineupdate/source/update/updater/progressui_gtk.cxx +++ b/onlineupdate/source/update/updater/progressui_gtk.cxx @@ -26,7 +26,7 @@ static GtkWidget *sProgressBar; static const char *sProgramPath; static gboolean -UpdateDialog(gpointer data) +UpdateDialog(gpointer /*data*/) { if (sQuit) { @@ -43,7 +43,7 @@ UpdateDialog(gpointer data) } static gboolean -OnDeleteEvent(GtkWidget *widget, GdkEvent *event, gpointer user_data) +OnDeleteEvent(GtkWidget * /*widget*/, GdkEvent * /*event*/, gpointer /*user_data*/) { return TRUE; } diff --git a/onlineupdate/source/update/updater/updater.cxx b/onlineupdate/source/update/updater/updater.cxx index 1685995c6fdf..67773bdce36d 100644 --- a/onlineupdate/source/update/updater/updater.cxx +++ b/onlineupdate/source/update/updater/updater.cxx @@ -64,7 +64,9 @@ #define PROGRESS_FINISH_SIZE 5.0f // Amount of time in ms to wait for the parent process to close +#ifdef WNT #define PARENT_WAIT 5000 +#endif #if defined(MACOSX) // These functions are defined in launchchild_osx.mm @@ -72,10 +74,6 @@ void LaunchChild(int argc, char **argv); void LaunchMacPostProcess(const char* aAppBundle); #endif -#ifndef _O_BINARY -# define _O_BINARY 0 -#endif - #ifndef NULL # define NULL (0) #endif @@ -141,18 +139,12 @@ static bool sUseHardLinks = true; // This variable lives in libbz2. It's declared in bzlib_private.h, so we just // declare it here to avoid including that entire header file. -#define BZ2_CRC32TABLE_UNDECLARED - #if defined(HAVE_GCC_VISIBILITY_FEATURE) extern "C" __attribute__((visibility("default"))) unsigned int BZ2_crc32Table[256]; -#undef BZ2_CRC32TABLE_UNDECLARED #elif defined(__SUNPRO_C) || defined(__SUNPRO_CC) extern "C" __global unsigned int BZ2_crc32Table[256]; -#undef BZ2_CRC32TABLE_UNDECLARED -#endif -#if defined(BZ2_CRC32TABLE_UNDECLARED) +#else extern "C" unsigned int BZ2_crc32Table[256]; -#undef BZ2_CRC32TABLE_UNDECLARED #endif static unsigned int @@ -1825,8 +1817,10 @@ LaunchCallbackApp(const NS_tchar *workingDir, } #if defined(USE_EXECV) + (void) argc; (void) usingService; // avoid warnings execv(argv[0], argv); #elif defined(MACOSX) + (void) usingService; // avoid warnings LaunchChild(argc, argv); #elif defined(WNT) // Do not allow the callback to run when running an update through the @@ -1957,7 +1951,7 @@ CopyInstallDirToDestDir() // These files should not be copied over to the updated app #ifdef WNT #define SKIPLIST_COUNT 3 -#elif MACOSX +#elif defined(MACOSX) #define SKIPLIST_COUNT 0 #else #define SKIPLIST_COUNT 2 @@ -1992,7 +1986,7 @@ ProcessReplaceRequest() NS_tchar destDir[MAXPATHLEN]; NS_tsnprintf(destDir, sizeof(destDir)/sizeof(destDir[0]), NS_T("%s/Contents"), gInstallDirPath); -#elif WNT +#elif defined(WNT) // Windows preserves the case of the file/directory names. We use the // GetLongPathName API in order to get the correct case for the directory // name, so that if the user has used a different case when launching the @@ -2190,7 +2184,7 @@ GetUpdateFileName(NS_tchar *fileName, int maxChars) } static void -UpdateThreadFunc(void *param) +UpdateThreadFunc(void * /*param*/) { // open ZIP archive and process... int rv; |