0
0
mirror of https://github.com/mongodb/mongo.git synced 2024-11-30 09:06:21 +01:00

fix compile warnings MINOR

This commit is contained in:
Aaron 2009-05-04 18:45:32 -04:00
parent 2409174927
commit 2c2c2df901
2 changed files with 6 additions and 6 deletions

View File

@ -30,4 +30,4 @@ namespace mongo {
return mongoToV8Element( ret.firstElement() ); return mongoToV8Element( ret.firstElement() );
} }
} // namespace mongo } // namespace mongo

View File

@ -116,7 +116,7 @@ BSONObj Load(const BSONObj& args) {
BSONObj Quit(const BSONObj& args) { BSONObj Quit(const BSONObj& args) {
// If not arguments are given first element will be EOO, which // If not arguments are given first element will be EOO, which
// converts to the integer value 0. // converts to the integer value 0.
int exit_code = args.firstElement().number(); int exit_code = int( args.firstElement().number() );
::exit(exit_code); ::exit(exit_code);
return undefined_; return undefined_;
} }
@ -210,7 +210,7 @@ void sleepms( int ms ) {
mongo::BSONObj JSSleep(const mongo::BSONObj &args){ mongo::BSONObj JSSleep(const mongo::BSONObj &args){
assert( args.nFields() == 1 ); assert( args.nFields() == 1 );
assert( args.firstElement().isNumber() ); assert( args.firstElement().isNumber() );
int ms = args.firstElement().number(); int ms = int( args.firstElement().number() );
{ {
v8::Unlocker u; v8::Unlocker u;
sleepms( ms ); sleepms( ms );
@ -547,14 +547,14 @@ void killDb( int port, int signal ) {
BSONObj StopMongoProgram( const BSONObj &a ) { BSONObj StopMongoProgram( const BSONObj &a ) {
assert( a.nFields() == 1 || a.nFields() == 2 ); assert( a.nFields() == 1 || a.nFields() == 2 );
assert( a.firstElement().isNumber() ); assert( a.firstElement().isNumber() );
int port = a.firstElement().number(); int port = int( a.firstElement().number() );
int signal = SIGTERM; int signal = SIGTERM;
if ( a.nFields() == 2 ) { if ( a.nFields() == 2 ) {
BSONObjIterator i( a ); BSONObjIterator i( a );
i.next(); i.next();
BSONElement e = i.next(); BSONElement e = i.next();
assert( e.isNumber() ); assert( e.isNumber() );
signal = e.number(); signal = int( e.number() );
} }
killDb( port, signal ); killDb( port, signal );
cout << "shell: stopped mongo program on port " << port << endl; cout << "shell: stopped mongo program on port " << port << endl;
@ -601,7 +601,7 @@ BSONObj AllocatePorts( const BSONObj &args ) {
jsassert( args.nFields() == 1 , "allocatePorts takes exactly 1 argument" ); jsassert( args.nFields() == 1 , "allocatePorts takes exactly 1 argument" );
jsassert( args.firstElement().isNumber() , "allocatePorts needs to be passed an integer" ); jsassert( args.firstElement().isNumber() , "allocatePorts needs to be passed an integer" );
int n = args.firstElement().number(); int n = int( args.firstElement().number() );
vector< int > ports; vector< int > ports;
for( int i = 0; i < n; ++i ) { for( int i = 0; i < n; ++i ) {