17
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-11-02 17:29:14 +01:00

Add nosonar tags

This commit is contained in:
2026-10-09 18:40:31 +02:00
parent 1c28809dd7
commit 9935257783
12 changed files with 19 additions and 19 deletions

View File

@@ -723,7 +723,7 @@ std::string directive(std::string const &File, include_info const &Info, int con
else if (role == "name")
{
// names have to be unique in the scenery. the default value, or the name of the template, makes them recognizable
static std::mt19937 engine{std::random_device{}()};
static std::mt19937 engine{std::random_device{}()}; // NOSONAR
char suffix[16];
std::snprintf(suffix, sizeof(suffix), "_%08x", static_cast<unsigned int>(engine()));
value = (value.empty() ? std::filesystem::path(File).stem().string() : value) + suffix;

View File

@@ -1176,7 +1176,7 @@ glm::dvec2 direction_at(TTrack const &Track, glm::dvec3 const &Joint, bool const
TTrack *neighbour_at(TTrack const &Track, int const Path, bool const Atend)
{
if (has_switch_paths(Track))
return Atend ? Track.SwitchExtension->pNexts[Path & 1] : Track.SwitchExtension->pPrevs[Path & 1];
return Atend ? Track.SwitchExtension->pNexts[Path & 1] : Track.SwitchExtension->pPrevs[Path & 1]; // NOSONAR
return Atend ? Track.trNext : Track.trPrev;
}