Bug 1331760 - convert xpcom/components from nsTextFormatter to AppendPrintf; r?froydnj draft
authorTom Tromey <tom@tromey.com>
Tue, 12 Sep 2017 15:52:25 -0600
changeset 696383 699ced0046bf9cf61710483055dbee343c91199c
parent 696382 77b75782e874de87498d946eb826528d858fea70
child 739841 51f0b5e4ded54742ecef84b3e4c8b2408a2127b1
push id88695
push userbmo:ttromey@mozilla.com
push dateFri, 10 Nov 2017 15:13:25 +0000
reviewersfroydnj
bugs1331760
milestone58.0a1
Bug 1331760 - convert xpcom/components from nsTextFormatter to AppendPrintf; r?froydnj MozReview-Commit-ID: 9LCtBUi0o2L
xpcom/components/ManifestParser.cpp
--- a/xpcom/components/ManifestParser.cpp
+++ b/xpcom/components/ManifestParser.cpp
@@ -25,17 +25,16 @@
 #ifdef MOZ_WIDGET_ANDROID
 #include "AndroidBridge.h"
 #endif
 
 #include "mozilla/Services.h"
 
 #include "nsCRT.h"
 #include "nsConsoleMessage.h"
-#include "nsTextFormatter.h"
 #include "nsVersionComparator.h"
 #include "nsXPCOMCIDInternal.h"
 
 #include "nsIConsoleService.h"
 #include "nsIScriptError.h"
 #include "nsIXULAppInfo.h"
 #include "nsIXULRuntime.h"
 
@@ -531,31 +530,31 @@ ParseManifest(NSLocationType aType, File
   }
 
   nsAutoString osVersion;
 #if defined(XP_WIN)
 #pragma warning(push)
 #pragma warning(disable:4996) // VC12+ deprecates GetVersionEx
   OSVERSIONINFO info = { sizeof(OSVERSIONINFO) };
   if (GetVersionEx(&info)) {
-    nsTextFormatter::ssprintf(osVersion, u"%ld.%ld",
-                              info.dwMajorVersion,
-                              info.dwMinorVersion);
+    osVersion.AppendPrintf("%ld.%ld",
+                           info.dwMajorVersion,
+                           info.dwMinorVersion);
   }
 #pragma warning(pop)
 #elif defined(MOZ_WIDGET_COCOA)
   SInt32 majorVersion = nsCocoaFeatures::OSXVersionMajor();
   SInt32 minorVersion = nsCocoaFeatures::OSXVersionMinor();
-  nsTextFormatter::ssprintf(osVersion, u"%ld.%ld",
-                            majorVersion,
-                            minorVersion);
+  osVersion.AppendPrintf("%ld.%ld",
+                         long(majorVersion),
+                         long(minorVersion));
 #elif defined(MOZ_WIDGET_GTK)
-  nsTextFormatter::ssprintf(osVersion, u"%ld.%ld",
-                            gtk_major_version,
-                            gtk_minor_version);
+  osVersion.AppendPrintf("%u.%u",
+                         gtk_major_version,
+                         gtk_minor_version);
 #elif defined(MOZ_WIDGET_ANDROID)
   bool isTablet = false;
   if (mozilla::AndroidBridge::Bridge()) {
     mozilla::AndroidBridge::Bridge()->GetStaticStringField("android/os/Build$VERSION",
                                                            "RELEASE",
                                                            osVersion);
     isTablet = java::GeckoAppShell::IsTablet();
   }