Bug 730527 - Fix compiler warnings in APKOpen.cpp. r=glandium
authorChris Peterson <cpeterson@mozilla.com>
Fri, 24 Feb 2012 18:49:56 -0800
changeset 87752 c916138691f5e8c096e063ffabb37f9c5e84f9a8
parent 87751 3103ba9e861850a6bc51686a52aac88ac9f455aa
child 87753 a32cc7faa71a3943e147defdf39ca6f59b943ac4
push id22143
push userphilringnalda@gmail.com
push dateSun, 26 Feb 2012 23:12:35 +0000
treeherdermozilla-central@b98fc24ac54b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersglandium
bugs730527
milestone13.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 730527 - Fix compiler warnings in APKOpen.cpp. r=glandium
mozglue/android/APKOpen.cpp
--- a/mozglue/android/APKOpen.cpp
+++ b/mozglue/android/APKOpen.cpp
@@ -382,16 +382,17 @@ extractFile(const char * path, Zip::Stre
   /* We just extracted data that is going to be executed in the future.
    * We thus need to ensure Instruction and Data cache coherency. */
   cacheflush((unsigned) buf, (unsigned) buf + size, 0);
 #endif
   munmap(buf, size);
 }
 #endif
 
+#if defined(MOZ_CRASHREPORTER) || defined(MOZ_OLD_LINKER)
 static void
 extractLib(Zip::Stream &s, void * dest)
 {
   z_stream strm = {
     next_in: (Bytef *)s.GetBuffer(),
     avail_in: s.GetSize(),
     total_in: 0,
 
@@ -409,29 +410,32 @@ extractLib(Zip::Stream &s, void * dest)
   if (ret != Z_STREAM_END)
     __android_log_print(ANDROID_LOG_ERROR, "GeckoLibLoad", "inflate failed: %s", strm.msg);
 
   ret = inflateEnd(&strm);
   if (ret != Z_OK)
     __android_log_print(ANDROID_LOG_ERROR, "GeckoLibLoad", "inflateEnd failed: %s", strm.msg);
 
   if (strm.total_out != s.GetUncompressedSize())
-    __android_log_print(ANDROID_LOG_ERROR, "GeckoLibLoad", "File not fully uncompressed! %d / %d", strm.total_out, s.GetUncompressedSize());
+    __android_log_print(ANDROID_LOG_ERROR, "GeckoLibLoad", "File not fully uncompressed! %lu / %d", strm.total_out, s.GetUncompressedSize());
 }
+#endif
 
-static int cache_count = 0;
 static struct lib_cache_info *cache_mapping = NULL;
 
 NS_EXPORT const struct lib_cache_info *
 getLibraryCache()
 {
   return cache_mapping;
 }
 
 #ifdef MOZ_OLD_LINKER
+
+static int cache_count = 0;
+
 static void
 ensureLibCache()
 {
   if (!cache_mapping)
     cache_mapping = (struct lib_cache_info *)calloc(MAX_LIB_CACHE_ENTRIES,
                                                     sizeof(*cache_mapping));
 }
 
@@ -721,17 +725,17 @@ loadGeckoLibs(const char *apkName)
   GETFUNC(notifyListCreated);
   GETFUNC(notifyGotNextMessage);
   GETFUNC(notifyReadingMessageListFailed);
 #undef GETFUNC
   sStartupTimeline = (uint64_t *)__wrap_dlsym(xul_handle, "_ZN7mozilla15StartupTimeline16sStartupTimelineE");
   gettimeofday(&t1, 0);
   struct rusage usage2;
   getrusage(RUSAGE_THREAD, &usage2);
-  __android_log_print(ANDROID_LOG_ERROR, "GeckoLibLoad", "Loaded libs in %dms total, %dms user, %dms system, %d faults",
+  __android_log_print(ANDROID_LOG_ERROR, "GeckoLibLoad", "Loaded libs in %ldms total, %ldms user, %ldms system, %ld faults",
                       (t1.tv_sec - t0.tv_sec)*1000 + (t1.tv_usec - t0.tv_usec)/1000, 
                       (usage2.ru_utime.tv_sec - usage1.ru_utime.tv_sec)*1000 + (usage2.ru_utime.tv_usec - usage1.ru_utime.tv_usec)/1000,
                       (usage2.ru_stime.tv_sec - usage1.ru_stime.tv_sec)*1000 + (usage2.ru_stime.tv_usec - usage1.ru_stime.tv_usec)/1000,
                       usage2.ru_majflt-usage1.ru_majflt);
 
   StartupTimeline_Record(LINKER_INITIALIZED, &t0);
   StartupTimeline_Record(LIBRARIES_LOADED, &t1);
 }