From 41d7a25ed5b8cdd3e702e220720c122736ae26e9 Mon Sep 17 00:00:00 2001 From: Fedor Indutny Date: Thu, 22 Mar 2012 19:01:54 +0600 Subject: [PATCH] cio: Arguments => Value* [] --- deps/candor | 2 +- src/cio.cc | 8 ++++---- src/cio_string.cc | 16 ++++++++-------- src/lhttp_parser.cc | 10 +++++----- src/luv.cc | 2 +- src/luv_handle.cc | 2 +- src/luv_stream.cc | 16 ++++++++-------- src/luv_tcp.cc | 14 +++++++------- src/luv_timer.cc | 12 ++++++------ 9 files changed, 41 insertions(+), 41 deletions(-) diff --git a/deps/candor b/deps/candor index ced315d..d292028 160000 --- a/deps/candor +++ b/deps/candor @@ -1 +1 @@ -Subproject commit ced315dbf499c80e167eee0a2aa7a630a69df7a0 +Subproject commit d29202864ae85c978dd6f54df47e1192a76d0a98 diff --git a/src/cio.cc b/src/cio.cc index 2080644..cac415b 100644 --- a/src/cio.cc +++ b/src/cio.cc @@ -111,7 +111,7 @@ static void printValue(FILE* fd, Value* value, bool shallow) { } } -static Value* Print(uint32_t argc, Arguments& argv) { +static Value* Print(uint32_t argc, Value* argv[]) { // Print all arguments as strings with spaces and a newline. for (uint32_t i = 0; i < argc; i++) { String* string = argv[i]->ToString(); @@ -124,7 +124,7 @@ static Value* Print(uint32_t argc, Arguments& argv) { return Nil::New(); } -static Value* PrettyPrint(uint32_t argc, Arguments& argv) { +static Value* PrettyPrint(uint32_t argc, Value* argv[]) { // Print all arguments as strings with spaces and a newline. for (uint32_t i = 0; i < argc; i++) { printValue(stdout, argv[i], false); @@ -136,7 +136,7 @@ static Value* PrettyPrint(uint32_t argc, Arguments& argv) { return Nil::New(); } -static Value* Exit(uint32_t argc, Arguments& argv) { +static Value* Exit(uint32_t argc, Value* argv[]) { int status = 0; if (argc) { status = argv[0]->ToNumber()->IntegralValue(); @@ -145,7 +145,7 @@ static Value* Exit(uint32_t argc, Arguments& argv) { return Nil::New(); } -static Value* LoadBuiltin(uint32_t argc, Arguments& argv) { +static Value* LoadBuiltin(uint32_t argc, Value* argv[]) { assert(argc == 1); const char* name = argv[0]->As()->Value(); if (0 == strcmp(name, "string")) return cio_string_module(); diff --git a/src/cio_string.cc b/src/cio_string.cc index 1b124dc..05b0437 100644 --- a/src/cio_string.cc +++ b/src/cio_string.cc @@ -6,7 +6,7 @@ using namespace candor; -static Value* readUInt8(uint32_t argc, Arguments& argv) { +static Value* readUInt8(uint32_t argc, Value* argv[]) { assert(argc == 2 && argv[0]->Is() && argv[1]->Is()); String* str = argv[0]->ToString(); unsigned int offset = argv[1]->ToNumber()->IntegralValue(); @@ -14,7 +14,7 @@ static Value* readUInt8(uint32_t argc, Arguments& argv) { return Number::NewIntegral(*(uint8_t*)((uint8_t*)str->Value() + offset)); } -static Value* readInt8(uint32_t argc, Arguments& argv) { +static Value* readInt8(uint32_t argc, Value* argv[]) { assert(argc == 2 && argv[0]->Is() && argv[1]->Is()); String* str = argv[0]->ToString(); unsigned int offset = argv[1]->ToNumber()->IntegralValue(); @@ -22,7 +22,7 @@ static Value* readInt8(uint32_t argc, Arguments& argv) { return Number::NewIntegral(*(int8_t*)((uint8_t*)str->Value() + offset)); } -static Value* readUInt16(uint32_t argc, Arguments& argv) { +static Value* readUInt16(uint32_t argc, Value* argv[]) { assert(argc == 2 && argv[0]->Is() && argv[1]->Is()); String* str = argv[0]->ToString(); unsigned int offset = argv[1]->ToNumber()->IntegralValue(); @@ -30,7 +30,7 @@ static Value* readUInt16(uint32_t argc, Arguments& argv) { return Number::NewIntegral(*(uint16_t*)((uint8_t*)str->Value() + offset)); } -static Value* readInt16(uint32_t argc, Arguments& argv) { +static Value* readInt16(uint32_t argc, Value* argv[]) { assert(argc == 2 && argv[0]->Is() && argv[1]->Is()); String* str = argv[0]->ToString(); unsigned int offset = argv[1]->ToNumber()->IntegralValue(); @@ -38,7 +38,7 @@ static Value* readInt16(uint32_t argc, Arguments& argv) { return Number::NewIntegral(*(int16_t*)((uint8_t*)str->Value() + offset)); } -static Value* readUInt32(uint32_t argc, Arguments& argv) { +static Value* readUInt32(uint32_t argc, Value* argv[]) { assert(argc == 2 && argv[0]->Is() && argv[1]->Is()); String* str = argv[0]->ToString(); unsigned int offset = argv[1]->ToNumber()->IntegralValue(); @@ -46,7 +46,7 @@ static Value* readUInt32(uint32_t argc, Arguments& argv) { return Number::NewIntegral(*(uint32_t*)((uint8_t*)str->Value() + offset)); } -static Value* readInt32(uint32_t argc, Arguments& argv) { +static Value* readInt32(uint32_t argc, Value* argv[]) { assert(argc == 2 && argv[0]->Is() && argv[1]->Is()); String* str = argv[0]->ToString(); unsigned int offset = argv[1]->ToNumber()->IntegralValue(); @@ -54,7 +54,7 @@ static Value* readInt32(uint32_t argc, Arguments& argv) { return Number::NewIntegral(*(int32_t*)((uint8_t*)str->Value() + offset)); } -static Value* readUInt64(uint32_t argc, Arguments& argv) { +static Value* readUInt64(uint32_t argc, Value* argv[]) { assert(argc == 2 && argv[0]->Is() && argv[1]->Is()); String* str = argv[0]->ToString(); unsigned int offset = argv[1]->ToNumber()->IntegralValue(); @@ -62,7 +62,7 @@ static Value* readUInt64(uint32_t argc, Arguments& argv) { return Number::NewIntegral(*(uint64_t*)((uint8_t*)str->Value() + offset)); } -static Value* readInt64(uint32_t argc, Arguments& argv) { +static Value* readInt64(uint32_t argc, Value* argv[]) { assert(argc == 2 && argv[0]->Is() && argv[1]->Is()); String* str = argv[0]->ToString(); unsigned int offset = argv[1]->ToNumber()->IntegralValue(); diff --git a/src/lhttp_parser.cc b/src/lhttp_parser.cc index 8f541e2..61419b1 100644 --- a/src/lhttp_parser.cc +++ b/src/lhttp_parser.cc @@ -54,7 +54,7 @@ static int lhttp_on_message_complete(http_parser* parser) { return emit(parser, "onMessageComplete"); } -static Value* lhttp_create(uint32_t argc, Arguments& argv) { +static Value* lhttp_create(uint32_t argc, Value* argv[]) { assert(argc == 0); Object* obj = Object::New(); CData* cdata = CData::New(sizeof(http_parser)); @@ -64,7 +64,7 @@ static Value* lhttp_create(uint32_t argc, Arguments& argv) { return obj; } -static Value* lhttp_init(uint32_t argc, Arguments& argv) { +static Value* lhttp_init(uint32_t argc, Value* argv[]) { assert(argc >= 2 && argc <= 3); Object* obj = argv[0]->As(); http_parser* parser = (http_parser*)obj->Get("cdata")->As()->GetContents(); @@ -90,7 +90,7 @@ static Value* lhttp_init(uint32_t argc, Arguments& argv) { return Nil::New(); } -static Value* lhttp_execute(uint32_t argc, Arguments& argv) { +static Value* lhttp_execute(uint32_t argc, Value* argv[]) { assert(argc == 2); Object* obj = argv[0]->As(); http_parser* parser = (http_parser*)obj->Get("cdata")->As()->GetContents(); @@ -101,7 +101,7 @@ static Value* lhttp_execute(uint32_t argc, Arguments& argv) { return Number::NewIntegral(nparsed); } -static Value* lhttp_pause(uint32_t argc, Arguments& argv) { +static Value* lhttp_pause(uint32_t argc, Value* argv[]) { assert(argc == 2); Object* obj = argv[0]->As(); http_parser* parser = (http_parser*)obj->Get("cdata")->As()->GetContents(); @@ -110,7 +110,7 @@ static Value* lhttp_pause(uint32_t argc, Arguments& argv) { return Nil::New(); } -static Value* lhttp_parse_url(uint32_t argc, Arguments& argv) { +static Value* lhttp_parse_url(uint32_t argc, Value* argv[]) { assert(argc >= 1 && argv[0]->Is()); String* str = argv[0]->ToString(); size_t buflen = str->Length(); diff --git a/src/luv.cc b/src/luv.cc index a62500f..5b2a7bd 100644 --- a/src/luv.cc +++ b/src/luv.cc @@ -7,7 +7,7 @@ using namespace candor; -static Value* luv_last_error(uint32_t argc, Arguments& argv) { +static Value* luv_last_error(uint32_t argc, Value* argv[]) { assert(argc == 0); Object* error = Object::New(); uv_err_t err = uv_last_error(uv_default_loop()); diff --git a/src/luv_handle.cc b/src/luv_handle.cc index 3bd79b9..32e7c0b 100644 --- a/src/luv_handle.cc +++ b/src/luv_handle.cc @@ -15,7 +15,7 @@ static void luv_on_close(uv_handle_t* handle) { } } -static Value* luv_close(uint32_t argc, Arguments& argv) { +static Value* luv_close(uint32_t argc, Value* argv[]) { assert(argc >= 1 && argc <= 2); Object* obj = argv[0]->As(); uv_handle_t* handle = (uv_handle_t*)obj->Get("cdata")->As()->GetContents(); diff --git a/src/luv_stream.cc b/src/luv_stream.cc index 00de03f..43f683e 100644 --- a/src/luv_stream.cc +++ b/src/luv_stream.cc @@ -19,7 +19,7 @@ static void luv_on_shutdown(uv_shutdown_t* req, int status) { delete req; } -static Value* luv_shutdown(uint32_t argc, Arguments& argv) { +static Value* luv_shutdown(uint32_t argc, Value* argv[]) { assert(argc >= 1 && argc <= 2); Object* obj = argv[0]->As(); uv_stream_t* handle = (uv_stream_t*)obj->Get("cdata")->As()->GetContents(); @@ -42,7 +42,7 @@ static void luv_on_connection(uv_stream_t* server, int status) { } } -static Value* luv_listen(uint32_t argc, Arguments& argv) { +static Value* luv_listen(uint32_t argc, Value* argv[]) { assert(argc >= 2 && argc <= 3); Object* obj = argv[0]->As(); uv_stream_t* handle = (uv_stream_t*)obj->Get("cdata")->As()->GetContents(); @@ -54,7 +54,7 @@ static Value* luv_listen(uint32_t argc, Arguments& argv) { return Number::NewIntegral(status); } -static Value* luv_accept(uint32_t argc, Arguments& argv) { +static Value* luv_accept(uint32_t argc, Value* argv[]) { assert(argc == 2); Object* obj = argv[0]->As(); uv_stream_t* handle = (uv_stream_t*)obj->Get("cdata")->As()->GetContents(); @@ -87,7 +87,7 @@ static void luv_on_read(uv_stream_t* stream, ssize_t nread, uv_buf_t buf) { delete buf.base; } -static Value* luv_read_start(uint32_t argc, Arguments& argv) { +static Value* luv_read_start(uint32_t argc, Value* argv[]) { assert(argc >= 1 && argc <= 2); Object* obj = argv[0]->As(); uv_stream_t* handle = (uv_stream_t*)obj->Get("cdata")->As()->GetContents(); @@ -98,7 +98,7 @@ static Value* luv_read_start(uint32_t argc, Arguments& argv) { return Number::NewIntegral(status); } -static Value* luv_read_stop(uint32_t argc, Arguments& argv) { +static Value* luv_read_stop(uint32_t argc, Value* argv[]) { assert(argc == 1); Object* obj = argv[0]->As(); uv_stream_t* handle = (uv_stream_t*)obj->Get("cdata")->As()->GetContents(); @@ -118,7 +118,7 @@ static void luv_on_write(uv_write_t* req, int status) { // } } -static Value* luv_write(uint32_t argc, Arguments& argv) { +static Value* luv_write(uint32_t argc, Value* argv[]) { assert(argc >= 2 && argc <= 3); Object* obj = argv[0]->As(); uv_stream_t* handle = (uv_stream_t*)obj->Get("cdata")->As()->GetContents(); @@ -138,7 +138,7 @@ static Value* luv_write(uint32_t argc, Arguments& argv) { return Number::NewIntegral(status); } -static Value* luv_is_readable(uint32_t argc, Arguments& argv) { +static Value* luv_is_readable(uint32_t argc, Value* argv[]) { assert(argc == 1); Object* obj = argv[0]->As(); uv_stream_t* handle = (uv_stream_t*)obj->Get("cdata")->As()->GetContents(); @@ -147,7 +147,7 @@ static Value* luv_is_readable(uint32_t argc, Arguments& argv) { Boolean::False(); } -static Value* luv_is_writable(uint32_t argc, Arguments& argv) { +static Value* luv_is_writable(uint32_t argc, Value* argv[]) { assert(argc == 1); Object* obj = argv[0]->As(); uv_stream_t* handle = (uv_stream_t*)obj->Get("cdata")->As()->GetContents(); diff --git a/src/luv_tcp.cc b/src/luv_tcp.cc index c620159..0f467e3 100644 --- a/src/luv_tcp.cc +++ b/src/luv_tcp.cc @@ -24,7 +24,7 @@ using namespace candor; using namespace candor; -static Value* luv_create_tcp(uint32_t argc, Arguments& argv) { +static Value* luv_create_tcp(uint32_t argc, Value* argv[]) { assert(argc == 0); Object* obj = uv_tcp_prototype()->Clone(); CData* cdata = CData::New(sizeof(uv_tcp_t)); @@ -35,7 +35,7 @@ static Value* luv_create_tcp(uint32_t argc, Arguments& argv) { return obj; } -static Value* luv_tcp_nodelay(uint32_t argc, Arguments& argv) { +static Value* luv_tcp_nodelay(uint32_t argc, Value* argv[]) { assert(argc == 2); Object* obj = argv[0]->As(); uv_tcp_t* handle = (uv_tcp_t*)obj->Get("cdata")->As()->GetContents(); @@ -44,7 +44,7 @@ static Value* luv_tcp_nodelay(uint32_t argc, Arguments& argv) { return Number::NewIntegral(status); } -static Value* luv_tcp_keepalive(uint32_t argc, Arguments& argv) { +static Value* luv_tcp_keepalive(uint32_t argc, Value* argv[]) { assert(argc == 3); Object* obj = argv[0]->As(); uv_tcp_t* handle = (uv_tcp_t*)obj->Get("cdata")->As()->GetContents(); @@ -54,7 +54,7 @@ static Value* luv_tcp_keepalive(uint32_t argc, Arguments& argv) { return Number::NewIntegral(status); } -static Value* luv_tcp_bind(uint32_t argc, Arguments& argv) { +static Value* luv_tcp_bind(uint32_t argc, Value* argv[]) { assert(argc == 3); Object* obj = argv[0]->As(); uv_tcp_t* handle = (uv_tcp_t*)obj->Get("cdata")->As()->GetContents(); @@ -64,7 +64,7 @@ static Value* luv_tcp_bind(uint32_t argc, Arguments& argv) { return Number::NewIntegral(status); } -static Value* luv_tcp_getsockname(uint32_t argc, Arguments& argv) { +static Value* luv_tcp_getsockname(uint32_t argc, Value* argv[]) { assert(argc == 1); Object* obj = argv[0]->As(); uv_tcp_t* handle = (uv_tcp_t*)obj->Get("cdata")->As()->GetContents(); @@ -91,7 +91,7 @@ static Value* luv_tcp_getsockname(uint32_t argc, Arguments& argv) { return result; } -static Value* luv_tcp_getpeername(uint32_t argc, Arguments& argv) { +static Value* luv_tcp_getpeername(uint32_t argc, Value* argv[]) { assert(argc == 1); Object* obj = argv[0]->As(); uv_tcp_t* handle = (uv_tcp_t*)obj->Get("cdata")->As()->GetContents(); @@ -129,7 +129,7 @@ static void luv_on_connect(uv_connect_t* req, int status) { delete req; } -static Value* luv_tcp_connect(uint32_t argc, Arguments& argv) { +static Value* luv_tcp_connect(uint32_t argc, Value* argv[]) { assert(argc >= 3 && argc <= 4); Object* obj = argv[0]->As(); uv_tcp_t* handle = (uv_tcp_t*)obj->Get("cdata")->As()->GetContents(); diff --git a/src/luv_timer.cc b/src/luv_timer.cc index c17cddd..8bc4e54 100644 --- a/src/luv_timer.cc +++ b/src/luv_timer.cc @@ -8,7 +8,7 @@ using namespace candor; -static Value* luv_create_timer(uint32_t argc, Arguments& argv) { +static Value* luv_create_timer(uint32_t argc, Value* argv[]) { assert(argc == 0); Object* obj = uv_timer_prototype()->Clone(); CData* cdata = CData::New(sizeof(uv_timer_t)); @@ -29,7 +29,7 @@ static void luv_on_timer(uv_timer_t* handle, int status) { } } -static Value* luv_timer_start(uint32_t argc, Arguments& argv) { +static Value* luv_timer_start(uint32_t argc, Value* argv[]) { assert(argc >= 3 && argc <= 4); Object* obj = argv[0]->As(); uv_timer_t* handle = (uv_timer_t*)obj->Get("cdata")->As()->GetContents(); @@ -42,7 +42,7 @@ static Value* luv_timer_start(uint32_t argc, Arguments& argv) { return Number::NewIntegral(status); } -static Value* luv_timer_stop(uint32_t argc, Arguments& argv) { +static Value* luv_timer_stop(uint32_t argc, Value* argv[]) { assert(argc == 1); Object* obj = argv[0]->As(); uv_timer_t* handle = (uv_timer_t*)obj->Get("cdata")->As()->GetContents(); @@ -50,7 +50,7 @@ static Value* luv_timer_stop(uint32_t argc, Arguments& argv) { return Number::NewIntegral(status); } -static Value* luv_timer_again(uint32_t argc, Arguments& argv) { +static Value* luv_timer_again(uint32_t argc, Value* argv[]) { assert(argc == 1); Object* obj = argv[0]->As(); uv_timer_t* handle = (uv_timer_t*)obj->Get("cdata")->As()->GetContents(); @@ -58,7 +58,7 @@ static Value* luv_timer_again(uint32_t argc, Arguments& argv) { return Number::NewIntegral(status); } -static Value* luv_timer_get_repeat(uint32_t argc, Arguments& argv) { +static Value* luv_timer_get_repeat(uint32_t argc, Value* argv[]) { assert(argc == 1); Object* obj = argv[0]->As(); uv_timer_t* handle = (uv_timer_t*)obj->Get("cdata")->As()->GetContents(); @@ -66,7 +66,7 @@ static Value* luv_timer_get_repeat(uint32_t argc, Arguments& argv) { return Number::NewIntegral(repeat); } -static Value* luv_timer_set_repeat(uint32_t argc, Arguments& argv) { +static Value* luv_timer_set_repeat(uint32_t argc, Value* argv[]) { assert(argc == 2); Object* obj = argv[0]->As(); uv_timer_t* handle = (uv_timer_t*)obj->Get("cdata")->As()->GetContents();