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

Side by Side Diff: net/base/hash_value.cc

Issue 1618193002: Include stdlib.h for bsearch (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 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 | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/base/hash_value.h" 5 #include "net/base/hash_value.h"
6 6
7 #include <stdlib.h>
8
7 #include "base/base64.h" 9 #include "base/base64.h"
8 #include "base/logging.h" 10 #include "base/logging.h"
9 #include "base/sha1.h" 11 #include "base/sha1.h"
10 #include "base/strings/string_split.h" 12 #include "base/strings/string_split.h"
11 #include "base/strings/string_util.h" 13 #include "base/strings/string_util.h"
12 #include "crypto/sha2.h" 14 #include "crypto/sha2.h"
13 15
14 namespace net { 16 namespace net {
15 17
16 namespace { 18 namespace {
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
124 bool IsSHA256HashInSortedArray(const SHA256HashValue& hash, 126 bool IsSHA256HashInSortedArray(const SHA256HashValue& hash,
125 const uint8_t* array, 127 const uint8_t* array,
126 size_t array_byte_len) { 128 size_t array_byte_len) {
127 DCHECK_EQ(0u, array_byte_len % crypto::kSHA256Length); 129 DCHECK_EQ(0u, array_byte_len % crypto::kSHA256Length);
128 const size_t arraylen = array_byte_len / crypto::kSHA256Length; 130 const size_t arraylen = array_byte_len / crypto::kSHA256Length;
129 return NULL != bsearch(hash.data, array, arraylen, crypto::kSHA256Length, 131 return NULL != bsearch(hash.data, array, arraylen, crypto::kSHA256Length,
130 CompareSHA1Hashes); 132 CompareSHA1Hashes);
131 } 133 }
132 134
133 } // namespace net 135 } // namespace net
OLDNEW
« 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