From 090e37b08b55d785429ad62925b8ad1386c7bfeb Mon Sep 17 00:00:00 2001 From: Mathias Stearn Date: Fri, 30 Dec 2011 17:52:01 -0500 Subject: Compile cleanly with -Werror on clang++ 3.0. Warnings: * incrementing a bool (deprecated) * hiding virtual method with overload (usually incorrect signature) * operator ?: and << precedence issues --- src/mongo/db/geo/haystack.cpp | 2 +- src/mongo/db/instance.cpp | 4 ++-- src/mongo/db/instance.h | 2 +- src/mongo/s/d_chunk_manager.cpp | 2 +- src/mongo/util/assert_util.cpp | 3 ++- src/mongo/util/bufreader.h | 2 +- 6 files changed, 8 insertions(+), 7 deletions(-) (limited to 'src/mongo') diff --git a/src/mongo/db/geo/haystack.cpp b/src/mongo/db/geo/haystack.cpp index 104665087f6..13e4863d043 100644 --- a/src/mongo/db/geo/haystack.cpp +++ b/src/mongo/db/geo/haystack.cpp @@ -264,7 +264,7 @@ namespace mongo { GeoHaystackSearchCommand() : Command( "geoSearch" ) {} virtual LockType locktype() const { return READ; } bool slaveOk() const { return true; } - bool slaveOverrideOk() const { return true; } + bool slaveOverrideOk() { return true; } bool run(const string& dbname , BSONObj& cmdObj, int, string& errmsg, BSONObjBuilder& result, bool fromRepl) { string ns = dbname + "." + cmdObj.firstElement().valuestr(); diff --git a/src/mongo/db/instance.cpp b/src/mongo/db/instance.cpp index c8f8c6ea85b..5aaf3c8ae85 100644 --- a/src/mongo/db/instance.cpp +++ b/src/mongo/db/instance.cpp @@ -808,10 +808,10 @@ namespace mongo { } auto_ptr DBDirectClient::query(const string &ns, Query query, int nToReturn , int nToSkip , - const BSONObj *fieldsToReturn , int queryOptions ) { + const BSONObj *fieldsToReturn , int queryOptions , int batchSize) { //if ( ! query.obj.isEmpty() || nToReturn != 0 || nToSkip != 0 || fieldsToReturn || queryOptions ) - return DBClientBase::query( ns , query , nToReturn , nToSkip , fieldsToReturn , queryOptions ); + return DBClientBase::query( ns , query , nToReturn , nToSkip , fieldsToReturn , queryOptions , batchSize ); // //assert( query.obj.isEmpty() ); //throw UserException( (string)"yay:" + ns ); diff --git a/src/mongo/db/instance.h b/src/mongo/db/instance.h index 9dde729997d..c4089bbda66 100644 --- a/src/mongo/db/instance.h +++ b/src/mongo/db/instance.h @@ -129,7 +129,7 @@ namespace mongo { class DBDirectClient : public DBClientBase { public: virtual auto_ptr query(const string &ns, Query query, int nToReturn = 0, int nToSkip = 0, - const BSONObj *fieldsToReturn = 0, int queryOptions = 0); + const BSONObj *fieldsToReturn = 0, int queryOptions = 0, int batchSize = 0); virtual bool isFailed() const { return false; diff --git a/src/mongo/s/d_chunk_manager.cpp b/src/mongo/s/d_chunk_manager.cpp index 82a06f61f2c..690e572a20f 100644 --- a/src/mongo/s/d_chunk_manager.cpp +++ b/src/mongo/s/d_chunk_manager.cpp @@ -210,7 +210,7 @@ namespace mongo { ostringstream os; os << "ranges differ, " << "requested: " << min << " -> " << max << " " - << "existing: " << (it == _chunksMap.end()) ? "" : it->first.toString() + " -> " + it->second.toString(); + << "existing: " << ((it == _chunksMap.end()) ? "" : it->first.toString() + " -> " + it->second.toString()); uasserted( 13587 , os.str() ); } } diff --git a/src/mongo/util/assert_util.cpp b/src/mongo/util/assert_util.cpp index 7e0f80dad48..f4ce9ba66cf 100644 --- a/src/mongo/util/assert_util.cpp +++ b/src/mongo/util/assert_util.cpp @@ -85,7 +85,8 @@ namespace mongo { static time_t lastWhen; static unsigned lastLine; if( lastLine == line && time(0)-lastWhen < 5 ) { - if( rateLimited++ == 0 ) { + if( !rateLimited ) { + rateLimited = true; log() << "rate limiting wassert" << endl; } return; diff --git a/src/mongo/util/bufreader.h b/src/mongo/util/bufreader.h index 53f0ba744e2..58257ce011d 100644 --- a/src/mongo/util/bufreader.h +++ b/src/mongo/util/bufreader.h @@ -29,7 +29,7 @@ namespace mongo { class eof : public std::exception { public: eof() { } - virtual const char * what() { return "BufReader eof"; } + virtual const char * what() const throw() { return "BufReader eof"; } }; BufReader(const void *p, unsigned len) : _start(p), _pos(p), _end(((char *)_pos)+len) { } -- cgit v1.2.1