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

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

Issue 1314583003: Replace SkPin32 with SkTPin and remove. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Add comment. 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/SkFontStyle.cpp ('k') | src/effects/SkMagnifierImageFilter.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 491 matching lines...) Expand 10 before | Expand all | Expand 10 after
502 this->insert(offset, buffer, stop - buffer); 502 this->insert(offset, buffer, stop - buffer);
503 } 503 }
504 504
505 void SkString::insertU64(size_t offset, uint64_t dec, int minDigits) { 505 void SkString::insertU64(size_t offset, uint64_t dec, int minDigits) {
506 char buffer[SkStrAppendU64_MaxSize]; 506 char buffer[SkStrAppendU64_MaxSize];
507 char* stop = SkStrAppendU64(buffer, dec, minDigits); 507 char* stop = SkStrAppendU64(buffer, dec, minDigits);
508 this->insert(offset, buffer, stop - buffer); 508 this->insert(offset, buffer, stop - buffer);
509 } 509 }
510 510
511 void SkString::insertHex(size_t offset, uint32_t hex, int minDigits) { 511 void SkString::insertHex(size_t offset, uint32_t hex, int minDigits) {
512 minDigits = SkPin32(minDigits, 0, 8); 512 minDigits = SkTPin(minDigits, 0, 8);
513 513
514 static const char gHex[] = "0123456789ABCDEF"; 514 static const char gHex[] = "0123456789ABCDEF";
515 515
516 char buffer[8]; 516 char buffer[8];
517 char* p = buffer + sizeof(buffer); 517 char* p = buffer + sizeof(buffer);
518 518
519 do { 519 do {
520 *--p = gHex[hex & 0xF]; 520 *--p = gHex[hex & 0xF];
521 hex >>= 4; 521 hex >>= 4;
522 minDigits -= 1; 522 minDigits -= 1;
(...skipping 108 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/SkFontStyle.cpp ('k') | src/effects/SkMagnifierImageFilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698