OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |