Browse Source

Fix unused variable warnings.

v0.7.4-release
Ryan 16 years ago
parent
commit
e876d6629e
  1. 12
      src/net.cc
  2. 2
      src/net.h
  3. 11
      src/node.cc
  4. 7
      src/process.cc
  5. 2
      src/timer.cc
  6. 2
      test/mjsunit/test-http-cat.js
  7. 2
      test/mjsunit/test-node-cat.js

12
src/net.cc

@ -75,13 +75,15 @@ Connection::Initialize (v8::Handle<v8::Object> target)
} }
Handle<Value> Handle<Value>
Connection::ReadyStateGetter (Local<String> _, const AccessorInfo& info) Connection::ReadyStateGetter (Local<String> property, const AccessorInfo& info)
{ {
Connection *connection = NODE_UNWRAP(Connection, info.This()); Connection *connection = NODE_UNWRAP(Connection, info.This());
if (!connection) return Handle<Value>(); if (!connection) return Handle<Value>();
HandleScope scope; HandleScope scope;
assert(property == READY_STATE_SYMBOL);
switch(connection->ReadyState()) { switch(connection->ReadyState()) {
case OPEN: return scope.Close(OPEN_SYMBOL); case OPEN: return scope.Close(OPEN_SYMBOL);
case OPENING: return scope.Close(OPENING_SYMBOL); case OPENING: return scope.Close(OPENING_SYMBOL);
@ -131,12 +133,6 @@ Connection::~Connection ()
ForceClose(); ForceClose();
} }
void
Connection::SetServer (Handle<Object> server_handle)
{
HandleScope scope;
}
Handle<Value> Handle<Value>
Connection::New (const Arguments& args) Connection::New (const Arguments& args)
{ {
@ -557,6 +553,8 @@ Server::OnConnection (struct sockaddr *addr, socklen_t len)
{ {
HandleScope scope; HandleScope scope;
assert(len > 0); // just to get rid of the warning.
TryCatch try_catch; TryCatch try_catch;
Local<Object> js_connection = Local<Object> js_connection =

2
src/net.h

@ -42,8 +42,6 @@ protected:
void FullClose (void) { oi_socket_full_close(&socket_); } void FullClose (void) { oi_socket_full_close(&socket_); }
void ForceClose (void) { oi_socket_force_close(&socket_); } void ForceClose (void) { oi_socket_force_close(&socket_); }
void SetServer (v8::Handle<v8::Object> server_handle);
virtual void OnConnect (void); virtual void OnConnect (void);
virtual void OnReceive (const void *buf, size_t len); virtual void OnReceive (const void *buf, size_t len);
virtual void OnDrain (void); virtual void OnDrain (void);

11
src/node.cc

@ -83,9 +83,12 @@ ObjectWrap::Unwrap (Handle<Object> handle)
} }
void void
ObjectWrap::MakeWeak (Persistent<Value> _, void *data) ObjectWrap::MakeWeak (Persistent<Value> value, void *data)
{ {
ObjectWrap *obj = static_cast<ObjectWrap*> (data); ObjectWrap *obj = static_cast<ObjectWrap*> (data);
assert(value == obj->handle_);
obj->weak_ = true; obj->weak_ = true;
if (obj->attach_count_ == 0) if (obj->attach_count_ == 0)
delete obj; delete obj;
@ -247,9 +250,11 @@ node::FatalException (TryCatch &try_catch)
static ev_async eio_watcher; static ev_async eio_watcher;
static void static void
node_eio_cb (EV_P_ ev_async *w, int revents) node_eio_cb (EV_P_ ev_async *watcher, int revents)
{ {
int r = eio_poll(); assert(watcher == &eio_watcher);
assert(revents == EV_ASYNC);
eio_poll();
} }
static void static void

7
src/process.cc

@ -65,12 +65,13 @@ Process::New (const Arguments& args)
} }
Handle<Value> Handle<Value>
Process::PIDGetter (Local<String> _, const AccessorInfo& info) Process::PIDGetter (Local<String> property, const AccessorInfo& info)
{ {
HandleScope scope;
Process *process = NODE_UNWRAP(Process, info.This()); Process *process = NODE_UNWRAP(Process, info.This());
assert(process);
HandleScope scope; assert(process);
assert(property == PID_SYMBOL);
if (process->pid_ == 0) return Null(); if (process->pid_ == 0) return Null();

2
src/timer.cc

@ -59,6 +59,8 @@ Timer::OnTimeout (EV_P_ ev_timer *watcher, int revents)
{ {
Timer *timer = static_cast<Timer*>(watcher->data); Timer *timer = static_cast<Timer*>(watcher->data);
assert(revents == EV_TIMEOUT);
timer->Emit("Timeout", 0, NULL); timer->Emit("Timeout", 0, NULL);
/* XXX i'm a bit worried if this is the correct test? /* XXX i'm a bit worried if this is the correct test?

2
test/mjsunit/test-http-cat.js

@ -15,7 +15,7 @@ server.listen(PORT);
var got_good_server_content = false; var got_good_server_content = false;
var bad_server_got_error = false; var bad_server_got_error = false;
function onLoad() { function onLoad () {
node.http.cat("http://localhost:"+PORT+"/", "utf8") node.http.cat("http://localhost:"+PORT+"/", "utf8")
.addCallback(function (content) { .addCallback(function (content) {
node.debug("got response"); node.debug("got response");

2
test/mjsunit/test-node-cat.js

@ -15,7 +15,7 @@ server.listen(PORT);
var errors = 0; var errors = 0;
var successes = 0; var successes = 0;
function onLoad() { function onLoad () {
var promise = node.cat("http://localhost:"+PORT, "utf8"); var promise = node.cat("http://localhost:"+PORT, "utf8");
promise.addCallback(function (content) { promise.addCallback(function (content) {

Loading…
Cancel
Save