Fixing errors from static analysis

This commit is contained in:
Dennis Luxen 2013-06-27 11:44:32 -04:00
parent 1bcacfab74
commit 5c84c12f40
4 changed files with 98 additions and 78 deletions

View File

@ -474,7 +474,7 @@ public:
newEdge.data.id = data.id;
}
BOOST_ASSERT_MSG(
newEdge.data.id <= INT_MAX, //2^31
newEdge.data.id != INT_MAX, //2^31
"edge id invalid"
);
newEdge.data.forward = data.forward;

View File

@ -56,6 +56,17 @@
class EdgeBasedGraphFactory : boost::noncopyable {
public:
struct EdgeBasedNode {
EdgeBasedNode() :
id(INT_MAX),
lat1(INT_MAX),
lat2(INT_MAX),
lon1(INT_MAX),
lon2(INT_MAX >> 1),
belongsToTinyComponent(false),
nameID(UINT_MAX),
weight(UINT_MAX >> 1),
ignoreInGrid(false)
{ }
bool operator<(const EdgeBasedNode & other) const {
return other.id < id;
}

View File

@ -41,7 +41,12 @@ private:
DescriptionFactory alternateDescriptionFactory;
_Coordinate current;
unsigned numberOfEnteredRestrictedAreas;
struct {
struct RoundAbout{
RoundAbout() :
startIndex(INT_MAX),
nameID(INT_MAX),
leaveAtExit(INT_MAX)
{}
int startIndex;
int nameID;
int leaveAtExit;

View File

@ -39,6 +39,7 @@ or see http://www.gnu.org/licenses/agpl.txt.
ExtractorCallbacks * extractCallBacks;
int main (int argc, char *argv[]) {
try {
double startup_time = get_timestamp();
if(argc < 2) {
@ -123,4 +124,7 @@ int main (int argc, char *argv[]) {
<< "./osrm-prepare " << output_file_name << " " << restrictionsFileName
<< std::endl;
return 0;
} catch(std::exception & e) {
WARN("unhandled exception: " << e.what());
}
}