summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMathias Stearn <redbeard0531@gmail.com>2011-04-03 19:10:36 -0400
committerMathias Stearn <mathias@10gen.com>2011-05-02 11:34:45 -0400
commitb7e87f07a6455279aeb65a5c18197b9e2025d3a2 (patch)
treefa6c7a506914fdc291b9d034c25deda8ecf771c4
parent4b5f2b33e8e7e858990bd4837f37c82290b7150d (diff)
downloadmongo-b7e87f07a6455279aeb65a5c18197b9e2025d3a2.tar.gz
g++ 4.6 compile (new -Wunused-but-set-variable warning)
-rw-r--r--db/btree.cpp2
-rw-r--r--db/dbcommands.cpp2
-rw-r--r--db/index.cpp1
-rw-r--r--db/update.cpp2
-rw-r--r--dbtests/queryoptimizertests.cpp2
-rw-r--r--shell/shell_utils.cpp2
-rw-r--r--tools/tool.cpp4
-rw-r--r--util/ramlog.h3
8 files changed, 6 insertions, 12 deletions
diff --git a/db/btree.cpp b/db/btree.cpp
index d547a1b0f38..242c53438aa 100644
--- a/db/btree.cpp
+++ b/db/btree.cpp
@@ -1188,8 +1188,6 @@ namespace mongo {
out() << " " << thisLoc.toString() << ".insertHere " << key.toString() << '/' << recordLoc.toString() << ' '
<< lchild.toString() << ' ' << rchild.toString() << " keypos:" << keypos << endl;
- DiskLoc oldLoc = thisLoc;
-
if ( !basicInsert(thisLoc, keypos, recordLoc, key, order) ) {
thisLoc.btreemod()->split(thisLoc, keypos, recordLoc, key, order, lchild, rchild, idx);
return;
diff --git a/db/dbcommands.cpp b/db/dbcommands.cpp
index 8974bd3503a..dadffaa2643 100644
--- a/db/dbcommands.cpp
+++ b/db/dbcommands.cpp
@@ -1542,7 +1542,7 @@ namespace mongo {
uassert( 13049, "godinsert must specify a collection", !coll.empty() );
string ns = dbname + "." + coll;
BSONObj obj = cmdObj[ "obj" ].embeddedObjectUserCheck();
- DiskLoc loc = theDataFileMgr.insertWithObjMod( ns.c_str(), obj, true );
+ theDataFileMgr.insertWithObjMod( ns.c_str(), obj, true );
return true;
}
} cmdGodInsert;
diff --git a/db/index.cpp b/db/index.cpp
index c696e278098..218ecb36f6b 100644
--- a/db/index.cpp
+++ b/db/index.cpp
@@ -127,7 +127,6 @@ namespace mongo {
void getIndexChanges(vector<IndexChanges>& v, NamespaceDetails& d, BSONObj newObj, BSONObj oldObj, bool &changedId) {
int z = d.nIndexesBeingBuilt();
v.resize(z);
- NamespaceDetails::IndexIterator i = d.ii();
for( int i = 0; i < z; i++ ) {
IndexDetails& idx = d.idx(i);
BSONObj idxKey = idx.info.obj().getObjectField("key"); // eg { ts : 1 }
diff --git a/db/update.cpp b/db/update.cpp
index e79d3d517d1..e53f2af7fe4 100644
--- a/db/update.cpp
+++ b/db/update.cpp
@@ -987,7 +987,7 @@ namespace mongo {
BSONObj newObj = mss->createNewFromMods();
checkTooLarge(newObj);
assert(nsdt);
- DiskLoc newLoc = theDataFileMgr.updateRecord(ns, d, nsdt, r, loc , newObj.objdata(), newObj.objsize(), debug);
+ theDataFileMgr.updateRecord(ns, d, nsdt, r, loc , newObj.objdata(), newObj.objsize(), debug);
}
if ( logop ) {
diff --git a/dbtests/queryoptimizertests.cpp b/dbtests/queryoptimizertests.cpp
index acf92174be3..2d6f7529063 100644
--- a/dbtests/queryoptimizertests.cpp
+++ b/dbtests/queryoptimizertests.cpp
@@ -1558,7 +1558,6 @@ namespace QueryOptimizerTests {
theDataFileMgr.insertWithObjMod( ns(), temp );
}
BSONObj hint = fromjson( "{$hint:{a:1,b:1}}" );
- BSONElement hintElt = hint.firstElement();
auto_ptr< FieldRangeSet > frs( new FieldRangeSet( ns(), fromjson( "{a:5,b:{$in:[2,3,6,9,11]}}" ) ) );
QueryPlan qp( nsd(), 1, *frs, *frs, fromjson( "{a:5,b:{$in:[2,3,6,9,11]}}" ), BSONObj() );
boost::shared_ptr<Cursor> c = qp.newCursor();
@@ -1581,7 +1580,6 @@ namespace QueryOptimizerTests {
theDataFileMgr.insertWithObjMod( ns(), temp );
}
BSONObj hint = fromjson( "{$hint:{a:1,b:1}}" );
- BSONElement hintElt = hint.firstElement();
auto_ptr< FieldRangeSet > frs( new FieldRangeSet( ns(), fromjson( "{a:{$gte:5},b:{$in:[2,3,6,9,11]}}" ) ) );
QueryPlan qp( nsd(), 1, *frs, *frs, fromjson( "{a:{$gte:5},b:{$in:[2,3,6,9,11]}}" ), BSONObj() );
boost::shared_ptr<Cursor> c = qp.newCursor();
diff --git a/shell/shell_utils.cpp b/shell/shell_utils.cpp
index 7a6203087cd..09a3e468e6f 100644
--- a/shell/shell_utils.cpp
+++ b/shell/shell_utils.cpp
@@ -265,7 +265,7 @@ namespace mongo {
BSONElement e = oneArg(args);
bool found = false;
- path root( args.firstElement().valuestrsafe() );
+ path root( e.valuestrsafe() );
if ( boost::filesystem::exists( root ) ) {
found = true;
boost::filesystem::remove_all( root );
diff --git a/tools/tool.cpp b/tools/tool.cpp
index f687269cf00..05407074c97 100644
--- a/tools/tool.cpp
+++ b/tools/tool.cpp
@@ -400,14 +400,14 @@ namespace mongo {
ProgressMeter m( fileLength );
while ( read < fileLength ) {
- int readlen = fread(buf, 4, 1, file);
+ fread(buf, 4, 1, file);
int size = ((int*)buf)[0];
if ( size >= BUF_SIZE ) {
cerr << "got an object of size: " << size << " terminating..." << endl;
}
uassert( 10264 , "invalid object size" , size < BUF_SIZE );
- readlen = fread(buf+4, size-4, 1, file);
+ fread(buf+4, size-4, 1, file);
BSONObj o( buf );
if ( _objcheck && ! o.valid() ) {
diff --git a/util/ramlog.h b/util/ramlog.h
index fc588e635ca..b2f3aa03f26 100644
--- a/util/ramlog.h
+++ b/util/ramlog.h
@@ -108,7 +108,6 @@ namespace mongo {
vector<const char*> v;
get( v );
- bool first = true;
s << "<pre>\n";
for( int i = 0; i < (int)v.size(); i++ ) {
assert( strlen(v[i]) > 20 );
@@ -126,7 +125,7 @@ namespace mongo {
stringstream r;
if( nr == 1 ) r << "repeat last line";
else r << "repeats last " << nr << " lines; ends " << string(v[last]+4,0,15);
- first = false; s << html::a("", r.str(), clean(v,i,x.str()));
+ s << html::a("", r.str(), clean(v,i,x.str()));
}
else s << x.str();
s << '\n';