Bug 1120125 - Fix compile error on big endian platforms. r=keeler
authorSteve Singer <steve@ssinger.info>
Sat, 10 Jan 2015 14:31:00 +0100
changeset 223511 c31dc4144a137f3bd3cb16740af7a144551d1219
parent 223510 4b1a5da9b12fc77f46f67375118b48fec268165d
child 223512 df97c2f883b4712ae7ed2623c5096d5ab3a0feb0
push id28095
push usercbook@mozilla.com
push dateTue, 13 Jan 2015 13:24:48 +0000
treeherdermozilla-central@a5700bec72e1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskeeler
bugs1120125
milestone38.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 1120125 - Fix compile error on big endian platforms. r=keeler
security/manager/ssl/src/nsNTLMAuthModule.cpp
--- a/security/manager/ssl/src/nsNTLMAuthModule.cpp
+++ b/security/manager/ssl/src/nsNTLMAuthModule.cpp
@@ -585,17 +585,17 @@ GenerateType3Msg(const nsString &domain,
   // get domain name
   //
   if (unicode)
   {
 #ifdef IS_BIG_ENDIAN
     ucsDomainBuf = domain;
     domainPtr = ucsDomainBuf.get();
     domainLen = ucsDomainBuf.Length() * 2;
-    WriteUnicodeLE((void *) domainPtr, reinterpret_cast<const uint16_t*> domainPtr,
+    WriteUnicodeLE((void *) domainPtr, reinterpret_cast<const char16_t*> (domainPtr),
                    ucsDomainBuf.Length());
 #else
     domainPtr = domain.get();
     domainLen = domain.Length() * 2;
 #endif
   }
   else
   {
@@ -608,17 +608,17 @@ GenerateType3Msg(const nsString &domain,
   // get user name
   //
   if (unicode)
   {
 #ifdef IS_BIG_ENDIAN
     ucsUserBuf = username;
     userPtr = ucsUserBuf.get();
     userLen = ucsUserBuf.Length() * 2;
-    WriteUnicodeLE((void *) userPtr, reinterpret_cast<const uint16_t*> userPtr,
+    WriteUnicodeLE((void *) userPtr, reinterpret_cast<const char16_t*> (userPtr),
                    ucsUserBuf.Length());
 #else
     userPtr = username.get();
     userLen = username.Length() * 2;
 #endif
   }
   else
   {
@@ -636,17 +636,17 @@ GenerateType3Msg(const nsString &domain,
   hostLen = strlen(hostBuf);
   if (unicode)
   {
     // hostname is ASCII, so we can do a simple zero-pad expansion:
     CopyASCIItoUTF16(nsDependentCString(hostBuf, hostLen), ucsHostBuf);
     hostPtr = ucsHostBuf.get();
     hostLen = ucsHostBuf.Length() * 2;
 #ifdef IS_BIG_ENDIAN
-    WriteUnicodeLE((void *) hostPtr, reinterpret_cast<const uint16_t*> hostPtr,
+    WriteUnicodeLE((void *) hostPtr, reinterpret_cast<const char16_t*> (hostPtr),
                    ucsHostBuf.Length());
 #endif
   }
   else
     hostPtr = hostBuf;
 
   //
   // now that we have generated all of the strings, we can allocate outBuf.
@@ -679,24 +679,24 @@ GenerateType3Msg(const nsString &domain,
       NS_ERROR("failed to get NTLMv2 target info, can not do NTLMv2");
       return NS_ERROR_UNEXPECTED;
     }
 
     ToUpperCase(username, ucsUserUpperBuf);
     userUpperPtr = ucsUserUpperBuf.get();
     userUpperLen = ucsUserUpperBuf.Length() * 2;
 #ifdef IS_BIG_ENDIAN
-    WriteUnicodeLE((void *) userUpperPtr, reinterpret_cast<const uint16_t*> (userUpperPtr),
+    WriteUnicodeLE((void *) userUpperPtr, reinterpret_cast<const char16_t*> (userUpperPtr),
                    ucsUserUpperBuf.Length());
 #endif
     ToUpperCase(domain, ucsDomainUpperBuf);
     domainUpperPtr = ucsDomainUpperBuf.get();
     domainUpperLen = ucsDomainUpperBuf.Length() * 2;
 #ifdef IS_BIG_ENDIAN
-    WriteUnicodeLE((void *) domainUpperPtr, reinterpret_cast<const uint16_t*> (domainUpperPtr),
+    WriteUnicodeLE((void *) domainUpperPtr, reinterpret_cast<const char16_t*> (domainUpperPtr),
                    ucsDomainUpperBuf.Length());
 #endif
 
     NTLM_Hash(password, ntlmHash);
     ntlmHashStr = nsAutoCString(reinterpret_cast<const char *>(ntlmHash), NTLM_HASH_LEN);
 
     nsCOMPtr<nsIKeyObjectFactory> keyFactory =
         do_CreateInstance(NS_KEYMODULEOBJECTFACTORY_CONTRACTID, &rv);