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

Side by Side Diff: src/core/SkString.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/SkStreamPriv.h ('k') | src/core/SkStroke.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 "SkAtomics.h" 10 #include "SkAtomics.h"
(...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after
249 } 249 }
250 } 250 }
251 #endif 251 #endif
252 252
253 /////////////////////////////////////////////////////////////////////////////// 253 ///////////////////////////////////////////////////////////////////////////////
254 254
255 SkString::SkString() : fRec(const_cast<Rec*>(&gEmptyRec)) { 255 SkString::SkString() : fRec(const_cast<Rec*>(&gEmptyRec)) {
256 } 256 }
257 257
258 SkString::SkString(size_t len) { 258 SkString::SkString(size_t len) {
259 fRec = AllocRec(NULL, len); 259 fRec = AllocRec(nullptr, len);
260 } 260 }
261 261
262 SkString::SkString(const char text[]) { 262 SkString::SkString(const char text[]) {
263 size_t len = text ? strlen(text) : 0; 263 size_t len = text ? strlen(text) : 0;
264 264
265 fRec = AllocRec(text, len); 265 fRec = AllocRec(text, len);
266 } 266 }
267 267
268 SkString::SkString(const char text[], size_t len) { 268 SkString::SkString(const char text[], size_t len) {
269 fRec = AllocRec(text, len); 269 fRec = AllocRec(text, len);
(...skipping 18 matching lines...) Expand all
288 288
289 bool SkString::equals(const SkString& src) const { 289 bool SkString::equals(const SkString& src) const {
290 return fRec == src.fRec || this->equals(src.c_str(), src.size()); 290 return fRec == src.fRec || this->equals(src.c_str(), src.size());
291 } 291 }
292 292
293 bool SkString::equals(const char text[]) const { 293 bool SkString::equals(const char text[]) const {
294 return this->equals(text, text ? strlen(text) : 0); 294 return this->equals(text, text ? strlen(text) : 0);
295 } 295 }
296 296
297 bool SkString::equals(const char text[], size_t len) const { 297 bool SkString::equals(const char text[], size_t len) const {
298 SkASSERT(len == 0 || text != NULL); 298 SkASSERT(len == 0 || text != nullptr);
299 299
300 return fRec->fLength == len && !memcmp(fRec->data(), text, len); 300 return fRec->fLength == len && !memcmp(fRec->data(), text, len);
301 } 301 }
302 302
303 SkString& SkString::operator=(const SkString& src) { 303 SkString& SkString::operator=(const SkString& src) {
304 this->validate(); 304 this->validate();
305 305
306 if (fRec != src.fRec) { 306 if (fRec != src.fRec) {
307 SkString tmp(src); 307 SkString tmp(src);
308 this->swap(tmp); 308 this->swap(tmp);
(...skipping 322 matching lines...) Expand 10 before | Expand all | Expand 10 after
631 const size_t len = strcspn(str, delimiters); 631 const size_t len = strcspn(str, delimiters);
632 out->push_back().set(str, len); 632 out->push_back().set(str, len);
633 str += len; 633 str += len;
634 // Skip any delimiters. 634 // Skip any delimiters.
635 str += strspn(str, delimiters); 635 str += strspn(str, delimiters);
636 } 636 }
637 } 637 }
638 638
639 #undef VSNPRINTF 639 #undef VSNPRINTF
640 #undef SNPRINTF 640 #undef SNPRINTF
OLDNEW
« no previous file with comments | « src/core/SkStreamPriv.h ('k') | src/core/SkStroke.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698