Skip to content

Commit

Permalink
Fix gcc warnings in node.cc
Browse files Browse the repository at this point in the history
  • Loading branch information
ry committed Mar 15, 2010
1 parent 5c712a7 commit 3994340
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/node.cc
Original file line number Diff line number Diff line change
Expand Up @@ -410,6 +410,7 @@ static Handle<Value> ByteLength(const Arguments& args) {

static Handle<Value> Loop(const Arguments& args) {
HandleScope scope;
assert(args.Length() == 0);

// TODO Probably don't need to start this each time.
// Avoids failing on test/mjsunit/test-eio-race3.js though
Expand Down Expand Up @@ -453,6 +454,7 @@ static Handle<Value> Chdir(const Arguments& args) {

static Handle<Value> Cwd(const Arguments& args) {
HandleScope scope;
assert(args.Length() == 0);

char output[PATH_MAX];
char *r = getcwd(output, PATH_MAX);
Expand Down Expand Up @@ -484,23 +486,25 @@ static Handle<Value> Umask(const Arguments& args){

static Handle<Value> GetUid(const Arguments& args) {
HandleScope scope;
assert(args.Length() == 0);
int uid = getuid();
return scope.Close(Integer::New(uid));
}

static Handle<Value> GetGid(const Arguments& args) {
HandleScope scope;
assert(args.Length() == 0);
int gid = getgid();
return scope.Close(Integer::New(gid));
}


static Handle<Value> SetGid(const Arguments& args) {
HandleScope scope;

if (args.Length() < 1) {
return ThrowException(Exception::Error(
String::New("setgid requires 1 argument")));
String::New("setgid requires 1 argument")));
}

Local<Integer> given_gid = args[0]->ToInteger();
Expand Down Expand Up @@ -735,6 +739,7 @@ int getmem(size_t *rss, size_t *vsize) {

v8::Handle<v8::Value> MemoryUsage(const v8::Arguments& args) {
HandleScope scope;
assert(args.Length() == 0);

#ifndef HAVE_GETMEM
return ThrowException(Exception::Error(String::New("Not support on your platform. (Talk to Ryan.)")));
Expand Down Expand Up @@ -860,7 +865,7 @@ Handle<Value> EvalCX(const Arguments& args) {
// Copy objects from global context, to our brand new context
Handle<Array> keys = sandbox->GetPropertyNames();

int i;
unsigned int i;
for (i = 0; i < keys->Length(); i++) {
Handle<String> key = keys->Get(Integer::New(i))->ToString();
Handle<Value> value = sandbox->Get(key);
Expand Down Expand Up @@ -1003,6 +1008,7 @@ static void DebugMessageDispatch(void) {

static Handle<Value> CheckBreak(const Arguments& args) {
HandleScope scope;
assert(args.Length() == 0);

// TODO FIXME This function is a hack to wait until V8 is ready to accept
// commands. There seems to be a bug in EnableAgent( _ , _ , true) which
Expand Down

0 comments on commit 3994340

Please sign in to comment.