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

Side by Side Diff: net/spdy/hpack/hpack_huffman_table.cc

Issue 1858423002: Fix C4334 (32-bit shift converted to 64-bit) warnings (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Removing obsolete comment and pointless '1' Created 4 years, 8 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 unified diff | Download patch
« no previous file with comments | « net/base/mime_sniffer_perftest.cc ('k') | third_party/WebKit/Source/platform/heap/HeapPage.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "net/spdy/hpack/hpack_huffman_table.h" 5 #include "net/spdy/hpack/hpack_huffman_table.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <cmath> 8 #include <cmath>
9 #include <memory> 9 #include <memory>
10 10
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after
162 for (size_t i = 0; i != decode_tables_.size(); i++) { 162 for (size_t i = 0; i != decode_tables_.size(); i++) {
163 const DecodeTable& table = decode_tables_[i]; 163 const DecodeTable& table = decode_tables_[i];
164 uint8_t total_indexed = table.prefix_length + table.indexed_length; 164 uint8_t total_indexed = table.prefix_length + table.indexed_length;
165 165
166 size_t j = 0; 166 size_t j = 0;
167 while (j != table.size()) { 167 while (j != table.size()) {
168 const DecodeEntry& entry = Entry(table, j); 168 const DecodeEntry& entry = Entry(table, j);
169 if (entry.length != 0 && entry.length < total_indexed) { 169 if (entry.length != 0 && entry.length < total_indexed) {
170 // The difference between entry & table bit counts tells us how 170 // The difference between entry & table bit counts tells us how
171 // many additional entries map to this one. 171 // many additional entries map to this one.
172 size_t fill_count = 1 << (total_indexed - entry.length); 172 size_t fill_count = static_cast<size_t>(1)
173 << (total_indexed - entry.length);
173 CHECK_LE(j + fill_count, table.size()); 174 CHECK_LE(j + fill_count, table.size());
174 175
175 for (size_t k = 1; k != fill_count; k++) { 176 for (size_t k = 1; k != fill_count; k++) {
176 CHECK_EQ(Entry(table, j + k).length, 0); 177 CHECK_EQ(Entry(table, j + k).length, 0);
177 SetEntry(table, j + k, entry); 178 SetEntry(table, j + k, entry);
178 } 179 }
179 j += fill_count; 180 j += fill_count;
180 } else { 181 } else {
181 j++; 182 j++;
182 } 183 }
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after
316 bits = bits << entry.length; 317 bits = bits << entry.length;
317 bits_available -= entry.length; 318 bits_available -= entry.length;
318 } 319 }
319 peeked_success = in->PeekBits(&bits_available, &bits); 320 peeked_success = in->PeekBits(&bits_available, &bits);
320 } 321 }
321 NOTREACHED(); 322 NOTREACHED();
322 return false; 323 return false;
323 } 324 }
324 325
325 } // namespace net 326 } // namespace net
OLDNEW
« no previous file with comments | « net/base/mime_sniffer_perftest.cc ('k') | third_party/WebKit/Source/platform/heap/HeapPage.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698