Removing unused parameters, fixing signed-unsigned comparisons

This commit is contained in:
DennisOSRM 2012-09-19 13:28:37 +02:00
parent b448177278
commit e3062cf3a2
2 changed files with 17 additions and 16 deletions

View File

@ -42,7 +42,7 @@ TemporaryStorage::~TemporaryStorage() {
void TemporaryStorage::removeAll() {
boost::mutex::scoped_lock lock(mutex);
try {
for(int slotID = 0; slotID < vectorOfStreamDatas.size(); ++slotID)
for(unsigned slotID = 0; slotID < vectorOfStreamDatas.size(); ++slotID)
deallocateSlot(slotID);
} catch(boost::filesystem::filesystem_error & e) {
@ -127,7 +127,7 @@ boost::filesystem::fstream::pos_type TemporaryStorage::tell(int slotID) {
return position;
}
void TemporaryStorage::abort(boost::filesystem::filesystem_error& e) {
void TemporaryStorage::abort(boost::filesystem::filesystem_error& ) {
removeAll();
// ERR("I/O Error occured: " << e.what());
}

View File

@ -22,6 +22,7 @@ or see http://www.gnu.org/licenses/agpl.txt.
#define PBFPARSER_H_
#include <zlib.h>
#include <boost/make_shared.hpp>
#include <boost/ref.hpp>
#include <boost/shared_ptr.hpp>
@ -69,7 +70,7 @@ public:
PBFParser(const char * fileName) : myLuaState(NULL) {
GOOGLE_PROTOBUF_VERIFY_VERSION;
//TODO: What is the bottleneck here? Filling the queue or reading the stuff from disk?
threadDataQueue.reset( new ConcurrentQueue<_ThreadData*>(2500) ); /* Max 2500 items in queue, hardcoded. */
threadDataQueue = boost::make_shared<ConcurrentQueue<_ThreadData*> >( 2500 ); /* Max 2500 items in queue, hardcoded. */
input.open(fileName, std::ios::in | std::ios::binary);
if (!input) {
@ -194,6 +195,8 @@ public:
bool Parse() {
// Start the read and parse threads
boost::thread readThread(boost::bind(&PBFParser::ReadData, this));
//Open several parse threads that are synchronized before call to
boost::thread parseThread(boost::bind(&PBFParser::ParseData, this));
// Wait for the threads to finish
@ -235,9 +238,8 @@ private:
}
/** Pass the unpacked node to the LUA call back **/
int ret = -1;
try {
ret = luabind::call_function<int>(
luabind::call_function<int>(
myLuaState,
"node_function",
boost::ref(n)
@ -255,7 +257,7 @@ private:
}
}
void parseNode(_ThreadData * threadData) {
void parseNode(_ThreadData * ) {
ERR("Parsing of simple nodes not supported. PBF should use dense nodes");
// _Node n;
// if(!(*nodeCallback)(n))
@ -343,21 +345,20 @@ private:
_Way w;
w.id = inputWay.id();
unsigned pathNode(0);
for(int i = 0; i < inputWay.refs_size(); i++) {
for(int i = 0; i < inputWay.refs_size(); ++i) {
pathNode += inputWay.refs(i);
w.path.push_back(pathNode);
}
assert(inputWay.keys_size() == inputWay.vals_size());
for(int i = 0; i < inputWay.keys_size(); i++) {
for(int i = 0; i < inputWay.keys_size(); ++i) {
const std::string key = threadData->PBFprimitiveBlock.stringtable().s(inputWay.keys(i));
const std::string val = threadData->PBFprimitiveBlock.stringtable().s(inputWay.vals(i));
w.keyVals.Add(key, val);
}
/** Pass the unpacked way to the LUA call back **/
int ret = -1;
try {
ret = luabind::call_function<int>(
luabind::call_function<int>(
myLuaState,
"way_function",
boost::ref(w),
@ -433,7 +434,7 @@ private:
return true;
}
bool unpackZLIB(std::fstream & stream, _ThreadData * threadData) {
bool unpackZLIB(std::fstream &, _ThreadData * threadData) {
unsigned rawSize = threadData->PBFBlob.raw_size();
char* unpackedDataArray = (char*)malloc(rawSize);
z_stream compressedDataStream;
@ -474,7 +475,7 @@ private:
return true;
}
bool unpackLZMA(std::fstream & stream, _ThreadData * threadData) {
bool unpackLZMA(std::fstream &, _ThreadData * ) {
return false;
}