Backed out changeset 06f381426af1 (bug 944905) for windows bustage on a CLOSED TREE
authorCarsten "Tomcat" Book <cbook@mozilla.com>
Tue, 07 Jan 2014 15:18:43 +0100
changeset 172574 7aaa3c22fffc0b6ffd5fd7ab279406dd148c4791
parent 172573 d18a4d380644703a984a6677194f5f22141d7a2e
child 172575 7e7ae8cbd0231a0e5b5bede32359ea523bfd9825
push id5166
push userlsblakk@mozilla.com
push dateTue, 04 Feb 2014 01:47:54 +0000
treeherdermozilla-aurora@977eb2548b2d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs944905
milestone29.0a1
backs out06f381426af180afc5cabcd7e0189a1de771d932
Backed out changeset 06f381426af1 (bug 944905) for windows bustage on a CLOSED TREE
xpcom/ds/nsWindowsRegKey.cpp
xpcom/glue/nsTextFormatter.cpp
xpcom/glue/nsVersionComparator.h
xpcom/io/nsLocalFileWin.cpp
xpcom/io/nsNativeCharsetUtils.cpp
xpcom/string/public/nsString.h
--- a/xpcom/ds/nsWindowsRegKey.cpp
+++ b/xpcom/ds/nsWindowsRegKey.cpp
@@ -328,17 +328,17 @@ nsWindowsRegKey::ReadStringValue(const n
       --resultLen;
       expandedResult.SetLength(resultLen);
       nsAString::iterator begin;
       expandedResult.BeginWriting(begin);
       if (begin.size_forward() != resultLen)
         return NS_ERROR_OUT_OF_MEMORY;
 
       resultLen = ExpandEnvironmentStringsW(flatSource.get(),
-                                            wwc(begin.get()),
+                                            begin.get(),
                                             resultLen + 1);
       if (resultLen <= 0) {
         rv = ERROR_UNKNOWN_FEATURE;
         result.Truncate();
       } else {
         rv = ERROR_SUCCESS;
         result = expandedResult;
       }
--- a/xpcom/glue/nsTextFormatter.cpp
+++ b/xpcom/glue/nsTextFormatter.cpp
@@ -508,17 +508,19 @@ static int cvt_S(SprintfState *ss, const
     slen = s ? NS_strlen(s) : 6;
     if (prec > 0) {
 	if (prec < slen) {
 	    slen = prec;
 	}
     }
 
     /* and away we go */
-    return fill2(ss, s ? s : MOZ_UTF16("(null)"), slen, width, flags);
+    NS_NAMED_LITERAL_STRING(nullstr, "(null)");
+
+    return fill2(ss, s ? s : nullstr.get(), slen, width, flags);
 }
 
 /*
 ** Convert a string into its printable form.  "width" is the output
 ** width. "prec" is the maximum number of characters of "s" to output,
 ** where -1 means until NUL.
 */
 static int cvt_s(SprintfState *ss, const char *s, int width,
--- a/xpcom/glue/nsVersionComparator.h
+++ b/xpcom/glue/nsVersionComparator.h
@@ -95,17 +95,17 @@ struct NS_COM_GLUE Version
   char* versionContent;
 };
 
 #ifdef XP_WIN
 struct NS_COM_GLUE VersionW
 {
   VersionW(const char16_t *versionStringW)
   {
-    versionContentW = reinterpret_cast<char16_t*>(wcsdup(char16ptr_t(versionStringW)));
+    versionContentW = wcsdup(versionStringW);
   }
 
   const char16_t* ReadContentW() const
   {
     return versionContentW;
   }
 
   ~VersionW()
--- a/xpcom/io/nsLocalFileWin.cpp
+++ b/xpcom/io/nsLocalFileWin.cpp
@@ -1016,17 +1016,17 @@ nsLocalFile::ResolveShortcut()
     // we can't do anything without the resolver
     if (!gResolver)
         return NS_ERROR_FAILURE;
 
     mResolvedPath.SetLength(MAX_PATH);
     if (mResolvedPath.Length() != MAX_PATH)
         return NS_ERROR_OUT_OF_MEMORY;
 
-    wchar_t *resolvedPath = wwc(mResolvedPath.BeginWriting());
+    char16_t *resolvedPath = mResolvedPath.BeginWriting();
 
     // resolve this shortcut
     nsresult rv = gResolver->Resolve(mWorkingPath.get(), resolvedPath);
 
     size_t len = NS_FAILED(rv) ? 0 : wcslen(resolvedPath);
     mResolvedPath.SetLength(len);
 
     return rv;
@@ -1251,17 +1251,17 @@ nsLocalFile::Create(uint32_t type, uint3
     //                       ^--- start here
     //
     //   - UNC path:  \\machine\volume\some\path\on\this\drive
     //                                     ^--- start here
     //
     // Skip the first 'X:\' for the first form, and skip the first full
     // '\\machine\volume\' segment for the second form.
 
-    wchar_t* path = wwc(mResolvedPath.BeginWriting());
+    char16_t* path = mResolvedPath.BeginWriting();
 
     if (path[0] == L'\\' && path[1] == L'\\')
     {
         // dealing with a UNC path here; skip past '\\machine\'
         path = wcschr(path + 2, L'\\');
         if (!path)
             return NS_ERROR_FILE_INVALID_PATH;
         ++path;
@@ -3441,17 +3441,17 @@ nsresult nsDriveEnumerator::Init()
 {
     /* If the length passed to GetLogicalDriveStrings is smaller
      * than the length of the string it would return, it returns
      * the length required for the string. */
     DWORD length = GetLogicalDriveStringsW(0, 0);
     /* The string is null terminated */
     if (!mDrives.SetLength(length+1, fallible_t()))
         return NS_ERROR_OUT_OF_MEMORY;
-    if (!GetLogicalDriveStringsW(length, wwc(mDrives.BeginWriting())))
+    if (!GetLogicalDriveStringsW(length, mDrives.BeginWriting()))
         return NS_ERROR_FAILURE;
     mDrives.BeginReading(mStartOfCurrentDrive);
     mDrives.EndReading(mEndOfDrivesString);
     return NS_OK;
 }
 
 NS_IMETHODIMP nsDriveEnumerator::HasMoreElements(bool *aHasMore)
 {
--- a/xpcom/io/nsNativeCharsetUtils.cpp
+++ b/xpcom/io/nsNativeCharsetUtils.cpp
@@ -896,17 +896,17 @@ NS_CopyNativeToUnicode(const nsACString 
     if (!output.SetLength(resultLen, fallible_t()))
         return NS_ERROR_OUT_OF_MEMORY;
     if (resultLen > 0) {
         nsAString::iterator out_iter;
         output.BeginWriting(out_iter);
 
         char16_t *result = out_iter.get();
 
-        ::MultiByteToWideChar(CP_ACP, 0, buf, inputLen, wwc(result), resultLen);
+        ::MultiByteToWideChar(CP_ACP, 0, buf, inputLen, result, resultLen);
     }
     return NS_OK;
 }
 
 nsresult
 NS_CopyUnicodeToNative(const nsAString  &input, nsACString &output)
 {
     uint32_t inputLen = input.Length();
@@ -942,17 +942,17 @@ NS_CopyUnicodeToNative(const nsAString  
     }
     return NS_OK;
 }
 
 // moved from widget/windows/nsToolkit.cpp
 int32_t 
 NS_ConvertAtoW(const char *aStrInA, int aBufferSize, char16_t *aStrOutW)
 {
-    return MultiByteToWideChar(CP_ACP, 0, aStrInA, -1, wwc(aStrOutW), aBufferSize);
+    return MultiByteToWideChar(CP_ACP, 0, aStrInA, -1, aStrOutW, aBufferSize);
 }
 
 int32_t 
 NS_ConvertWtoA(const char16_t *aStrInW, int aBufferSizeOut,
                char *aStrOutA, const char *aDefault)
 {
     if ((!aStrInW) || (!aStrOutA) || (aBufferSizeOut <= 0))
         return 0;
--- a/xpcom/string/public/nsString.h
+++ b/xpcom/string/public/nsString.h
@@ -178,40 +178,16 @@ class NS_ConvertUTF8toUTF16 : public nsA
         }
 
     private:
         // NOT TO BE IMPLEMENTED
       NS_ConvertUTF8toUTF16( char16_t );
   };
 
 
-#ifdef MOZ_USE_CHAR16_WRAPPER
-
-inline char16_t*
-wwc(wchar_t *str)
-{
-    return reinterpret_cast<char16_t*>(str);
-}
-
-inline wchar_t*
-wwc(char16_t *str)
-{
-    return reinterpret_cast<wchar_t*>(str);
-}
-
-#else
-
-inline char16_t*
-wwc(char16_t *str)
-{
-    return str;
-}
-
-#endif
-
 // the following are included/declared for backwards compatibility
 typedef nsAutoString nsVoidableString;
 
 #ifndef nsDependentString_h___
 #include "nsDependentString.h"
 #endif
 
 #ifndef nsLiteralString_h___