16
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-07-21 22:59:19 +02:00

reformat: parameters can be made const

This commit is contained in:
jerrrrycho
2026-07-04 07:08:14 +02:00
parent 6fd1d6715b
commit 220689a5e3
121 changed files with 1380 additions and 1352 deletions

View File

@@ -675,7 +675,7 @@ glm::vec3 basic_cell::find_nearest_track_point(const glm::dvec3 &pos)
// executes event assigned to specified launcher
void
basic_cell::launch_event( TEventLauncher *Launcher, bool local_only ) {
basic_cell::launch_event( TEventLauncher *Launcher, const bool local_only ) {
WriteLog( "Eventlauncher: " + Launcher->name() );
if (!local_only) {
if( Launcher->Event1 ) {

View File

@@ -454,7 +454,7 @@ public:
create_map_geometry();
void
update_poi_geometry();
basic_section* get_section(size_t section)
basic_section* get_section(const size_t section)
{ return m_sections[section]; }
gfx::geometrybank_handle
get_map_poi_geometry() { return m_map_poipoints; }

View File

@@ -159,7 +159,7 @@ private:
// set visibility
inline
void
shape_node::visible( bool State ) {
shape_node::visible(const bool State ) {
m_data.visible = State;
}
// set origin point
@@ -252,7 +252,7 @@ private:
// set visibility
inline
void
lines_node::visible( bool State ) {
lines_node::visible(const bool State ) {
m_data.visible = State;
}
// set origin point
@@ -433,7 +433,7 @@ basic_node::visible() const {
inline
void
basic_node::group( group_handle Group ) {
basic_node::group(const group_handle Group ) {
m_group = Group;
}

View File

@@ -53,7 +53,7 @@ node_groups::close()
return handle();
}
bool node_groups::assign_cross_switch(map::track_switch& sw, std::string &sw_name, std::string const &id, size_t idx)
bool node_groups::assign_cross_switch(map::track_switch& sw, std::string &sw_name, std::string const &id, const size_t idx)
{
sw.action[idx] = simulation::Events.FindEvent(sw_name + ":" + id);
if (!sw.action[idx])
@@ -268,7 +268,7 @@ node_groups::insert( group_handle const Group, basic_event *Event ) {
// sends basic content of the class in legacy (text) format to provided stream
void
node_groups::export_as_text( std::ostream &Output, bool Dirty ) const {
node_groups::export_as_text( std::ostream &Output, const bool Dirty ) const {
for( auto const &group : m_groupmap ) {
bool any = false;
for( auto *node : group.second.nodes ) {
@@ -304,7 +304,7 @@ node_groups::export_as_text( std::ostream &Output, bool Dirty ) const {
// removes specified group from the group list and group information from the group's nodes
void
node_groups::erase( group_map::const_iterator Group ) {
node_groups::erase(const group_map::const_iterator Group ) {
for( auto *node : Group->second.nodes ) {
node->group( null_handle );

View File

@@ -137,7 +137,7 @@ uint8_t sn_utils::d_uint8( std::istream& s ) {
}
void sn_utils::ls_uint16(std::ostream &s, uint16_t v)
void sn_utils::ls_uint16(std::ostream &s, const uint16_t v)
{
uint8_t buf[2];
buf[0] = v;
@@ -145,7 +145,7 @@ void sn_utils::ls_uint16(std::ostream &s, uint16_t v)
s.write((char*)buf, 2);
}
void sn_utils::ls_uint32(std::ostream &s, uint32_t v)
void sn_utils::ls_uint32(std::ostream &s, const uint32_t v)
{
uint8_t buf[4];
buf[0] = v;
@@ -155,7 +155,7 @@ void sn_utils::ls_uint32(std::ostream &s, uint32_t v)
s.write((char*)buf, 4);
}
void sn_utils::ls_int32(std::ostream &s, int32_t v)
void sn_utils::ls_int32(std::ostream &s, const int32_t v)
{
uint8_t buf[4];
buf[0] = v;
@@ -165,7 +165,7 @@ void sn_utils::ls_int32(std::ostream &s, int32_t v)
s.write((char*)buf, 4);
}
void sn_utils::ls_uint64(std::ostream &s, uint64_t v)
void sn_utils::ls_uint64(std::ostream &s, const uint64_t v)
{
uint8_t buf[8];
buf[0] = v;
@@ -179,7 +179,7 @@ void sn_utils::ls_uint64(std::ostream &s, uint64_t v)
s.write((char*)buf, 8);
}
void sn_utils::ls_int64(std::ostream &s, int64_t v)
void sn_utils::ls_int64(std::ostream &s, const int64_t v)
{
uint8_t buf[8];
buf[0] = v;
@@ -230,7 +230,7 @@ void sn_utils::s_str(std::ostream &s, std::string v)
s.write(buf, v.size() + 1);
}
void sn_utils::s_bool(std::ostream &s, bool v)
void sn_utils::s_bool(std::ostream &s, const bool v)
{
ls_uint16(
s,