Bug 997507 - Fix a few -Wformat warnings in nsIdleService.cpp. r=vlad
authorTed Mielczarek <ted@mielczarek.org>
Tue, 22 Apr 2014 11:02:36 -0400
changeset 198034 f322b1ac94a1029979e0bfe10c561274e3535aa4
parent 198033 96e274a243ff724979c24c72667d9ac752e618bb
child 198035 e2d226ed6926d0a7c3d01f2f00ef5f810426ea5b
push id3624
push userasasaki@mozilla.com
push dateMon, 09 Jun 2014 21:49:01 +0000
treeherdermozilla-beta@b1a5da15899a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersvlad
bugs997507
milestone31.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 997507 - Fix a few -Wformat warnings in nsIdleService.cpp. r=vlad
widget/xpwidgets/nsIdleService.cpp
--- a/widget/xpwidgets/nsIdleService.cpp
+++ b/widget/xpwidgets/nsIdleService.cpp
@@ -428,21 +428,21 @@ nsIdleService::AddIdleObserver(nsIObserv
 
   if (XRE_GetProcessType() == GeckoProcessType_Content) {
     dom::ContentChild* cpc = dom::ContentChild::GetSingleton();
     cpc->AddIdleObserver(aObserver, aIdleTimeInS);
     return NS_OK;
   }
 
   PR_LOG(sLog, PR_LOG_DEBUG,
-       ("idleService: Register idle observer %x for %d seconds",
+       ("idleService: Register idle observer %p for %d seconds",
         aObserver, aIdleTimeInS));
 #ifdef MOZ_WIDGET_ANDROID
   __android_log_print(ANDROID_LOG_INFO, "IdleService",
-                      "Register idle observer %x for %d seconds",
+                      "Register idle observer %p for %d seconds",
                       aObserver, aIdleTimeInS);
 #endif
 
   // Put the time + observer in a struct we can keep:
   IdleListener listener(aObserver, aIdleTimeInS);
 
   if (!mArrayListeners.AppendElement(listener)) {
     return NS_ERROR_OUT_OF_MEMORY;
@@ -498,33 +498,33 @@ nsIdleService::RemoveIdleObserver(nsIObs
   // little while.
   IdleListenerComparator c;
   nsTArray<IdleListener>::index_type listenerIndex = mArrayListeners.IndexOf(listener, 0, c);
   if (listenerIndex != mArrayListeners.NoIndex) {
     if (mArrayListeners.ElementAt(listenerIndex).isIdle)
       mIdleObserverCount--;
     mArrayListeners.RemoveElementAt(listenerIndex);
     PR_LOG(sLog, PR_LOG_DEBUG,
-           ("idleService: Remove observer %x (%d seconds), %d remain idle",
+           ("idleService: Remove observer %p (%d seconds), %d remain idle",
             aObserver, aTimeInS, mIdleObserverCount));
 #ifdef MOZ_WIDGET_ANDROID
     __android_log_print(ANDROID_LOG_INFO, "IdleService",
-                        "Remove observer %x (%d seconds), %d remain idle",
+                        "Remove observer %p (%d seconds), %d remain idle",
                         aObserver, aTimeInS, mIdleObserverCount);
 #endif
     return NS_OK;
   }
 
   // If we get here, we haven't removed anything:
   PR_LOG(sLog, PR_LOG_WARNING, 
-         ("idleService: Failed to remove idle observer %x (%d seconds)",
+         ("idleService: Failed to remove idle observer %p (%d seconds)",
           aObserver, aTimeInS));
 #ifdef MOZ_WIDGET_ANDROID
   __android_log_print(ANDROID_LOG_INFO, "IdleService",
-                      "Failed to remove idle observer %x (%d seconds)",
+                      "Failed to remove idle observer %p (%d seconds)",
                       aObserver, aTimeInS);
 #endif
   return NS_ERROR_FAILURE;
 }
 
 NS_IMETHODIMP
 nsIdleService::ResetIdleTimeOut(uint32_t idleDeltaInMS)
 {
@@ -584,21 +584,21 @@ nsIdleService::ResetIdleTimeOut(uint32_t
   // We need a text string to send with any state change events.
   nsAutoString timeStr;
 
   timeStr.AppendInt((int32_t)(idleDeltaInMS / PR_MSEC_PER_SEC));
 
   // Send the "non-idle" events.
   while (numberOfPendingNotifications--) {
     PR_LOG(sLog, PR_LOG_DEBUG,
-           ("idleService: Reset idle timeout: tell observer %x user is back",
+           ("idleService: Reset idle timeout: tell observer %p user is back",
             notifyList[numberOfPendingNotifications]));
 #ifdef MOZ_WIDGET_ANDROID
     __android_log_print(ANDROID_LOG_INFO, "IdleService",
-                        "Reset idle timeout: tell observer %x user is back",
+                        "Reset idle timeout: tell observer %p user is back",
                         notifyList[numberOfPendingNotifications]);
 #endif
     notifyList[numberOfPendingNotifications]->Observe(this,
                                                       OBSERVER_TOPIC_ACTIVE,
                                                       timeStr.get());
   }
   return NS_OK;
 }
@@ -768,21 +768,21 @@ nsIdleService::IdleTimerCallback(void)
 
   // We need a text string to send with any state change events.
   nsAutoString timeStr;
   timeStr.AppendInt(currentIdleTimeInS);
 
   // Notify all listeners that just timed out.
   while (numberOfPendingNotifications--) {
     PR_LOG(sLog, PR_LOG_DEBUG,
-           ("idleService: **** Idle timer callback: tell observer %x user is idle",
+           ("idleService: **** Idle timer callback: tell observer %p user is idle",
             notifyList[numberOfPendingNotifications]));
 #ifdef MOZ_WIDGET_ANDROID
   __android_log_print(ANDROID_LOG_INFO, "IdleService",
-                      "Idle timer callback: tell observer %x user is idle",
+                      "Idle timer callback: tell observer %p user is idle",
                       notifyList[numberOfPendingNotifications]);
 #endif
     notifyList[numberOfPendingNotifications]->Observe(this,
                                                       OBSERVER_TOPIC_IDLE,
                                                       timeStr.get());
   }
 }
 
@@ -887,21 +887,21 @@ nsIdleService::ReconfigureTimer(void)
 
   // Check if we should correct the timeout time because we should poll before.
   if ((mIdleObserverCount > 0) && UsePollMode()) {
     TimeStamp pollTimeout =
         curTime + TimeDuration::FromMilliseconds(MIN_IDLE_POLL_INTERVAL_MSEC);
 
     if (nextTimeoutAt > pollTimeout) {
       PR_LOG(sLog, PR_LOG_DEBUG,
-           ("idleService: idle observers, reducing timeout to %u msec from now",
+           ("idleService: idle observers, reducing timeout to %lu msec from now",
             MIN_IDLE_POLL_INTERVAL_MSEC));
 #ifdef MOZ_WIDGET_ANDROID
       __android_log_print(ANDROID_LOG_INFO, "IdleService",
-                          "idle observers, reducing timeout to %u msec from now",
+                          "idle observers, reducing timeout to %lu msec from now",
                           MIN_IDLE_POLL_INTERVAL_MSEC);
 #endif
       nextTimeoutAt = pollTimeout;
     }
   }
 
   SetTimerExpiryIfBefore(nextTimeoutAt);
 }