Bug 1415418 - Simplify GetUint(). r=glandium.
authorNicholas Nethercote <nnethercote@mozilla.com>
Wed, 08 Nov 2017 16:45:42 +1100
changeset 444149 e368fe33afd342ed8540df982ce4ef0d37617940
parent 444148 017d8233ee85a6643e0e23e11509d2a4d889da08
child 444150 d16b52f5d1955192c42c7b5c5da4e05a7dffef27
child 444194 9e7aaf5d40a43df2e7adad1d4726b9032b08bce6
push id1618
push userCallek@gmail.com
push dateThu, 11 Jan 2018 17:45:48 +0000
treeherdermozilla-release@882ca853e05a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersglandium
bugs1415418
milestone58.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 1415418 - Simplify GetUint(). r=glandium. This makes it just like GetDefaultUint(). MozReview-Commit-ID: CSoLpLdstAv
modules/libpref/Preferences.h
--- a/modules/libpref/Preferences.h
+++ b/modules/libpref/Preferences.h
@@ -146,22 +146,17 @@ public:
   // Gets the type of the pref.
   static int32_t GetType(const char* aPref);
 
   // Fallible getters of user or default values.
   static nsresult GetBool(const char* aPref, bool* aResult);
   static nsresult GetInt(const char* aPref, int32_t* aResult);
   static nsresult GetUint(const char* aPref, uint32_t* aResult)
   {
-    int32_t result;
-    nsresult rv = GetInt(aPref, &result);
-    if (NS_SUCCEEDED(rv)) {
-      *aResult = static_cast<uint32_t>(result);
-    }
-    return rv;
+    return GetInt(aPref, reinterpret_cast<int32_t*>(aResult));
   }
   static nsresult GetFloat(const char* aPref, float* aResult);
   static nsresult GetCString(const char* aPref, nsACString& aResult);
   static nsresult GetString(const char* aPref, nsAString& aResult);
   static nsresult GetLocalizedCString(const char* aPref, nsACString& aResult);
   static nsresult GetLocalizedString(const char* aPref, nsAString& aResult);
   static nsresult GetComplex(const char* aPref,
                              const nsIID& aType,