OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2013 Google Inc. | 3 * Copyright 2013 Google Inc. |
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 #include "SkTLS.h" | 9 #include "SkTLS.h" |
10 #include "SkTypes.h" | 10 #include "SkTypes.h" |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
123 break; | 123 break; |
124 case kParseError_SkError: | 124 case kParseError_SkError: |
125 error_name = "Parse Error"; | 125 error_name = "Parse Error"; |
126 break; | 126 break; |
127 default: | 127 default: |
128 error_name = "Unknown error"; | 128 error_name = "Unknown error"; |
129 break; | 129 break; |
130 } | 130 } |
131 | 131 |
132 sprintf( str, "%s: ", error_name ); | 132 sprintf( str, "%s: ", error_name ); |
133 int string_left = ERROR_STRING_LENGTH - strlen( str ); | 133 int string_left = SkToInt(ERROR_STRING_LENGTH - strlen(str)); |
134 str += strlen(str); | 134 str += strlen(str); |
135 | 135 |
136 va_start( args, fmt ); | 136 va_start( args, fmt ); |
137 vsnprintf( str, string_left, fmt, args ); | 137 vsnprintf( str, string_left, fmt, args ); |
138 va_end( args ); | 138 va_end( args ); |
139 SkErrorCallbackFunction fn = THREAD_ERROR_CALLBACK; | 139 SkErrorCallbackFunction fn = THREAD_ERROR_CALLBACK; |
140 if (fn && code != kNoError_SkError) { | 140 if (fn && code != kNoError_SkError) { |
141 fn(code, THREAD_ERROR_CONTEXT); | 141 fn(code, THREAD_ERROR_CONTEXT); |
142 } | 142 } |
143 } | 143 } |
OLD | NEW |