| 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 "SkString.h" | 10 #include "SkString.h" |
| 11 #include "SkFixed.h" | 11 #include "SkFixed.h" |
| 12 #include "SkThread.h" | 12 #include "SkThread.h" |
| 13 #include "SkUtils.h" | 13 #include "SkUtils.h" |
| 14 #include <stdarg.h> | 14 #include <stdarg.h> |
| 15 #include <stdio.h> | 15 #include <stdio.h> |
| 16 | 16 |
| 17 // number of bytes (on the stack) to receive the printf result | 17 // number of bytes (on the stack) to receive the printf result |
| 18 static const size_t kBufferSize = 512; | 18 static const size_t kBufferSize = 1024; |
| 19 | 19 |
| 20 #ifdef SK_BUILD_FOR_WIN | 20 #ifdef SK_BUILD_FOR_WIN |
| 21 #define VSNPRINTF(buffer, size, format, args) \ | 21 #define VSNPRINTF(buffer, size, format, args) \ |
| 22 _vsnprintf_s(buffer, size, _TRUNCATE, format, args) | 22 _vsnprintf_s(buffer, size, _TRUNCATE, format, args) |
| 23 #define SNPRINTF _snprintf | 23 #define SNPRINTF _snprintf |
| 24 #else | 24 #else |
| 25 #define VSNPRINTF vsnprintf | 25 #define VSNPRINTF vsnprintf |
| 26 #define SNPRINTF snprintf | 26 #define SNPRINTF snprintf |
| 27 #endif | 27 #endif |
| 28 | 28 |
| (...skipping 583 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 612 SkString SkStringPrintf(const char* format, ...) { | 612 SkString SkStringPrintf(const char* format, ...) { |
| 613 SkString formattedOutput; | 613 SkString formattedOutput; |
| 614 char buffer[kBufferSize]; | 614 char buffer[kBufferSize]; |
| 615 ARGS_TO_BUFFER(format, buffer, kBufferSize); | 615 ARGS_TO_BUFFER(format, buffer, kBufferSize); |
| 616 formattedOutput.set(buffer); | 616 formattedOutput.set(buffer); |
| 617 return formattedOutput; | 617 return formattedOutput; |
| 618 } | 618 } |
| 619 | 619 |
| 620 #undef VSNPRINTF | 620 #undef VSNPRINTF |
| 621 #undef SNPRINTF | 621 #undef SNPRINTF |
| OLD | NEW |