Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(143)

Unified Diff: chrome/browser/safe_browsing/safe_browsing_util.cc

Issue 7823004: Convert SHA256_LENGTH from a constant-in-anonymous-enum to a static const. This defines the cons... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 9 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/safe_browsing/safe_browsing_util.cc
===================================================================
--- chrome/browser/safe_browsing/safe_browsing_util.cc (revision 98481)
+++ chrome/browser/safe_browsing/safe_browsing_util.cc (working copy)
@@ -526,12 +526,12 @@
}
void StringToSBFullHash(const std::string& hash_in, SBFullHash* hash_out) {
- DCHECK_EQ(static_cast<size_t>(crypto::SHA256_LENGTH), hash_in.size());
- memcpy(hash_out->full_hash, hash_in.data(), crypto::SHA256_LENGTH);
+ DCHECK_EQ(crypto::kSHA256Length, hash_in.size());
+ memcpy(hash_out->full_hash, hash_in.data(), crypto::kSHA256Length);
}
std::string SBFullHashToString(const SBFullHash& hash) {
- DCHECK_EQ(static_cast<size_t>(crypto::SHA256_LENGTH), sizeof(hash.full_hash));
wtc 2011/09/02 17:08:42 The removal of these static_casts is good!
+ DCHECK_EQ(crypto::kSHA256Length, sizeof(hash.full_hash));
return std::string(hash.full_hash, sizeof(hash.full_hash));
}
} // namespace safe_browsing_util

Powered by Google App Engine
This is Rietveld 408576698