0
0
mirror of https://github.com/nodejs/node.git synced 2024-12-01 16:10:02 +01:00

Fix gcc warnings in node.cc

This commit is contained in:
Ryan Dahl 2010-03-15 12:49:40 -07:00
parent 5c712a7da5
commit 3994340a45

View File

@ -410,6 +410,7 @@ static Handle<Value> ByteLength(const Arguments& args) {
static Handle<Value> Loop(const Arguments& args) { static Handle<Value> Loop(const Arguments& args) {
HandleScope scope; HandleScope scope;
assert(args.Length() == 0);
// TODO Probably don't need to start this each time. // TODO Probably don't need to start this each time.
// Avoids failing on test/mjsunit/test-eio-race3.js though // Avoids failing on test/mjsunit/test-eio-race3.js though
@ -453,6 +454,7 @@ static Handle<Value> Chdir(const Arguments& args) {
static Handle<Value> Cwd(const Arguments& args) { static Handle<Value> Cwd(const Arguments& args) {
HandleScope scope; HandleScope scope;
assert(args.Length() == 0);
char output[PATH_MAX]; char output[PATH_MAX];
char *r = getcwd(output, PATH_MAX); char *r = getcwd(output, PATH_MAX);
@ -484,12 +486,14 @@ static Handle<Value> Umask(const Arguments& args){
static Handle<Value> GetUid(const Arguments& args) { static Handle<Value> GetUid(const Arguments& args) {
HandleScope scope; HandleScope scope;
assert(args.Length() == 0);
int uid = getuid(); int uid = getuid();
return scope.Close(Integer::New(uid)); return scope.Close(Integer::New(uid));
} }
static Handle<Value> GetGid(const Arguments& args) { static Handle<Value> GetGid(const Arguments& args) {
HandleScope scope; HandleScope scope;
assert(args.Length() == 0);
int gid = getgid(); int gid = getgid();
return scope.Close(Integer::New(gid)); return scope.Close(Integer::New(gid));
} }
@ -497,10 +501,10 @@ static Handle<Value> GetGid(const Arguments& args) {
static Handle<Value> SetGid(const Arguments& args) { static Handle<Value> SetGid(const Arguments& args) {
HandleScope scope; HandleScope scope;
if (args.Length() < 1) { if (args.Length() < 1) {
return ThrowException(Exception::Error( return ThrowException(Exception::Error(
String::New("setgid requires 1 argument"))); String::New("setgid requires 1 argument")));
} }
Local<Integer> given_gid = args[0]->ToInteger(); Local<Integer> given_gid = args[0]->ToInteger();
@ -735,6 +739,7 @@ error:
v8::Handle<v8::Value> MemoryUsage(const v8::Arguments& args) { v8::Handle<v8::Value> MemoryUsage(const v8::Arguments& args) {
HandleScope scope; HandleScope scope;
assert(args.Length() == 0);
#ifndef HAVE_GETMEM #ifndef HAVE_GETMEM
return ThrowException(Exception::Error(String::New("Not support on your platform. (Talk to Ryan.)"))); return ThrowException(Exception::Error(String::New("Not support on your platform. (Talk to Ryan.)")));
@ -860,7 +865,7 @@ Handle<Value> EvalCX(const Arguments& args) {
// Copy objects from global context, to our brand new context // Copy objects from global context, to our brand new context
Handle<Array> keys = sandbox->GetPropertyNames(); Handle<Array> keys = sandbox->GetPropertyNames();
int i; unsigned int i;
for (i = 0; i < keys->Length(); i++) { for (i = 0; i < keys->Length(); i++) {
Handle<String> key = keys->Get(Integer::New(i))->ToString(); Handle<String> key = keys->Get(Integer::New(i))->ToString();
Handle<Value> value = sandbox->Get(key); Handle<Value> value = sandbox->Get(key);
@ -1003,6 +1008,7 @@ static void DebugMessageDispatch(void) {
static Handle<Value> CheckBreak(const Arguments& args) { static Handle<Value> CheckBreak(const Arguments& args) {
HandleScope scope; HandleScope scope;
assert(args.Length() == 0);
// TODO FIXME This function is a hack to wait until V8 is ready to accept // 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 // commands. There seems to be a bug in EnableAgent( _ , _ , true) which