Kaydet (Commit) 8be5ec39 authored tarafından Jan Holesovsky's avatar Jan Holesovsky

online update: Fix many warnings.

Not all yet, though.

Change-Id: Ic4f0fe3ded31d585faefd8bda8ab87f54b88dc6c
üst b59955bf
......@@ -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
......
......@@ -66,6 +66,8 @@ GetPasswordString(void *arg, char *prompt)
char phrase[200] = {'\0'};
int isInputTerminal = isatty(fileno(stdin));
(void) arg; (void) prompt; // avoid warnings
#ifndef _WINDOWS
if (isInputTerminal) {
input = fopen(consoleName, "r");
......
......@@ -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;
......
......@@ -35,12 +35,12 @@ int mar_repackage_and_sign(const char *NSSConfigDir,
const char *src,
const char * dest);
static void print_version() {
static void print_version(void) {
printf("Version: %s\n", MOZ_APP_VERSION);
printf("Default Channel ID: %s\n", MAR_CHANNEL_ID);
}
static void print_usage() {
static void print_usage(void) {
printf("usage:\n");
printf("Create a MAR file:\n");
printf(" mar [-H MARChannelID] [-V ProductVersion] [-C workingDir] "
......@@ -99,6 +99,8 @@ static void print_usage() {
static int mar_test_callback(MarFile *mar,
const MarItem *item,
void *unused) {
(void) mar; (void) unused; // avoid warnings
printf("%u\t0%o\t%s\n", item->length, item->flags, item->name);
return 0;
}
......
......@@ -57,7 +57,7 @@ CryptoX_Result NSS_VerifySignature(VFYContext * const *ctx ,
#define CryptoX_FreeCertificate(cert) \
CERT_DestroyCertificate(*cert)
#elif MACOSX
#elif defined(MACOSX)
#define CryptoX_InvalidHandleValue NULL
#define CryptoX_ProviderHandle void*
......
......@@ -194,7 +194,6 @@ mar_extract_and_verify_signatures_fp(FILE *fp,
CryptoX_ProviderHandle provider,
CryptoX_PublicKey *keys,
uint32_t keyCount) {
char buf[5] = {0};
uint32_t signatureCount, signatureLen, numVerified = 0;
uint32_t signatureAlgorithmIDs[MAX_SIGNATURES];
int rv = -1;
......@@ -346,6 +345,8 @@ mar_verify_signatures_for_fp(FILE *fp,
uint32_t i;
int rv = CryptoX_Error;
(void) provider; (void) keys; // avoid warnings
memset(signatureHandles, 0, sizeof(signatureHandles));
memset(signatureLengths, 0, sizeof(signatureLengths));
......
......@@ -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"));
......
......@@ -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
......
......@@ -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;
......
......@@ -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;
}
......
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment