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

Unified Diff: net/dns/record_rdata.h

Issue 2118383006: Fix "conversion of size_t to unsigned int" warning (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Re-inline NsecRecordRdata::bitmap_length() and remove DCHECK Created 4 years, 5 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/dns/record_rdata.h
diff --git a/net/dns/record_rdata.h b/net/dns/record_rdata.h
index d2ca587c5e7811ebb72ab8fce6db6f1c854acc90..7b4bddf301c3b2c01d013b67db1eadce0f281029 100644
--- a/net/dns/record_rdata.h
+++ b/net/dns/record_rdata.h
@@ -198,7 +198,11 @@ class NET_EXPORT_PRIVATE NsecRecordRdata : public RecordRdata {
uint16_t Type() const override;
// Length of the bitmap in bits.
- unsigned bitmap_length() const { return bitmap_.size() * 8; }
+ // This will be between 8-256, as the bitmap is required to be between 1-32
+ // bytes long (this is verified by Create()).
Ryan Sleevi 2016/07/06 16:29:03 This is the sort of comment that makes me uneasy i
Rob Percival 2016/07/06 17:14:44 I had the same feeling when I wrote it. I wasn't c
+ uint16_t bitmap_length() const {
+ return static_cast<uint16_t>(bitmap_.size() * 8);
+ }
// Returns bit i-th bit in the bitmap, where bits withing a byte are organized
// most to least significant. If it is set, a record with rrtype i exists for
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698