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

Side by Side Diff: runtime/vm/dart_api_impl.cc

Issue 8222017: Fix compilation warnings/errors seen with newer versions of gcc compiler. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: '' Created 9 years, 2 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 | Annotate | Revision Log
« no previous file with comments | « runtime/vm/dart.cc ('k') | runtime/vm/parser.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, 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 "include/dart_api.h" 5 #include "include/dart_api.h"
6 6
7 #include "vm/bigint_operations.h" 7 #include "vm/bigint_operations.h"
8 #include "vm/class_finalizer.h" 8 #include "vm/class_finalizer.h"
9 #include "vm/compiler.h" 9 #include "vm/compiler.h"
10 #include "vm/dart.h" 10 #include "vm/dart.h"
(...skipping 17 matching lines...) Expand all
28 namespace dart { 28 namespace dart {
29 29
30 // TODO(iposva): This is a placeholder for the eventual external Dart API. 30 // TODO(iposva): This is a placeholder for the eventual external Dart API.
31 DART_EXPORT bool Dart_Initialize(int argc, 31 DART_EXPORT bool Dart_Initialize(int argc,
32 char** argv, 32 char** argv,
33 Dart_IsolateInitCallback callback) { 33 Dart_IsolateInitCallback callback) {
34 return Dart::InitOnce(argc, argv, callback); 34 return Dart::InitOnce(argc, argv, callback);
35 } 35 }
36 36
37 37
38 DART_EXPORT Dart_Isolate Dart_CreateIsolate(void* snapshot, void* data) { 38 DART_EXPORT Dart_Isolate Dart_CreateIsolate(const Dart_Snapshot* snapshot,
39 void* data) {
39 ASSERT(Isolate::Current() == NULL); 40 ASSERT(Isolate::Current() == NULL);
40 Isolate* isolate = Dart::CreateIsolate(snapshot, data); 41 Isolate* isolate = Dart::CreateIsolate(snapshot, data);
41 START_TIMER(time_total_runtime); 42 START_TIMER(time_total_runtime);
42 return reinterpret_cast<Dart_Isolate>(isolate); 43 return reinterpret_cast<Dart_Isolate>(isolate);
43 } 44 }
44 45
45 46
46 DART_EXPORT void Dart_ShutdownIsolate() { 47 DART_EXPORT void Dart_ShutdownIsolate() {
47 ASSERT(Isolate::Current() != NULL); 48 ASSERT(Isolate::Current() != NULL);
48 STOP_TIMER(time_total_runtime); 49 STOP_TIMER(time_total_runtime);
(...skipping 1425 matching lines...) Expand 10 before | Expand all | Expand 10 after
1474 RETURN_CBOOLEAN(true); 1475 RETURN_CBOOLEAN(true);
1475 } 1476 }
1476 1477
1477 1478
1478 static uint8_t* allocator(uint8_t* ptr, intptr_t old_size, intptr_t new_size) { 1479 static uint8_t* allocator(uint8_t* ptr, intptr_t old_size, intptr_t new_size) {
1479 void* new_ptr = realloc(reinterpret_cast<void*>(ptr), new_size); 1480 void* new_ptr = realloc(reinterpret_cast<void*>(ptr), new_size);
1480 return reinterpret_cast<uint8_t*>(new_ptr); 1481 return reinterpret_cast<uint8_t*>(new_ptr);
1481 } 1482 }
1482 1483
1483 1484
1484 DART_EXPORT Dart_Result Dart_PostIntArray(Dart_Port port, intptr_t field_count, 1485 DART_EXPORT Dart_Result Dart_PostIntArray(Dart_Port port,
1486 int field_count,
1485 intptr_t* data) { 1487 intptr_t* data) {
1486 uint8_t* buffer = NULL; 1488 uint8_t* buffer = NULL;
1487 MessageWriter writer(&buffer, &allocator); 1489 MessageWriter writer(&buffer, &allocator);
1488 1490
1489 writer.WriteMessage(field_count, data); 1491 writer.WriteMessage(field_count, data);
1490 1492
1491 // Post the message at the given port. The allocated message and 1493 // Post the message at the given port. The allocated message and
1492 // buffer are deallocated after the message is processed. 1494 // buffer are deallocated after the message is processed.
1493 PortMessage* portMessage = new PortMessage(port, 0, buffer); 1495 PortMessage* portMessage = new PortMessage(port, 0, buffer);
1494 bool result = PortMap::PostMessage(portMessage); 1496 bool result = PortMap::PostMessage(portMessage);
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
1606 ASSERT(isolate != NULL); 1608 ASSERT(isolate != NULL);
1607 ApiState* state = isolate->api_state(); 1609 ApiState* state = isolate->api_state();
1608 ASSERT(state != NULL); 1610 ASSERT(state != NULL);
1609 ApiLocalScope* scope = state->top_scope(); 1611 ApiLocalScope* scope = state->top_scope();
1610 ASSERT(scope != NULL); 1612 ASSERT(scope != NULL);
1611 return scope->zone().Reallocate(ptr, old_size, new_size); 1613 return scope->zone().Reallocate(ptr, old_size, new_size);
1612 } 1614 }
1613 1615
1614 1616
1615 } // namespace dart 1617 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/dart.cc ('k') | runtime/vm/parser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698