Bug 1424867 - Fix some ignored-qualifiers warnings in url-classifier & reputationservice r?francois draft
authorSylvestre Ledru <sledru@mozilla.com>
Tue, 12 Dec 2017 08:10:59 -0600
changeset 710869 f7f4332d201f92775a0643c79fff66eb36b99b93
parent 710866 f8b20a19cc89564bf098319851684a031f441c53
child 710870 94610c646ff125177a8cbc9551947af6531e395d
push id92921
push usersledru@mozilla.com
push dateTue, 12 Dec 2017 14:15:03 +0000
reviewersfrancois
bugs1424867
milestone59.0a1
Bug 1424867 - Fix some ignored-qualifiers warnings in url-classifier & reputationservice r?francois MozReview-Commit-ID: 9lLifMbNlnO
toolkit/components/reputationservice/ApplicationReputation.cpp
toolkit/components/url-classifier/Entries.h
toolkit/components/url-classifier/LookupCache.cpp
--- a/toolkit/components/reputationservice/ApplicationReputation.cpp
+++ b/toolkit/components/reputationservice/ApplicationReputation.cpp
@@ -1010,17 +1010,17 @@ PendingLookup::GetSpecHash(nsACString& a
   rv = cryptoHash->Finish(false, binaryHash);
   NS_ENSURE_SUCCESS(rv, rv);
 
   // This needs to match HexEncode() in Chrome's
   // src/base/strings/string_number_conversions.cc
   static const char* const hex = "0123456789ABCDEF";
   hexEncodedHash.SetCapacity(2 * binaryHash.Length());
   for (size_t i = 0; i < binaryHash.Length(); ++i) {
-    auto c = static_cast<const unsigned char>(binaryHash[i]);
+    auto c = static_cast<unsigned char>(binaryHash[i]);
     hexEncodedHash.Append(hex[(c >> 4) & 0x0F]);
     hexEncodedHash.Append(hex[c & 0x0F]);
   }
 
   return NS_OK;
 }
 
 nsresult
--- a/toolkit/components/url-classifier/Entries.h
+++ b/toolkit/components/url-classifier/Entries.h
@@ -99,17 +99,17 @@ struct SafebrowsingHash
 
   void ToHexString(nsACString& aStr) const {
     static const char* const lut = "0123456789ABCDEF";
     // 32 bytes is the longest hash
     size_t len = 32;
 
     aStr.SetCapacity(2 * len);
     for (size_t i = 0; i < len; ++i) {
-      const char c = static_cast<const char>(buf[i]);
+      const char c = static_cast<char>(buf[i]);
       aStr.Append(lut[(c >> 4) & 0x0F]);
       aStr.Append(lut[c & 15]);
     }
   }
 
   uint32_t ToUint32() const {
     uint32_t n;
     memcpy(&n, buf, sizeof(n));
--- a/toolkit/components/url-classifier/LookupCache.cpp
+++ b/toolkit/components/url-classifier/LookupCache.cpp
@@ -54,17 +54,17 @@ void CStringToHexString(const nsACString
 {
   static const char* const lut = "0123456789ABCDEF";
 
   size_t len = aIn.Length();
   MOZ_ASSERT(len <= COMPLETE_SIZE);
 
   aOut.SetCapacity(2 * len);
   for (size_t i = 0; i < aIn.Length(); ++i) {
-    const char c = static_cast<const char>(aIn[i]);
+    const char c = static_cast<char>(aIn[i]);
     aOut.Append(lut[(c >> 4) & 0x0F]);
     aOut.Append(lut[c & 15]);
   }
 }
 
 LookupCache::LookupCache(const nsACString& aTableName,
                          const nsACString& aProvider,
                          nsIFile* aRootStoreDir)