Skip to content

Commit

Permalink
fixing warnings and style #22 #3
Browse files Browse the repository at this point in the history
  • Loading branch information
behrisch committed Apr 3, 2024
1 parent 2b55b2e commit e37bad8
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 16 deletions.
2 changes: 1 addition & 1 deletion src/gui/GUIViewTraffic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ GUIViewTraffic::buildColorRainbow(const GUIVisualizationSettings& s, GUIColorSch
int step = MAX2(1, 360 / (int)codes.size());
int hue = 0;
for (SVCPermissions p : codes) {
scheme.addColor(RGBColor::fromHSV(hue, 1, 1), p);
scheme.addColor(RGBColor::fromHSV(hue, 1, 1), (double)p);
hue = (hue + step) % 360;
}
return;
Expand Down
3 changes: 2 additions & 1 deletion src/libsumo/Subscription.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
#include <set>
#include <foreign/tcpip/storage.h>
#include <libsumo/TraCIDefs.h>
#include <utils/common/SUMOVehicleClass.h>
#include <utils/common/SUMOTime.h>


Expand Down Expand Up @@ -139,7 +140,7 @@ class Subscription {
/// @brief vTypes specified by the vTypes filter
std::set<std::string> filterVTypes;
/// @brief vClasses specified by the vClasses filter, @see SVCPermissions
int filterVClasses;
SVCPermissions filterVClasses;
/// @brief Opening angle (in deg) specified by the field of vision filter
double filterFieldOfVisionOpeningAngle;
/// @brief Lateral distance specified by the lateral distance filter
Expand Down
2 changes: 1 addition & 1 deletion src/mesosim/MEInductLoop.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ MEInductLoop::writeXMLOutput(OutputDevice& dev,
mySegment->prepareDetectorForWriting(myMeanData);
dev.openTag(SUMO_TAG_INTERVAL).writeAttr(SUMO_ATTR_BEGIN, time2string(startTime)).writeAttr(SUMO_ATTR_END, time2string(stopTime));
dev.writeAttr(SUMO_ATTR_ID, StringUtils::escapeXML(myID)).writeAttr("sampledSeconds", myMeanData.getSamples());
myMeanData.write(dev, 0, stopTime - startTime, (double)mySegment->getEdge().getLanes().size(), mySegment->getEdge().getSpeedLimit(), -1.0);
myMeanData.write(dev, 0, stopTime - startTime, (int)mySegment->getEdge().getLanes().size(), mySegment->getEdge().getSpeedLimit(), -1.0);
myMeanData.reset();
}

Expand Down
18 changes: 9 additions & 9 deletions src/netbuild/NBEdge.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ NBEdge::MainDirections::MainDirections(const EdgeVector& outgoing, NBEdge* paren
NBContHelper::edge_similar_direction_sorter sorter(parent);
const NBEdge* straight = nullptr;
for (const NBEdge* const out : outgoing) {
const int outPerms = out->getPermissions();
const SVCPermissions outPerms = out->getPermissions();
for (const int l : availableLanes) {
if ((parent->myLanes[l].permissions & outPerms) != 0) {
if (straight == nullptr || sorter(out, straight)) {
Expand Down Expand Up @@ -2762,9 +2762,9 @@ NBEdge::applyTurnSigns() {
}
// add new connections
int allSigns = (turnSigns
| turnSigns >> TURN_SIGN_SHIFT_BUS
| turnSigns >> TURN_SIGN_SHIFT_TAXI
| turnSigns >> TURN_SIGN_SHIFT_BICYCLE);
| turnSigns >> TURN_SIGN_SHIFT_BUS
| turnSigns >> TURN_SIGN_SHIFT_TAXI
| turnSigns >> TURN_SIGN_SHIFT_BICYCLE);
std::vector<LinkDirection> all = decodeTurnSigns(turnSigns);
std::vector<LinkDirection> bus = decodeTurnSigns(turnSigns, TURN_SIGN_SHIFT_BUS);
std::vector<LinkDirection> taxi = decodeTurnSigns(turnSigns, TURN_SIGN_SHIFT_TAXI);
Expand Down Expand Up @@ -2808,11 +2808,11 @@ NBEdge::applyTurnSigns() {
toLaneIndex[to] = toLane;
}
setConnection(i, to, toLaneIndex[to], Lane2LaneInfoType::VALIDATED, true,
false, KEEPCLEAR_UNSPECIFIED, UNSPECIFIED_CONTPOS,
UNSPECIFIED_VISIBILITY_DISTANCE, UNSPECIFIED_SPEED, UNSPECIFIED_FRICTION,
myDefaultConnectionLength, PositionVector::EMPTY,
UNSPECIFIED_CONNECTION_UNCONTROLLED,
perm);
false, KEEPCLEAR_UNSPECIFIED, UNSPECIFIED_CONTPOS,
UNSPECIFIED_VISIBILITY_DISTANCE, UNSPECIFIED_SPEED, UNSPECIFIED_FRICTION,
myDefaultConnectionLength, PositionVector::EMPTY,
UNSPECIFIED_CONNECTION_UNCONTROLLED,
perm);
if (toLaneIndex[to] < to->getNumLanes() - 1) {
toLaneIndex[to]++;
}
Expand Down
4 changes: 2 additions & 2 deletions src/netbuild/NBEdgeCont.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1436,8 +1436,8 @@ NBEdgeCont::guessRoundabouts() {
}
#endif
double loopLength = 0;
for (NBEdge* e : loopEdges) {
loopLength += e->getLoadedLength();
for (const NBEdge* const le : loopEdges) {
loopLength += le->getLoadedLength();
}
if (formFactor(loopEdges) > 0.6
&& loopLength < OptionsCont::getOptions().getFloat("roundabouts.guess.max-length")) {
Expand Down
2 changes: 1 addition & 1 deletion src/netedit/GNEViewNet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -795,7 +795,7 @@ GNEViewNet::buildColorRainbow(const GUIVisualizationSettings& s, GUIColorScheme&
int step = MAX2(1, 360 / (int)codes.size());
int hue = 0;
for (SVCPermissions p : codes) {
scheme.addColor(RGBColor::fromHSV(hue, 1, 1), p);
scheme.addColor(RGBColor::fromHSV(hue, 1, 1), (double)p);
hue = (hue + step) % 360;
}
return;
Expand Down
2 changes: 1 addition & 1 deletion src/utils/common/SUMOVehicleClass.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ StringBijection<SUMOVehicleShape> SumoVehicleShapeStrings(
// static values used for cached
// ===========================================================================

static std::map<int, std::vector<std::string> > vehicleClassNamesListCached;
static std::map<SVCPermissions, std::vector<std::string> > vehicleClassNamesListCached;
static std::map<std::string, SVCPermissions> parseVehicleClassesCached;
static std::map<SVCPermissions, std::string> getVehicleClassNamesCached;
static std::string VehicleClassNameAll = "all";
Expand Down

0 comments on commit e37bad8

Please sign in to comment.