OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 #include "platform/json.h" | 5 #include "platform/json.h" |
6 | 6 |
7 #include "platform/assert.h" | 7 #include "platform/assert.h" |
8 #include "platform/globals.h" | 8 #include "platform/globals.h" |
9 #include "platform/utils.h" | 9 #include "platform/utils.h" |
10 #include "vm/os.h" | 10 #include "vm/os.h" |
11 | 11 |
12 namespace dart { | 12 namespace dart { |
13 | 13 |
| 14 #ifndef va_copy |
| 15 #define va_copy(dst, src) (memmove(&(dst), &(src), sizeof(dst))) |
| 16 #endif /* va_copy */ |
| 17 |
14 | 18 |
15 JSONScanner::JSONScanner(const char* json_text) { | 19 JSONScanner::JSONScanner(const char* json_text) { |
16 SetText(json_text); | 20 SetText(json_text); |
17 } | 21 } |
18 | 22 |
19 | 23 |
20 void JSONScanner::SetText(const char* json_text) { | 24 void JSONScanner::SetText(const char* json_text) { |
21 current_pos_ = json_text; | 25 current_pos_ = json_text; |
22 token_start_ = json_text; | 26 token_start_ = json_text; |
23 token_length_ = 0; | 27 token_length_ = 0; |
(...skipping 361 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
385 | 389 |
386 void TextBuffer::GrowBuffer(intptr_t len) { | 390 void TextBuffer::GrowBuffer(intptr_t len) { |
387 intptr_t new_size = buf_size_ + len; | 391 intptr_t new_size = buf_size_ + len; |
388 char* new_buf = reinterpret_cast<char*>(realloc(buf_, new_size)); | 392 char* new_buf = reinterpret_cast<char*>(realloc(buf_, new_size)); |
389 ASSERT(new_buf != NULL); | 393 ASSERT(new_buf != NULL); |
390 buf_ = new_buf; | 394 buf_ = new_buf; |
391 buf_size_ = new_size; | 395 buf_size_ = new_size; |
392 } | 396 } |
393 | 397 |
394 } // namespace dart | 398 } // namespace dart |
OLD | NEW |