From ace59411cbb745fa1d6aa04e9e5ee6b1d14ec2a2 Mon Sep 17 00:00:00 2001 From: Dennis Luxen Date: Wed, 23 Apr 2014 17:03:26 +0200 Subject: [PATCH] fix and/or remove unused variables --- Contractor/EdgeBasedGraphFactory.cpp | 4 +++- DataStructures/InputReaderFactory.h | 10 ++++++---- Descriptors/JSONDescriptor.h | 13 ------------- 3 files changed, 9 insertions(+), 18 deletions(-) diff --git a/Contractor/EdgeBasedGraphFactory.cpp b/Contractor/EdgeBasedGraphFactory.cpp index 6a01b19c2..82e10b254 100644 --- a/Contractor/EdgeBasedGraphFactory.cpp +++ b/Contractor/EdgeBasedGraphFactory.cpp @@ -290,10 +290,12 @@ void EdgeBasedGraphFactory::InsertEdgeBasedNode( BOOST_ASSERT( v != SPECIAL_NODEID ); BOOST_ASSERT( e1 != SPECIAL_EDGEID ); +#ifndef NDEBUG // find forward edge id and const EdgeID e1b = m_node_based_graph->FindEdge(u, v); BOOST_ASSERT( e1 == e1b ); - +#endif + BOOST_ASSERT( e1 != SPECIAL_EDGEID ); const EdgeData & forward_data = m_node_based_graph->GetEdgeData(e1); diff --git a/DataStructures/InputReaderFactory.h b/DataStructures/InputReaderFactory.h index 26418c1f2..3ca09fe03 100644 --- a/DataStructures/InputReaderFactory.h +++ b/DataStructures/InputReaderFactory.h @@ -29,6 +29,8 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #ifndef INPUTREADERFACTORY_H #define INPUTREADERFACTORY_H +#include + #include #include @@ -51,21 +53,21 @@ int readFromBz2Stream( void* pointer, char* buffer, int len ) { return read; } else if(BZ_STREAM_END == context->error) { BZ2_bzReadGetUnused(&context->error, context->bz2, &unusedTmpVoid, &context->nUnused); - if(BZ_OK != context->error) {std::cerr << "Could not BZ2_bzReadGetUnused" <error, "Could not BZ2_bzReadGetUnused"); unusedTmp = (char*)unusedTmpVoid; for(int i=0;inUnused;i++) { context->unused[i] = unusedTmp[i]; } BZ2_bzReadClose(&context->error, context->bz2); - if(BZ_OK != context->error) {std::cerr << "Could not BZ2_bzReadClose" <error, "Could not BZ2_bzReadClose"); context->error = BZ_STREAM_END; // set to the stream end for next call to this function if(0 == context->nUnused && feof(context->file)) { return read; } else { context->bz2 = BZ2_bzReadOpen(&context->error, context->file, 0, 0, context->unused, context->nUnused); - if(NULL == context->bz2){std::cerr << "Could not open file" <bz2, "Could not open file"); } - } else { std::cerr << "Could not read bz2 file" << std::endl; exit(-1); } + } else { BOOST_ASSERT_MSG(false, "Could not read bz2 file"); } } return read; } diff --git a/Descriptors/JSONDescriptor.h b/Descriptors/JSONDescriptor.h index 9b6985b4f..d5e60a52e 100644 --- a/Descriptors/JSONDescriptor.h +++ b/Descriptors/JSONDescriptor.h @@ -131,12 +131,6 @@ public: //check if first segment is non-zero std::string road_name; - int source_duration = phantom_nodes.source_phantom.GetForwardWeightPlusOffset(); - if (!raw_route.source_traversed_in_reverse) - { - source_duration = phantom_nodes.source_phantom.GetReverseWeightPlusOffset(); - } - BOOST_ASSERT(source_duration >= 0); road_name = facade->GetEscapedNameForNameID(phantom_nodes.source_phantom.name_id); // for each unpacked segment add the leg to the description @@ -156,13 +150,6 @@ public: //check if last segment is non-zero road_name = facade->GetEscapedNameForNameID(phantom_nodes.target_phantom.name_id); - int target_duration = phantom_nodes.target_phantom.GetForwardWeightPlusOffset(); - if (raw_route.target_traversed_in_reverse) - { - target_duration = phantom_nodes.target_phantom.GetReverseWeightPlusOffset(); - } - BOOST_ASSERT(target_duration >= 0); - description_factory.SetStartSegment(phantom_nodes.source_phantom, raw_route.source_traversed_in_reverse); reply.content.push_back("0," "\"status_message\": \"Found route between points\",");