Skip to content

Commit

Permalink
fixing warnings #3
Browse files Browse the repository at this point in the history
  • Loading branch information
behrisch committed May 2, 2024
1 parent c7f22f0 commit bcdcd1f
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 14 deletions.
12 changes: 6 additions & 6 deletions src/netedit/frames/demand/GNEPersonFrame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -127,14 +127,14 @@ GNEPersonFrame::addPerson(const GNEViewNetHelper::ViewObjectsSelector& viewObjec
return myPlanCreator->addRoute(o);
}
}
for (GNELane* o : viewObjects.getLanes()) {
return myPlanCreator->addEdge(o);
if (!viewObjects.getLanes().empty()) {
return myPlanCreator->addEdge(viewObjects.getLanes().front());
}
for (GNEJunction* o : viewObjects.getJunctions()) {
return myPlanCreator->addJunction(o);
if (!viewObjects.getJunctions().empty()) {
return myPlanCreator->addJunction(viewObjects.getJunctions().front());
}
for (GNETAZ* o : viewObjects.getTAZs()) {
return myPlanCreator->addTAZ(o);
if (!viewObjects.getTAZs().empty()) {
return myPlanCreator->addTAZ(viewObjects.getTAZs().front());
}
return false;
}
Expand Down
2 changes: 1 addition & 1 deletion src/polyconvert/PCLoaderDlrNavteq.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ PCLoaderDlrNavteq::loadPolyFile(const std::string& file,
name = def.prefix + name;
type = def.id;
color = def.color;
fill = fill && def.allowFill;
fill = fill && def.allowFill != PCTypeMap::Filltype::NOFILL;
discard = def.discard;
icon = def.icon;
layer = def.layer;
Expand Down
2 changes: 1 addition & 1 deletion src/polyconvert/PCLoaderOSM.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@ PCLoaderOSM::addPolygon(const PCOSMEdge* edge, const PositionVector& vec, const
const bool closedShape = vec.front() == vec.back();
const std::string idSuffix = (index == 0 ? "" : "#" + toString(index));
const std::string id = def.prefix + (useName && edge->name != "" ? edge->name : toString(edge->id)) + idSuffix;
bool fill = def.allowFill == PCTypeMap::FORCE || (def.allowFill == PCTypeMap::FILL && closedShape);
bool fill = def.allowFill == PCTypeMap::Filltype::FORCE || (def.allowFill == PCTypeMap::Filltype::FILL && closedShape);
SUMOPolygon* poly = new SUMOPolygon(
StringUtils::escapeXML(id),
StringUtils::escapeXML(OptionsCont::getOptions().getBool("osm.keep-full-type") ? fullType : def.id),
Expand Down
2 changes: 1 addition & 1 deletion src/polyconvert/PCLoaderXML.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ PCLoaderXML::myStartElement(int element,
if (myTypeMap.has(type)) {
const PCTypeMap::TypeDef& def = myTypeMap.get(type);
discard = def.discard;
setDefaults(def.prefix, def.color, def.icon, def.layer, def.allowFill);
setDefaults(def.prefix, def.color, def.icon, def.layer, def.allowFill != PCTypeMap::Filltype::NOFILL);
} else {
setDefaults(myOptions.getString("prefix"), RGBColor::parseColor(myOptions.getString("color")),
myOptions.getString("icon"), myOptions.getFloat("layer"), myOptions.getBool("fill"));
Expand Down
6 changes: 3 additions & 3 deletions src/polyconvert/PCTypeDefHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,13 +61,13 @@ PCTypeDefHandler::myStartElement(int element,
const std::string icon = attrs.getOpt<std::string>(SUMO_ATTR_ICON, id.c_str(), ok, myOptions.getString("icon"));
const double layer = attrs.getOpt<double>(SUMO_ATTR_LAYER, id.c_str(), ok, myOptions.getFloat("layer"));
const bool discard = attrs.getOpt<bool>(SUMO_ATTR_DISCARD, id.c_str(), ok, false);
PCTypeMap::Filltype allowFill = myOptions.getBool("fill") ? PCTypeMap::FILL : PCTypeMap::NOFILL;
PCTypeMap::Filltype allowFill = myOptions.getBool("fill") ? PCTypeMap::Filltype::FILL : PCTypeMap::Filltype::NOFILL;
if (attrs.hasAttribute(SUMO_ATTR_FILL)) {
const std::string allowFillS = attrs.get<std::string>(SUMO_ATTR_FILL, id.c_str(), ok);
if (allowFillS == "force") {
allowFill = PCTypeMap::FORCE;
allowFill = PCTypeMap::Filltype::FORCE;
} else {
allowFill = StringUtils::toBool(allowFillS) ? PCTypeMap::FILL : PCTypeMap::NOFILL;
allowFill = StringUtils::toBool(allowFillS) ? PCTypeMap::Filltype::FILL : PCTypeMap::Filltype::NOFILL;
}
}
const std::string type = attrs.getOpt<std::string>(SUMO_ATTR_NAME, id.c_str(), ok, myOverwriteType ? myOptions.getString("type") : id);
Expand Down
2 changes: 1 addition & 1 deletion src/polyconvert/PCTypeMap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ PCTypeMap::PCTypeMap(const OptionsCont& oc) {
myDefaultType.icon = oc.getString("icon");
myDefaultType.layer = oc.getFloat("layer");
myDefaultType.discard = oc.getBool("discard");
myDefaultType.allowFill = oc.getBool("fill") ? FILL : NOFILL;
myDefaultType.allowFill = oc.getBool("fill") ? Filltype::FILL : Filltype::NOFILL;
myDefaultType.prefix = oc.getString("prefix");
}

Expand Down
2 changes: 1 addition & 1 deletion src/polyconvert/PCTypeMap.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ class PCTypeMap {
/// @brief Destructor
~PCTypeMap();

enum Filltype {
enum class Filltype {
NOFILL = 0,
FILL = 1,
FORCE = 2
Expand Down

0 comments on commit bcdcd1f

Please sign in to comment.