online update: Fix many warnings.
Not all yet, though. Change-Id: Ic4f0fe3ded31d585faefd8bda8ab87f54b88dc6c
This commit is contained in:
@@ -83,7 +83,7 @@
|
|||||||
# define MOZ_HAVE_NORETURN __attribute__((noreturn))
|
# define MOZ_HAVE_NORETURN __attribute__((noreturn))
|
||||||
# endif
|
# endif
|
||||||
#elif defined(__GNUC__)
|
#elif defined(__GNUC__)
|
||||||
# if defined(__GXX_EXPERIMENTAL_CXX0X__) || __cplusplus >= 201103L
|
# if defined(__GXX_EXPERIMENTAL_CXX0X__) || (defined(__cplusplus) && __cplusplus >= 201103L)
|
||||||
# define MOZ_HAVE_CXX11_CONSTEXPR
|
# define MOZ_HAVE_CXX11_CONSTEXPR
|
||||||
# if MOZ_GCC_VERSION_AT_LEAST(4, 8, 0)
|
# if MOZ_GCC_VERSION_AT_LEAST(4, 8, 0)
|
||||||
# define MOZ_HAVE_CXX11_CONSTEXPR_IN_TEMPLATES
|
# define MOZ_HAVE_CXX11_CONSTEXPR_IN_TEMPLATES
|
||||||
|
@@ -66,6 +66,8 @@ GetPasswordString(void *arg, char *prompt)
|
|||||||
char phrase[200] = {'\0'};
|
char phrase[200] = {'\0'};
|
||||||
int isInputTerminal = isatty(fileno(stdin));
|
int isInputTerminal = isatty(fileno(stdin));
|
||||||
|
|
||||||
|
(void) arg; (void) prompt; // avoid warnings
|
||||||
|
|
||||||
#ifndef _WINDOWS
|
#ifndef _WINDOWS
|
||||||
if (isInputTerminal) {
|
if (isInputTerminal) {
|
||||||
input = fopen(consoleName, "r");
|
input = fopen(consoleName, "r");
|
||||||
|
@@ -40,6 +40,8 @@ static int mar_test_callback(MarFile *mar, const MarItem *item, void *unused) {
|
|||||||
char buf[BLOCKSIZE];
|
char buf[BLOCKSIZE];
|
||||||
int fd, len, offset = 0;
|
int fd, len, offset = 0;
|
||||||
|
|
||||||
|
(void) unused; // avoid warnings
|
||||||
|
|
||||||
if (mar_ensure_parent_dir(item->name))
|
if (mar_ensure_parent_dir(item->name))
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
|
@@ -35,12 +35,12 @@ int mar_repackage_and_sign(const char *NSSConfigDir,
|
|||||||
const char *src,
|
const char *src,
|
||||||
const char * dest);
|
const char * dest);
|
||||||
|
|
||||||
static void print_version() {
|
static void print_version(void) {
|
||||||
printf("Version: %s\n", MOZ_APP_VERSION);
|
printf("Version: %s\n", MOZ_APP_VERSION);
|
||||||
printf("Default Channel ID: %s\n", MAR_CHANNEL_ID);
|
printf("Default Channel ID: %s\n", MAR_CHANNEL_ID);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void print_usage() {
|
static void print_usage(void) {
|
||||||
printf("usage:\n");
|
printf("usage:\n");
|
||||||
printf("Create a MAR file:\n");
|
printf("Create a MAR file:\n");
|
||||||
printf(" mar [-H MARChannelID] [-V ProductVersion] [-C workingDir] "
|
printf(" mar [-H MARChannelID] [-V ProductVersion] [-C workingDir] "
|
||||||
@@ -99,6 +99,8 @@ static void print_usage() {
|
|||||||
static int mar_test_callback(MarFile *mar,
|
static int mar_test_callback(MarFile *mar,
|
||||||
const MarItem *item,
|
const MarItem *item,
|
||||||
void *unused) {
|
void *unused) {
|
||||||
|
(void) mar; (void) unused; // avoid warnings
|
||||||
|
|
||||||
printf("%u\t0%o\t%s\n", item->length, item->flags, item->name);
|
printf("%u\t0%o\t%s\n", item->length, item->flags, item->name);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@@ -57,7 +57,7 @@ CryptoX_Result NSS_VerifySignature(VFYContext * const *ctx ,
|
|||||||
#define CryptoX_FreeCertificate(cert) \
|
#define CryptoX_FreeCertificate(cert) \
|
||||||
CERT_DestroyCertificate(*cert)
|
CERT_DestroyCertificate(*cert)
|
||||||
|
|
||||||
#elif MACOSX
|
#elif defined(MACOSX)
|
||||||
|
|
||||||
#define CryptoX_InvalidHandleValue NULL
|
#define CryptoX_InvalidHandleValue NULL
|
||||||
#define CryptoX_ProviderHandle void*
|
#define CryptoX_ProviderHandle void*
|
||||||
|
@@ -194,7 +194,6 @@ mar_extract_and_verify_signatures_fp(FILE *fp,
|
|||||||
CryptoX_ProviderHandle provider,
|
CryptoX_ProviderHandle provider,
|
||||||
CryptoX_PublicKey *keys,
|
CryptoX_PublicKey *keys,
|
||||||
uint32_t keyCount) {
|
uint32_t keyCount) {
|
||||||
char buf[5] = {0};
|
|
||||||
uint32_t signatureCount, signatureLen, numVerified = 0;
|
uint32_t signatureCount, signatureLen, numVerified = 0;
|
||||||
uint32_t signatureAlgorithmIDs[MAX_SIGNATURES];
|
uint32_t signatureAlgorithmIDs[MAX_SIGNATURES];
|
||||||
int rv = -1;
|
int rv = -1;
|
||||||
@@ -346,6 +345,8 @@ mar_verify_signatures_for_fp(FILE *fp,
|
|||||||
uint32_t i;
|
uint32_t i;
|
||||||
int rv = CryptoX_Error;
|
int rv = CryptoX_Error;
|
||||||
|
|
||||||
|
(void) provider; (void) keys; // avoid warnings
|
||||||
|
|
||||||
memset(signatureHandles, 0, sizeof(signatureHandles));
|
memset(signatureHandles, 0, sizeof(signatureHandles));
|
||||||
memset(signatureLengths, 0, sizeof(signatureLengths));
|
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* fileName,
|
||||||
const NS_tchar* alternateFileName,
|
const NS_tchar* alternateFileName,
|
||||||
bool append)
|
bool append)
|
||||||
@@ -26,14 +26,14 @@ void UpdateLog::Init(NS_tchar* sourcePath,
|
|||||||
if (logFP)
|
if (logFP)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
this->sourcePath = sourcePath;
|
sourcePath = sourcePathParam;
|
||||||
NS_tchar logFile[MAXPATHLEN];
|
NS_tchar logFile[MAXPATHLEN];
|
||||||
NS_tsnprintf(logFile, sizeof(logFile)/sizeof(logFile[0]),
|
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)) {
|
if (alternateFileName && NS_taccess(logFile, F_OK)) {
|
||||||
NS_tsnprintf(logFile, sizeof(logFile)/sizeof(logFile[0]),
|
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"));
|
logFP = NS_tfopen(logFile, append ? NS_T("a") : NS_T("w"));
|
||||||
|
@@ -83,7 +83,7 @@
|
|||||||
# define MOZ_HAVE_NORETURN __attribute__((noreturn))
|
# define MOZ_HAVE_NORETURN __attribute__((noreturn))
|
||||||
# endif
|
# endif
|
||||||
#elif defined(__GNUC__)
|
#elif defined(__GNUC__)
|
||||||
# if defined(__GXX_EXPERIMENTAL_CXX0X__) || __cplusplus >= 201103L
|
# if defined(__GXX_EXPERIMENTAL_CXX0X__) || (defined(__cplusplus) && __cplusplus >= 201103L)
|
||||||
# define MOZ_HAVE_CXX11_CONSTEXPR
|
# define MOZ_HAVE_CXX11_CONSTEXPR
|
||||||
# if MOZ_GCC_VERSION_AT_LEAST(4, 8, 0)
|
# if MOZ_GCC_VERSION_AT_LEAST(4, 8, 0)
|
||||||
# define MOZ_HAVE_CXX11_CONSTEXPR_IN_TEMPLATES
|
# 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];
|
char buf[BLOCKSIZE];
|
||||||
int fd, len, offset = 0;
|
int fd, len, offset = 0;
|
||||||
|
|
||||||
|
(void) unused; // avoid warnings
|
||||||
|
|
||||||
if (mar_ensure_parent_dir(item->name))
|
if (mar_ensure_parent_dir(item->name))
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
|
@@ -26,7 +26,7 @@ static GtkWidget *sProgressBar;
|
|||||||
static const char *sProgramPath;
|
static const char *sProgramPath;
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
UpdateDialog(gpointer data)
|
UpdateDialog(gpointer /*data*/)
|
||||||
{
|
{
|
||||||
if (sQuit)
|
if (sQuit)
|
||||||
{
|
{
|
||||||
@@ -43,7 +43,7 @@ UpdateDialog(gpointer data)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
OnDeleteEvent(GtkWidget *widget, GdkEvent *event, gpointer user_data)
|
OnDeleteEvent(GtkWidget * /*widget*/, GdkEvent * /*event*/, gpointer /*user_data*/)
|
||||||
{
|
{
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
@@ -64,7 +64,9 @@
|
|||||||
#define PROGRESS_FINISH_SIZE 5.0f
|
#define PROGRESS_FINISH_SIZE 5.0f
|
||||||
|
|
||||||
// Amount of time in ms to wait for the parent process to close
|
// Amount of time in ms to wait for the parent process to close
|
||||||
|
#ifdef WNT
|
||||||
#define PARENT_WAIT 5000
|
#define PARENT_WAIT 5000
|
||||||
|
#endif
|
||||||
|
|
||||||
#if defined(MACOSX)
|
#if defined(MACOSX)
|
||||||
// These functions are defined in launchchild_osx.mm
|
// These functions are defined in launchchild_osx.mm
|
||||||
@@ -72,10 +74,6 @@ void LaunchChild(int argc, char **argv);
|
|||||||
void LaunchMacPostProcess(const char* aAppBundle);
|
void LaunchMacPostProcess(const char* aAppBundle);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef _O_BINARY
|
|
||||||
# define _O_BINARY 0
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef NULL
|
#ifndef NULL
|
||||||
# define NULL (0)
|
# define NULL (0)
|
||||||
#endif
|
#endif
|
||||||
@@ -141,18 +139,12 @@ static bool sUseHardLinks = true;
|
|||||||
|
|
||||||
// This variable lives in libbz2. It's declared in bzlib_private.h, so we just
|
// 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.
|
// declare it here to avoid including that entire header file.
|
||||||
#define BZ2_CRC32TABLE_UNDECLARED
|
|
||||||
|
|
||||||
#if defined(HAVE_GCC_VISIBILITY_FEATURE)
|
#if defined(HAVE_GCC_VISIBILITY_FEATURE)
|
||||||
extern "C" __attribute__((visibility("default"))) unsigned int BZ2_crc32Table[256];
|
extern "C" __attribute__((visibility("default"))) unsigned int BZ2_crc32Table[256];
|
||||||
#undef BZ2_CRC32TABLE_UNDECLARED
|
|
||||||
#elif defined(__SUNPRO_C) || defined(__SUNPRO_CC)
|
#elif defined(__SUNPRO_C) || defined(__SUNPRO_CC)
|
||||||
extern "C" __global unsigned int BZ2_crc32Table[256];
|
extern "C" __global unsigned int BZ2_crc32Table[256];
|
||||||
#undef BZ2_CRC32TABLE_UNDECLARED
|
#else
|
||||||
#endif
|
|
||||||
#if defined(BZ2_CRC32TABLE_UNDECLARED)
|
|
||||||
extern "C" unsigned int BZ2_crc32Table[256];
|
extern "C" unsigned int BZ2_crc32Table[256];
|
||||||
#undef BZ2_CRC32TABLE_UNDECLARED
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static unsigned int
|
static unsigned int
|
||||||
@@ -1825,8 +1817,10 @@ LaunchCallbackApp(const NS_tchar *workingDir,
|
|||||||
}
|
}
|
||||||
|
|
||||||
#if defined(USE_EXECV)
|
#if defined(USE_EXECV)
|
||||||
|
(void) argc; (void) usingService; // avoid warnings
|
||||||
execv(argv[0], argv);
|
execv(argv[0], argv);
|
||||||
#elif defined(MACOSX)
|
#elif defined(MACOSX)
|
||||||
|
(void) usingService; // avoid warnings
|
||||||
LaunchChild(argc, argv);
|
LaunchChild(argc, argv);
|
||||||
#elif defined(WNT)
|
#elif defined(WNT)
|
||||||
// Do not allow the callback to run when running an update through the
|
// 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
|
// These files should not be copied over to the updated app
|
||||||
#ifdef WNT
|
#ifdef WNT
|
||||||
#define SKIPLIST_COUNT 3
|
#define SKIPLIST_COUNT 3
|
||||||
#elif MACOSX
|
#elif defined(MACOSX)
|
||||||
#define SKIPLIST_COUNT 0
|
#define SKIPLIST_COUNT 0
|
||||||
#else
|
#else
|
||||||
#define SKIPLIST_COUNT 2
|
#define SKIPLIST_COUNT 2
|
||||||
@@ -1992,7 +1986,7 @@ ProcessReplaceRequest()
|
|||||||
NS_tchar destDir[MAXPATHLEN];
|
NS_tchar destDir[MAXPATHLEN];
|
||||||
NS_tsnprintf(destDir, sizeof(destDir)/sizeof(destDir[0]),
|
NS_tsnprintf(destDir, sizeof(destDir)/sizeof(destDir[0]),
|
||||||
NS_T("%s/Contents"), gInstallDirPath);
|
NS_T("%s/Contents"), gInstallDirPath);
|
||||||
#elif WNT
|
#elif defined(WNT)
|
||||||
// Windows preserves the case of the file/directory names. We use the
|
// Windows preserves the case of the file/directory names. We use the
|
||||||
// GetLongPathName API in order to get the correct case for the directory
|
// 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
|
// 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
|
static void
|
||||||
UpdateThreadFunc(void *param)
|
UpdateThreadFunc(void * /*param*/)
|
||||||
{
|
{
|
||||||
// open ZIP archive and process...
|
// open ZIP archive and process...
|
||||||
int rv;
|
int rv;
|
||||||
|
Reference in New Issue
Block a user