Bug 579517 follow-up: Remove NSPR types that crept in
authorEhsan Akhgari <ehsan@mozilla.com>
Tue, 02 Apr 2013 20:59:27 -0400
changeset 138807 fb7aae8421bcbe2168ad311f25ecf8ef4134a30d
parent 138806 88288ea65ef8d6903cb062334fa48de0ef258280
child 138808 e0d063f04ee215165146043ce66975d7e3fd0cf0
push id350
push userbbajaj@mozilla.com
push dateMon, 29 Jul 2013 23:00:49 +0000
treeherdermozilla-release@064965b37dbd [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs579517
milestone23.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 579517 follow-up: Remove NSPR types that crept in
dom/base/nsGlobalWindow.cpp
dom/base/nsGlobalWindow.h
dom/bluetooth/linux/BluetoothDBusService.cpp
extensions/auth/nsAuthSSPI.cpp
hal/windows/WindowsGamepad.cpp
media/webrtc/signaling/src/sipcc/core/sdp/sdp_token.c
netwerk/base/src/nsUDPServerSocket.cpp
netwerk/protocol/http/nsHttpHandler.h
netwerk/test/TestUDPServerSocket.cpp
widget/cocoa/nsMacDockSupport.mm
xpcom/threads/TimerThread.cpp
--- a/dom/base/nsGlobalWindow.cpp
+++ b/dom/base/nsGlobalWindow.cpp
@@ -11219,31 +11219,31 @@ nsGlobalWindow::SizeOfIncludingThis(nsWi
     mEventTargetObjects.SizeOfExcludingThis(
       SizeOfEventTargetObjectsEntryExcludingThisFun,
       aWindowSizes->mMallocSizeOf);
 }
 
 
 #ifdef MOZ_GAMEPAD
 void
-nsGlobalWindow::AddGamepad(PRUint32 aIndex, nsDOMGamepad* aGamepad)
+nsGlobalWindow::AddGamepad(uint32_t aIndex, nsDOMGamepad* aGamepad)
 {
   FORWARD_TO_INNER_VOID(AddGamepad, (aIndex, aGamepad));
   mGamepads.Put(aIndex, aGamepad);
 }
 
 void
-nsGlobalWindow::RemoveGamepad(PRUint32 aIndex)
+nsGlobalWindow::RemoveGamepad(uint32_t aIndex)
 {
   FORWARD_TO_INNER_VOID(RemoveGamepad, (aIndex));
   mGamepads.Remove(aIndex);
 }
 
 already_AddRefed<nsDOMGamepad>
-nsGlobalWindow::GetGamepad(PRUint32 aIndex)
+nsGlobalWindow::GetGamepad(uint32_t aIndex)
 {
   FORWARD_TO_INNER(GetGamepad, (aIndex), nullptr);
   nsRefPtr<nsDOMGamepad> gamepad;
   if (mGamepads.Get(aIndex, getter_AddRefs(gamepad))) {
     return gamepad.forget();
   }
 
   return nullptr;
@@ -11260,17 +11260,17 @@ bool
 nsGlobalWindow::HasSeenGamepadInput()
 {
   FORWARD_TO_INNER(HasSeenGamepadInput, (), false);
   return mHasSeenGamepadInput;
 }
 
 // static
 PLDHashOperator
-nsGlobalWindow::EnumGamepadsForSync(const PRUint32& aKey, nsDOMGamepad* aData, void* userArg)
+nsGlobalWindow::EnumGamepadsForSync(const uint32_t& aKey, nsDOMGamepad* aData, void* userArg)
 {
   nsRefPtr<GamepadService> gamepadsvc(GamepadService::GetService());
   gamepadsvc->SyncGamepadState(aKey, aData);
   return PL_DHASH_NEXT;
 }
 
 void
 nsGlobalWindow::SyncGamepadState()
--- a/dom/base/nsGlobalWindow.h
+++ b/dom/base/nsGlobalWindow.h
@@ -612,23 +612,23 @@ public:
   void HandleIdleObserverCallback();
 
   void AllowScriptsToClose()
   {
     mAllowScriptsToClose = true;
   }
 
 #ifdef MOZ_GAMEPAD
-  void AddGamepad(PRUint32 aIndex, nsDOMGamepad* aGamepad);
-  void RemoveGamepad(PRUint32 aIndex);
-  already_AddRefed<nsDOMGamepad> GetGamepad(PRUint32 aIndex);
+  void AddGamepad(uint32_t aIndex, nsDOMGamepad* aGamepad);
+  void RemoveGamepad(uint32_t aIndex);
+  already_AddRefed<nsDOMGamepad> GetGamepad(uint32_t aIndex);
   void SetHasSeenGamepadInput(bool aHasSeen);
   bool HasSeenGamepadInput();
   void SyncGamepadState();
-  static PLDHashOperator EnumGamepadsForSync(const PRUint32& aKey,
+  static PLDHashOperator EnumGamepadsForSync(const uint32_t& aKey,
                                              nsDOMGamepad* aData,
                                              void* userArg);
 #endif
 
   // Enable/disable updates for gamepad input.
   void EnableGamepadUpdates();
   void DisableGamepadUpdates();
 
--- a/dom/bluetooth/linux/BluetoothDBusService.cpp
+++ b/dom/bluetooth/linux/BluetoothDBusService.cpp
@@ -138,17 +138,17 @@ static const char* sBluetoothDBusSignals
 /**
  * DBus Connection held for the BluetoothCommandThread to use. Should never be
  * used by any other thread.
  *
  */
 static nsAutoPtr<RawDBusConnection> gThreadConnection;
 static nsDataHashtable<nsStringHashKey, DBusMessage* > sPairingReqTable;
 static nsDataHashtable<nsStringHashKey, DBusMessage* > sAuthorizeReqTable;
-static PRInt32 sIsPairing = 0;
+static int32_t sIsPairing = 0;
 static nsString sAdapterPath;
 
 typedef void (*UnpackFunc)(DBusMessage*, DBusError*, BluetoothValue&, nsAString&);
 
 class RemoveDeviceTask : public nsRunnable {
 public:
   RemoveDeviceTask(const nsACString& aDeviceObjectPath,
                    BluetoothReplyRunnable* aRunnable)
--- a/extensions/auth/nsAuthSSPI.cpp
+++ b/extensions/auth/nsAuthSSPI.cpp
@@ -96,17 +96,17 @@ MakeSN(const char *principal, nsCString 
 {
     nsresult rv;
 
     nsAutoCString buf(principal);
 
     // The service name looks like "protocol@hostname", we need to map
     // this to a value that SSPI expects.  To be consistent with IE, we
     // need to map '@' to '/' and canonicalize the hostname.
-    PRInt32 index = buf.FindChar('@');
+    int32_t index = buf.FindChar('@');
     if (index == kNotFound)
         return NS_ERROR_UNEXPECTED;
     
     nsCOMPtr<nsIDNSService> dns = do_GetService(NS_DNSSERVICE_CONTRACTID, &rv);
     if (NS_FAILED(rv))
         return rv;
 
     // This could be expensive if our DNS cache cannot satisfy the request.
--- a/hal/windows/WindowsGamepad.cpp
+++ b/hal/windows/WindowsGamepad.cpp
@@ -27,17 +27,17 @@ namespace {
 using mozilla::dom::GamepadService;
 
 const LONG kMaxAxisValue = 65535;
 const DWORD BUTTON_DOWN_MASK = 0x80;
 // Multiple devices-changed notifications can be sent when a device
 // is connected, because USB devices consist of multiple logical devices.
 // Therefore, we wait a bit after receiving one before looking for
 // device changes.
-const PRUint32 kDevicesChangedStableDelay = 200;
+const uint32_t kDevicesChangedStableDelay = 200;
 
 typedef struct {
   float x,y;
 } HatState;
 
 struct Gamepad {
   // From DirectInput, unique to this device+computer combination.
   GUID guidInstance;
--- a/media/webrtc/signaling/src/sipcc/core/sdp/sdp_token.c
+++ b/media/webrtc/signaling/src/sipcc/core/sdp/sdp_token.c
@@ -55,19 +55,19 @@ sdp_result_e sdp_build_version (sdp_t *s
     flex_string_sprintf(fs, "v=%u\r\n", (u16)sdp_p->version);
 
     if (sdp_p->debug_flag[SDP_DEBUG_TRACE]) {
         SDP_PRINT("%s Built v= version line", sdp_p->debug_str);
     }
     return (SDP_SUCCESS);
 }
 
-static sdp_result_e sdp_verify_unsigned(const char *ptr, PRUint64 max_value)
+static sdp_result_e sdp_verify_unsigned(const char *ptr, uint64_t max_value)
 {
-    PRUint64 numeric_value;
+    uint64_t numeric_value;
     /* Checking for only numbers since PR_sscanf will ignore trailing
        characters */
     size_t end = strspn(ptr, "0123456789");
 
     if (ptr[end] != '\0')
         return SDP_INVALID_PARAMETER;
 
     if (PR_sscanf(ptr, "%llu", &numeric_value) != 1)
@@ -87,17 +87,17 @@ sdp_result_e sdp_parse_owner (sdp_t *sdp
     char         tmp[SDP_MAX_STRING_LEN];
     /* The spec says this:
 
         The numeric value of the session id
         and version in the o line MUST be representable with a 64 bit signed
         integer.  The initial value of the version MUST be less than
         (2**62)-1, to avoid rollovers.
     */
-    PRUint64     max_value_sessid_version = ((((PRUint64) 1) << 62) - 2);
+    uint64_t     max_value_sessid_version = ((((uint64_t) 1) << 62) - 2);
 
     if (sdp_p->owner_name[0] != '\0') {
         sdp_p->conf_p->num_invalid_token_order++;
         sdp_parse_error(sdp_p->peerconnection,
             "%s Warning: More than one o= line specified.",
             sdp_p->debug_str);
     }
 
--- a/netwerk/base/src/nsUDPServerSocket.cpp
+++ b/netwerk/base/src/nsUDPServerSocket.cpp
@@ -77,17 +77,17 @@ NS_IMETHODIMP nsUDPOutputStream::Flush()
 
 /* unsigned long write (in string aBuf, in unsigned long aCount); */
 NS_IMETHODIMP nsUDPOutputStream::Write(const char * aBuf, uint32_t aCount, uint32_t *_retval)
 {
   if (mIsClosed)
     return NS_BASE_STREAM_CLOSED;
 
   *_retval = 0;
-  PRInt32 count = PR_SendTo(mFD, aBuf, aCount, 0, &mPrClientAddr, PR_INTERVAL_NO_WAIT);
+  int32_t count = PR_SendTo(mFD, aBuf, aCount, 0, &mPrClientAddr, PR_INTERVAL_NO_WAIT);
   if (count < 0) {
     PRErrorCode code = PR_GetError();
     return ErrorAccordingToNSPR(code);
   }
 
   *_retval = count;
 
   mServer->AddOutputBytes(count);
--- a/netwerk/protocol/http/nsHttpHandler.h
+++ b/netwerk/protocol/http/nsHttpHandler.h
@@ -372,17 +372,17 @@ private:
     // if true allow referrer headers between secure non-matching hosts
     bool           mSendSecureXSiteReferrer;
 
     // Persistent HTTPS caching flag
     bool           mEnablePersistentHttpsCaching;
 
     // For broadcasting tracking preference
     bool           mDoNotTrackEnabled;
-    PRUint8        mDoNotTrackValue;
+    uint8_t        mDoNotTrackValue;
 
     // Whether telemetry is reported or not
     bool           mTelemetryEnabled;
 
     // The value of network.allow-experiments
     bool           mAllowExperiments;
 
     // true in between init and shutdown states
--- a/netwerk/test/TestUDPServerSocket.cpp
+++ b/netwerk/test/TestUDPServerSocket.cpp
@@ -72,17 +72,17 @@ UDPListener::OnPacketReceived(nsIUDPServ
   fromAddr->GetPort(&port);
   fromAddr->GetAddress(ip);
   passed("Packet received on server from %s:%d", ip.get(), port);
 
   nsCString data;
   message->GetData(data);
 
   const char* buffer = data.get();
-  PRUint32 len = data.Length();
+  uint32_t len = data.Length();
 
   uint32_t input = 0;
   for (uint32_t i = 0; i < len; i++) {
     input += buffer[i] << (8 * i);
   }
 
   if (len != sizeof(uint32_t) || input != REQUEST)
   {
--- a/widget/cocoa/nsMacDockSupport.mm
+++ b/widget/cocoa/nsMacDockSupport.mm
@@ -87,18 +87,18 @@ NS_IMETHODIMP
 nsMacDockSupport::GetBadgeText(nsAString& aBadgeText)
 {
   aBadgeText = mBadgeText;
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsMacDockSupport::SetProgressState(nsTaskbarProgressState aState,
-                                   PRUint64 aCurrentValue,
-                                   PRUint64 aMaxValue)
+                                   uint64_t aCurrentValue,
+                                   uint64_t aMaxValue)
 {
   NS_ENSURE_ARG_RANGE(aState, 0, STATE_PAUSED);
   if (aState == STATE_NO_PROGRESS || aState == STATE_INDETERMINATE) {
     NS_ENSURE_TRUE(aCurrentValue == 0, NS_ERROR_INVALID_ARG);
     NS_ENSURE_TRUE(aMaxValue == 0, NS_ERROR_INVALID_ARG);
   }
   if (aCurrentValue > aMaxValue) {
     return NS_ERROR_ILLEGAL_VALUE;
--- a/xpcom/threads/TimerThread.cpp
+++ b/xpcom/threads/TimerThread.cpp
@@ -268,17 +268,17 @@ NS_IMETHODIMP TimerThread::Run()
         //
         // Note that we can only sleep for integer values of a certain
         // resolution. We use halfMicrosecondsIntervalResolution, calculated
         // before, to do the optimal rounding (i.e., of how to decide what
         // interval is so small we should not wait at all).
         double microseconds = (timeout - now).ToMilliseconds()*1000;
         if (microseconds < halfMicrosecondsIntervalResolution)
           goto next; // round down; execute event now
-        waitFor = PR_MicrosecondsToInterval(static_cast<PRUint32>(microseconds)); // Floor is accurate enough.
+        waitFor = PR_MicrosecondsToInterval(static_cast<uint32_t>(microseconds)); // Floor is accurate enough.
         if (waitFor == 0)
           waitFor = 1; // round up, wait the minimum time we can wait
       }
 
 #ifdef DEBUG_TIMERS
       if (PR_LOG_TEST(GetTimerLog(), PR_LOG_DEBUG)) {
         if (waitFor == PR_INTERVAL_NO_TIMEOUT)
           PR_LOG(GetTimerLog(), PR_LOG_DEBUG,