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

Side by Side Diff: src/core/SkTSearch.cpp

Issue 1316233002: Style Change: NULL->nullptr (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 2015-08-27 (Thursday) 10:25:06 EDT Created 5 years, 3 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 | « src/core/SkTMultiMap.h ('k') | src/core/SkTaskGroup.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 1
2 /* 2 /*
3 * Copyright 2006 The Android Open Source Project 3 * Copyright 2006 The Android Open Source Project
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 8
9 9
10 #include "SkTSearch.h" 10 #include "SkTSearch.h"
11 #include <ctype.h> 11 #include <ctype.h>
12 12
13 static inline const char* index_into_base(const char*const* base, int index, 13 static inline const char* index_into_base(const char*const* base, int index,
14 size_t elemSize) 14 size_t elemSize)
15 { 15 {
16 return *(const char*const*)((const char*)base + index * elemSize); 16 return *(const char*const*)((const char*)base + index * elemSize);
17 } 17 }
18 18
19 int SkStrSearch(const char*const* base, int count, const char target[], 19 int SkStrSearch(const char*const* base, int count, const char target[],
20 size_t target_len, size_t elemSize) 20 size_t target_len, size_t elemSize)
21 { 21 {
22 if (count <= 0) 22 if (count <= 0)
23 return ~0; 23 return ~0;
24 24
25 SkASSERT(base != NULL); 25 SkASSERT(base != nullptr);
26 26
27 int lo = 0; 27 int lo = 0;
28 int hi = count - 1; 28 int hi = count - 1;
29 29
30 while (lo < hi) 30 while (lo < hi)
31 { 31 {
32 int mid = (hi + lo) >> 1; 32 int mid = (hi + lo) >> 1;
33 const char* elem = index_into_base(base, mid, elemSize); 33 const char* elem = index_into_base(base, mid, elemSize);
34 34
35 int cmp = strncmp(elem, target, target_len); 35 int cmp = strncmp(elem, target, target_len);
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
105 } 105 }
106 lc[len] = 0; 106 lc[len] = 0;
107 } 107 }
108 108
109 SkAutoAsciiToLC::~SkAutoAsciiToLC() 109 SkAutoAsciiToLC::~SkAutoAsciiToLC()
110 { 110 {
111 if (fLC != fStorage) { 111 if (fLC != fStorage) {
112 sk_free(fLC); 112 sk_free(fLC);
113 } 113 }
114 } 114 }
OLDNEW
« no previous file with comments | « src/core/SkTMultiMap.h ('k') | src/core/SkTaskGroup.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698