Skip to content

Commit

Permalink
fixing warnings #3
Browse files Browse the repository at this point in the history
  • Loading branch information
behrisch committed Nov 22, 2024
1 parent 378652c commit cff668f
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion src/activitygen/city/AGCity.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ AGCity::generateWorkPositions() {
++workPositionCounter;
}
}
} catch (const std::bad_alloc& e) {
} catch (const std::bad_alloc&) {
std::cout << "Number of work positions at bad_alloc exception: " << workPositionCounter << std::endl;
throw;
}
Expand Down
2 changes: 1 addition & 1 deletion src/dfrouter/RODFDetectorHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ RODFDetectorHandler::myStartElement(int element,
if (myIgnoreErrors) {
WRITE_WARNING(e.what());
} else {
throw e;
throw;
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/mesosim/METriggeredCalibrator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ METriggeredCalibrator::execute(SUMOTime currentTime) {
vehicle = nullptr;
break;
} else {
throw e;
throw;
}
}
const bool duplicate = vc.getVehicle(newPars->id) != nullptr;
Expand Down
6 changes: 3 additions & 3 deletions src/microsim/MSRouteHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -692,7 +692,7 @@ MSRouteHandler::closeVehicle() {
vehControl.fixVehicleCounts();
return;
} else {
throw e;
throw;
}
}
const SUMOTime origDepart = myVehicleParameter->depart;
Expand Down Expand Up @@ -1399,7 +1399,7 @@ MSRouteHandler::addStop(const SUMOSAXAttributes& attrs) {
myActiveTransportablePlan->back()->setDestination(edge, toStop);
} else {
throw ProcessError(TLF("Disconnected plan for % '%' (%!=%).", myActiveTypeName, myVehicleParameter->id,
edge->getID(), myActiveTransportablePlan->back()->getDestination()->getID()));
edge->getID(), myActiveTransportablePlan->back()->getDestination()->getID()));
}
}
// transporting veh stops somewhere
Expand Down Expand Up @@ -1535,7 +1535,7 @@ MSRouteHandler::addPersonTrip(const SUMOSAXAttributes& attrs) {
from = myActiveTransportablePlan->back()->getDestination();
}
if (attrs.hasAttribute(SUMO_ATTR_TO) || attrs.hasAttribute(SUMO_ATTR_TO_JUNCTION) || attrs.hasAttribute(SUMO_ATTR_TO_TAZ)
|| attrs.hasAttribute(SUMO_ATTR_TOXY) || attrs.hasAttribute(SUMO_ATTR_TOLONLAT)) {
|| attrs.hasAttribute(SUMO_ATTR_TOXY) || attrs.hasAttribute(SUMO_ATTR_TOLONLAT)) {
to = myActiveRoute.back();
} // else, to may also be derived from stopping place

Expand Down
8 changes: 4 additions & 4 deletions src/microsim/devices/MSDevice_Battery.h
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,11 @@ class MSDevice_Battery : public MSVehicleDevice {
*
* @return True (always).
*/
bool notifyMove(SUMOTrafficObject& veh, double oldPos, double newPos, double newSpeed);
bool notifyMove(SUMOTrafficObject& veh, double oldPos, double newPos, double newSpeed) override;
/// @}

/// @brief return the name for this type of device
const std::string deviceName() const {
const std::string deviceName() const override {
return "battery";
}

Expand All @@ -105,10 +105,10 @@ class MSDevice_Battery : public MSVehicleDevice {
void setParameter(const std::string& key, const std::string& value) override;

/// @brief called to update state for parking vehicles
void notifyParking();
void notifyParking() override;

/// @brief Called on vehicle deletion to extend tripinfo
void generateOutput(OutputDevice* tripinfoOut) const;
void generateOutput(OutputDevice* tripinfoOut) const override;

private:
/** @brief Constructor
Expand Down
6 changes: 3 additions & 3 deletions src/microsim/trigger/MSCalibrator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -468,7 +468,7 @@ MSCalibrator::execute(SUMOTime currentTime) {
vehicle = nullptr;
break;
} else {
throw e;
throw;
}
}
#ifdef MSCalibrator_DEBUG
Expand All @@ -480,9 +480,9 @@ MSCalibrator::execute(SUMOTime currentTime) {
bool success = false;
try {
success = myEdge->insertVehicle(*vehicle, currentTime);
} catch (const ProcessError& e) {
} catch (const ProcessError&) {
MSNet::getInstance()->getVehicleControl().deleteVehicle(vehicle, true);
throw e;
throw;
}
if (success) {
if (!MSNet::getInstance()->getVehicleControl().addVehicle(vehicle->getID(), vehicle)) {
Expand Down

0 comments on commit cff668f

Please sign in to comment.