Fix a couple of warnings found by PVS Studio (#6372)

This commit is contained in:
Siarhei Fedartsou 2022-09-22 23:28:12 +02:00 committed by GitHub
parent 9b834810d5
commit be353630d5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 13 additions and 12 deletions

View File

@ -607,7 +607,6 @@ jobs:
# Linux dev packages
if [ "${TARGET_ARCH}" != "i686" ] && [ "${ENABLE_CONAN}" != "ON" ]; then
sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y
sudo apt-get update -y
sudo apt-get install -y libbz2-dev libxml2-dev libzip-dev liblua5.2-dev libboost-all-dev
if [[ "${CCOMPILER}" != clang-* ]]; then

View File

@ -54,6 +54,7 @@ struct PhantomNode
forward_distance_offset(0), reverse_distance_offset(0),
forward_duration(MAXIMAL_EDGE_DURATION), reverse_duration(MAXIMAL_EDGE_DURATION),
forward_duration_offset(0), reverse_duration_offset(0),
component({INVALID_COMPONENTID, 0}),
fwd_segment_position(0), is_valid_forward_source{false}, is_valid_forward_target{false},
is_valid_reverse_source{false}, is_valid_reverse_target{false}, bearing(0)

View File

@ -135,7 +135,8 @@ struct NodeBasedEdgeWithOSM : NodeBasedEdge
inline NodeBasedEdgeClassification::NodeBasedEdgeClassification()
: forward(false), backward(false), is_split(false), roundabout(false), circular(false),
startpoint(false), restricted(false)
startpoint(false), restricted(false), highway_turn_classification(0),
access_turn_classification(0)
{
}

View File

@ -28,7 +28,7 @@ struct TurnRestriction
// The turn sequence that the restriction applies to.
TurnPath turn_path;
// Indicates if the restriction turn *must* or *must not* be taken.
bool is_only;
bool is_only = false;
// We represent conditional and unconditional restrictions with the same structure.
// Unconditional restrictions will have empty conditions.
std::vector<util::OpeningHours> condition;

View File

@ -38,17 +38,17 @@ struct LuaScriptingContext final
RasterContainer raster_sources;
sol::state state;
bool has_turn_penalty_function;
bool has_node_function;
bool has_way_function;
bool has_segment_function;
bool has_turn_penalty_function = false;
bool has_node_function = false;
bool has_way_function = false;
bool has_segment_function = false;
sol::function turn_function;
sol::function way_function;
sol::function node_function;
sol::function segment_function;
int api_version;
int api_version = 4;
sol::table profile_table;
// Reference to immutable location dependent data and locations memo

View File

@ -231,7 +231,7 @@ class MultiLevelGraph : public util::StaticGraph<EdgeDataT, Ownership>
protected:
Vector<EdgeOffset> node_to_edge_offset;
std::uint32_t connectivity_checksum;
std::uint32_t connectivity_checksum = 0;
};
using MultiLevelEdgeBasedGraph =

View File

@ -107,11 +107,11 @@ class Server
}
}
RequestHandler request_handler;
unsigned thread_pool_size;
boost::asio::io_context io_context;
boost::asio::ip::tcp::acceptor acceptor;
std::shared_ptr<Connection> new_connection;
RequestHandler request_handler;
};
} // namespace server
} // namespace osrm

View File

@ -211,7 +211,7 @@ struct SharedRegion
char name[MAX_NAME_LENGTH + 1];
std::uint64_t timestamp;
std::uint16_t shm_key;
std::uint16_t shm_key = 0;
};
// Keeps a list of all shared regions in a fixed-sized struct

View File

@ -66,7 +66,7 @@ struct UpdaterConfig final : storage::IOConfig
IOConfig::UseDefaultOutputNames(base);
}
double log_edge_updates_factor;
double log_edge_updates_factor = 0.0;
std::time_t valid_now;
std::vector<std::string> segment_speed_lookup_paths;