Skip to content

Commit

Permalink
g++ 4.6 compile (new -Wunused-but-set-variable warning)
Browse files Browse the repository at this point in the history
  • Loading branch information
RedBeard0531 committed May 2, 2011
1 parent 4b5f2b3 commit b7e87f0
Show file tree
Hide file tree
Showing 8 changed files with 6 additions and 12 deletions.
2 changes: 0 additions & 2 deletions db/btree.cpp
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion db/dbcommands.cpp
Expand Up @@ -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;
Expand Down
1 change: 0 additions & 1 deletion db/index.cpp
Expand Up @@ -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 }
Expand Down
2 changes: 1 addition & 1 deletion db/update.cpp
Expand Up @@ -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 ) {
Expand Down
2 changes: 0 additions & 2 deletions dbtests/queryoptimizertests.cpp
Expand Up @@ -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();
Expand All @@ -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();
Expand Down
2 changes: 1 addition & 1 deletion shell/shell_utils.cpp
Expand Up @@ -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 );
Expand Down
4 changes: 2 additions & 2 deletions tools/tool.cpp
Expand Up @@ -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() ) {
Expand Down
3 changes: 1 addition & 2 deletions util/ramlog.h
Expand Up @@ -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 );
Expand All @@ -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';
Expand Down

0 comments on commit b7e87f0

Please sign in to comment.