Bug 944907 - Fixed char16_t/wchar_t mismatch in netwerk/. r=mcmanus
authorJacek Caban <jacek@codeweavers.com>
Tue, 03 Dec 2013 15:54:59 +0100
changeset 174214 e8925e8c0f00a080bb4680b9b76e85495dcb85c7
parent 174213 debee75c3c1cbd98f58a804ea12edd78072249f5
child 174215 a41081c1026cba02882bcf4b7dac84441dc05889
push id445
push userffxbld
push dateMon, 10 Mar 2014 22:05:19 +0000
treeherdermozilla-release@dc38b741b04e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmcmanus
bugs944907
milestone28.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 944907 - Fixed char16_t/wchar_t mismatch in netwerk/. r=mcmanus
netwerk/base/src/nsAutodialWin.cpp
netwerk/base/src/nsAutodialWin.h
netwerk/protocol/wyciwyg/nsWyciwygChannel.cpp
--- a/netwerk/base/src/nsAutodialWin.cpp
+++ b/netwerk/base/src/nsAutodialWin.cpp
@@ -331,17 +331,17 @@ bool nsAutodial::IsRASConnected()
         return (connections > 0);
     }
 
     LOGE(("Autodial: ::RasEnumConnections failed: Error = %d", result));
     return false;
 }
 
 // Get the first RAS dial entry name from the phonebook.
-nsresult nsAutodial::GetFirstEntryName(PRUnichar* entryName, int bufferSize)
+nsresult nsAutodial::GetFirstEntryName(wchar_t* entryName, int bufferSize)
 {
     RASENTRYNAMEW rasEntryName;
     rasEntryName.dwSize = sizeof(rasEntryName);
     DWORD cb = sizeof(rasEntryName);
     DWORD cEntries = 0;
 
     DWORD result = 
      RasEnumEntriesW(nullptr, nullptr, &rasEntryName, &cb, &cEntries);
@@ -374,17 +374,17 @@ int nsAutodial::NumRASEntries()
     {
         return (int)cEntries;
     }
 
     return 0;
 }
 
 // Get the name of the default dial entry.
-nsresult nsAutodial::GetDefaultEntryName(PRUnichar* entryName, int bufferSize)
+nsresult nsAutodial::GetDefaultEntryName(wchar_t* entryName, int bufferSize)
 {
     // No RAS dialup entries. 
     if (mNumRASConnectionEntries <= 0)
     {
         return NS_ERROR_FAILURE;
     }
 
     // Single RAS dialup entry. Use it as the default to autodial.
@@ -394,18 +394,18 @@ nsresult nsAutodial::GetDefaultEntryName
     }
 
     // Multiple RAS dialup entries. If a default configured in the registry,
     // use it. 
     //
     // For Windows XP: HKCU/Software/Microsoft/RAS Autodial/Default/DefaultInternet.
     //              or HKLM/Software/Microsoft/RAS Autodial/Default/DefaultInternet.
 
-    const PRUnichar* key = L"Software\\Microsoft\\RAS Autodial\\Default";
-    const PRUnichar* val = L"DefaultInternet";
+    const wchar_t* key = L"Software\\Microsoft\\RAS Autodial\\Default";
+    const wchar_t* val = L"DefaultInternet";
 
     HKEY hKey = 0;
     LONG result = 0;
 
     
     // Try HKCU first.
     result = ::RegOpenKeyExW(
                 HKEY_CURRENT_USER, 
@@ -487,17 +487,17 @@ bool nsAutodial::IsAutodialServiceRunnin
 
         return false;
     }
 
     return (status.dwCurrentState == SERVICE_RUNNING);
 }
 
 // Add the specified address to the autodial directory.
-bool nsAutodial::AddAddressToAutodialDirectory(const PRUnichar* hostName)
+bool nsAutodial::AddAddressToAutodialDirectory(char16ptr_t hostName)
 {
     // First see if there is already a db entry for this address. 
     RASAUTODIALENTRYW autodialEntry;
     autodialEntry.dwSize = sizeof(autodialEntry);
     DWORD size = sizeof(autodialEntry);
     DWORD entries = 0;
 
     DWORD result = RasGetAutodialAddressW(hostName, 
--- a/netwerk/base/src/nsAutodialWin.h
+++ b/netwerk/base/src/nsAutodialWin.h
@@ -45,29 +45,29 @@ private:
 
     // Determine if the autodial service is running on this PC.
     bool IsAutodialServiceRunning();
 
     // Get the number of RAS connection entries configured from the OS.
     int NumRASEntries();
 
     // Get the name of the default connection from the OS.
-    nsresult GetDefaultEntryName(PRUnichar* entryName, int bufferSize);
+    nsresult GetDefaultEntryName(wchar_t* entryName, int bufferSize);
 
     // Get the name of the first RAS dial entry from the OS.
-    nsresult GetFirstEntryName(PRUnichar* entryName, int bufferSize);
+    nsresult GetFirstEntryName(wchar_t* entryName, int bufferSize);
 
     // Check to see if RAS already has a dialup connection going.
     bool IsRASConnected();
 
     // Get the autodial behavior from the OS.
     int QueryAutodialBehavior();
 
     // Add the specified address to the autodial directory.
-    bool AddAddressToAutodialDirectory(const PRUnichar* hostName);
+    bool AddAddressToAutodialDirectory(char16ptr_t hostName);
 
     // Get the  current TAPI dialing location.
     int GetCurrentLocation();
 
     // See if autodial is enabled for specified location.
     bool IsAutodialServiceEnabled(int location);
 
     //
@@ -83,17 +83,17 @@ private:
     enum { AUTODIAL_ALWAYS = 2 };           // Always autodial as set in Internet Options.
     enum { AUTODIAL_ON_NETWORKERROR = 3 };  // Autodial when a connection error occurs as set in Internet Options.
     enum { AUTODIAL_USE_SERVICE = 4 };      // Use the RAS autodial service to dial.
 
     // Number of RAS connection entries in the phonebook. 
     int mNumRASConnectionEntries;
 
     // Default connection entry name.
-    PRUnichar mDefaultEntryName[RAS_MaxEntryName + 1];  
+    wchar_t mDefaultEntryName[RAS_MaxEntryName + 1];
 
     // Don't try to dial again within a few seconds of when user pressed cancel.
     static PRIntervalTime mDontRetryUntil;
 
 public:
   
     // ctor
     nsAutodial();
--- a/netwerk/protocol/wyciwyg/nsWyciwygChannel.cpp
+++ b/netwerk/protocol/wyciwyg/nsWyciwygChannel.cpp
@@ -468,17 +468,17 @@ nsWyciwygChannel::WriteToCacheEntryInter
 
     // Write out a Byte Order Mark, so that we'll know if the data is
     // BE or LE when we go to read it.
     PRUnichar bom = 0xFEFF;
     rv = mCacheOutputStream->Write((char *)&bom, sizeof(bom), &out);
     if (NS_FAILED(rv)) return rv;
   }
 
-  return mCacheOutputStream->Write((char *)PromiseFlatString(aData).get(),
+  return mCacheOutputStream->Write((const char *)PromiseFlatString(aData).get(),
                                    aData.Length() * sizeof(PRUnichar), &out);
 }
 
 
 NS_IMETHODIMP
 nsWyciwygChannel::CloseCacheEntry(nsresult reason)
 {
   return mCacheIOTarget->Dispatch(new nsWyciwygCloseEvent(this, reason),