diff --git a/src/autocompletion.cpp b/src/autocompletion.cpp index 1a643f8c05..e8d36406f3 100644 --- a/src/autocompletion.cpp +++ b/src/autocompletion.cpp @@ -17,9 +17,12 @@ #include "safeguards.h" +/** + * @return true, if the textbuf was updated. + */ bool AutoCompletion::AutoComplete() { - // We are pressing TAB for the first time after reset. + /* We are pressing TAB for the first time after reset. */ if (this->suggestions.empty()) { this->InitSuggestions(this->textbuf->GetText()); if (this->suggestions.empty()) { @@ -29,11 +32,11 @@ bool AutoCompletion::AutoComplete() return true; } - // We are pressing TAB again on the same text. + /* We are pressing TAB again on the same text. */ if (this->current_suggestion_index + 1 < this->suggestions.size()) { this->ApplySuggestion(prefix, this->suggestions[++this->current_suggestion_index]); } else { - // We are out of options, restore original text. + /* We are out of options, restore original text. */ this->textbuf->Assign(initial_buf); this->Reset(); } diff --git a/src/autocompletion.h b/src/autocompletion.h index 452c23e87a..03c08f5c77 100644 --- a/src/autocompletion.h +++ b/src/autocompletion.h @@ -32,7 +32,6 @@ public: } virtual ~AutoCompletion() = default; - // Returns true the textbuf was updated. bool AutoComplete(); void Reset(); diff --git a/src/autoreplace_gui.cpp b/src/autoreplace_gui.cpp index c7357240a9..506074751d 100644 --- a/src/autoreplace_gui.cpp +++ b/src/autoreplace_gui.cpp @@ -552,7 +552,7 @@ public: if (g != nullptr) { Command::Post(this->sel_group, GroupFlag::ReplaceWagonRemoval, !g->flags.Test(GroupFlag::ReplaceWagonRemoval), _ctrl_pressed); } else { - // toggle renew_keep_length + /* toggle renew_keep_length */ Command::Post("company.renew_keep_length", Company::Get(_local_company)->settings.renew_keep_length ? 0 : 1); } break; diff --git a/src/blitter/32bpp_anim_sse4.cpp b/src/blitter/32bpp_anim_sse4.cpp index 37da12f71c..4ed29b33c1 100644 --- a/src/blitter/32bpp_anim_sse4.cpp +++ b/src/blitter/32bpp_anim_sse4.cpp @@ -190,8 +190,8 @@ bmno_full_transparency: const uint m1 = (uint8_t) (mvX2 >> 16); const uint r1 = remap[m1]; if (mvX2 & 0x00FF00FF) { + /* Written so the compiler uses CMOV. */ #define CMOV_REMAP(m_colour, m_colour_init, m_src, m_m) \ - /* Written so the compiler uses CMOV. */ \ Colour m_colour = m_colour_init; \ { \ const Colour srcm = (Colour) (m_src); \ diff --git a/src/blitter/32bpp_sse_func.hpp b/src/blitter/32bpp_sse_func.hpp index f931ba3077..bed92686cc 100644 --- a/src/blitter/32bpp_sse_func.hpp +++ b/src/blitter/32bpp_sse_func.hpp @@ -309,8 +309,8 @@ inline void Blitter_32bppSSE4::Draw(const Blitter::BlitterParams *bp, ZoomLevel /* Remap colours. */ if (mvX2 & 0x00FF00FF) { + /* Written so the compiler uses CMOV. */ #define CMOV_REMAP(m_colour, m_colour_init, m_src, m_m) \ - /* Written so the compiler uses CMOV. */ \ Colour m_colour = m_colour_init; \ { \ const Colour srcm = (Colour) (m_src); \ diff --git a/src/core/kdtree.hpp b/src/core/kdtree.hpp index f0bf8896d2..de9dc233cf 100644 --- a/src/core/kdtree.hpp +++ b/src/core/kdtree.hpp @@ -328,11 +328,11 @@ class Kdtree { assert(cy < max_y); if (level % 2 == 0) { - // split in dimension 0 = x + /* split in dimension 0 = x */ this->CheckInvariant(n.left, level + 1, min_x, cx, min_y, max_y); this->CheckInvariant(n.right, level + 1, cx, max_x, min_y, max_y); } else { - // split in dimension 1 = y + /* split in dimension 1 = y */ this->CheckInvariant(n.left, level + 1, min_x, max_x, min_y, cy); this->CheckInvariant(n.right, level + 1, min_x, max_x, cy, max_y); } diff --git a/src/core/random_func.cpp b/src/core/random_func.cpp index 6893ff65c7..6960bac154 100644 --- a/src/core/random_func.cpp +++ b/src/core/random_func.cpp @@ -25,7 +25,7 @@ # include # include #elif defined(__APPLE__) || defined(__NetBSD__) || defined(__FreeBSD__) -// No includes required. +/* No includes required. */ #elif defined(__GLIBC__) && ((__GLIBC__ > 2) || ((__GLIBC__ == 2) && (__GLIBC_MINOR__ >= 25))) # include #elif defined(__EMSCRIPTEN__) diff --git a/src/gfx_layout.cpp b/src/gfx_layout.cpp index 213bfd4fdb..c1b2b6c4ae 100644 --- a/src/gfx_layout.cpp +++ b/src/gfx_layout.cpp @@ -214,7 +214,7 @@ static bool IsConsumedFormattingCode(char32_t ch) if (ch == SCC_PUSH_COLOUR) return true; if (ch == SCC_POP_COLOUR) return true; if (ch >= SCC_FIRST_FONT && ch <= SCC_LAST_FONT) return true; - // All other characters defined in Unicode standard are assumed to be non-consumed. + /* All other characters defined in Unicode standard are assumed to be non-consumed. */ return false; } diff --git a/src/gfxinit.cpp b/src/gfxinit.cpp index 3a2bd06f10..3626bc6e39 100644 --- a/src/gfxinit.cpp +++ b/src/gfxinit.cpp @@ -346,10 +346,10 @@ void GfxLoadSprites() UpdateCursorSize(); } -// instantiate here, because unique_ptr needs a complete type +/* instantiate here, because unique_ptr needs a complete type */ GraphicsSet::GraphicsSet() = default; -// instantiate here, because unique_ptr needs a complete type +/* instantiate here, because unique_ptr needs a complete type */ GraphicsSet::~GraphicsSet() = default; bool GraphicsSet::FillSetDetails(const IniFile &ini, const std::string &path, const std::string &full_filename) diff --git a/src/industry_gui.cpp b/src/industry_gui.cpp index f1693e265a..6ef9c2cb5a 100644 --- a/src/industry_gui.cpp +++ b/src/industry_gui.cpp @@ -175,12 +175,12 @@ static inline void GetAllCargoSuffixes(CargoSuffixInOut use_input, CargoSuffixTy } switch (use_input) { case CARGOSUFFIX_OUT: - // Handle INDUSTRY_ORIGINAL_NUM_OUTPUTS cargoes + /* Handle INDUSTRY_ORIGINAL_NUM_OUTPUTS cargoes */ if (IsValidCargoType(cargoes[0])) GetCargoSuffix(3, cst, ind, ind_type, indspec, suffixes[0]); if (IsValidCargoType(cargoes[1])) GetCargoSuffix(4, cst, ind, ind_type, indspec, suffixes[1]); break; case CARGOSUFFIX_IN: - // Handle INDUSTRY_ORIGINAL_NUM_INPUTS cargoes + /* Handle INDUSTRY_ORIGINAL_NUM_INPUTS cargoes */ if (IsValidCargoType(cargoes[0])) GetCargoSuffix(0, cst, ind, ind_type, indspec, suffixes[0]); if (IsValidCargoType(cargoes[1])) GetCargoSuffix(1, cst, ind, ind_type, indspec, suffixes[1]); if (IsValidCargoType(cargoes[2])) GetCargoSuffix(2, cst, ind, ind_type, indspec, suffixes[2]); diff --git a/src/network/network_udp.cpp b/src/network/network_udp.cpp index 4b0edb0165..246a5525b1 100644 --- a/src/network/network_udp.cpp +++ b/src/network/network_udp.cpp @@ -58,7 +58,7 @@ struct UDPSocket { static UDPSocket _udp_client("Client"); ///< udp client socket static UDPSocket _udp_server("Server"); ///< udp server socket -///*** Communication with clients (we are server) ***/ +/* Communication with clients (we are server) */ /** Helper class for handling all server side communication. */ class ServerNetworkUDPSocketHandler : public NetworkUDPSocketHandler { @@ -81,7 +81,7 @@ void ServerNetworkUDPSocketHandler::Receive_CLIENT_FIND_SERVER(Packet &, Network Debug(net, 7, "Queried from {}", client_addr.GetHostname()); } -///*** Communication with servers (we are client) ***/ +/* Communication with servers (we are client) */ /** Helper class for handling all client side communication. */ class ClientNetworkUDPSocketHandler : public NetworkUDPSocketHandler { diff --git a/src/newgrf_roadstop.cpp b/src/newgrf_roadstop.cpp index 1aef3cb20d..897ff493ef 100644 --- a/src/newgrf_roadstop.cpp +++ b/src/newgrf_roadstop.cpp @@ -526,7 +526,7 @@ bool GetIfClassHasNewStopsByType(const RoadStopClass *roadstopclass, RoadStopTyp */ bool GetIfStopIsForType(const RoadStopSpec *roadstopspec, RoadStopType rs, RoadType roadtype) { - // The roadstopspec is nullptr, must be the default station, always return true. + /* The roadstopspec is nullptr, must be the default station, always return true. */ if (roadstopspec == nullptr) return true; if (roadstopspec->flags.Test(RoadStopSpecFlag::RoadOnly) && !RoadTypeIsRoad(roadtype)) return false; diff --git a/src/newgrf_text.cpp b/src/newgrf_text.cpp index 7d17af6b13..21fcbb7ec7 100644 --- a/src/newgrf_text.cpp +++ b/src/newgrf_text.cpp @@ -733,7 +733,7 @@ struct TextRefStack { if (this->position >= 2) { this->position -= 2; } else { - // Rotate right 2 positions + /* Rotate right 2 positions */ std::rotate(this->stack.rbegin(), this->stack.rbegin() + 2, this->stack.rend()); } this->stack[this->position] = GB(word, 0, 8); diff --git a/src/road_cmd.cpp b/src/road_cmd.cpp index 41dda42043..f04a948d09 100644 --- a/src/road_cmd.cpp +++ b/src/road_cmd.cpp @@ -1463,7 +1463,7 @@ void DrawRoadCatenary(const TileInfo *ti) } } } else { - // No road here, no catenary to draw + /* No road here, no catenary to draw */ return; } @@ -2402,10 +2402,10 @@ static bool CanConvertUnownedRoadType(Owner owner, RoadTramType rtt) */ static void ConvertRoadTypeOwner(TileIndex tile, uint num_pieces, Owner owner, RoadType from_type, RoadType to_type) { - // Scenario editor, maybe? Don't touch the owners when converting roadtypes... + /* Scenario editor, maybe? Don't touch the owners when converting roadtypes... */ if (_current_company >= MAX_COMPANIES) return; - // We can't get a company from invalid owners but we can get ownership of roads without an owner + /* We can't get a company from invalid owners but we can get ownership of roads without an owner */ if (owner >= MAX_COMPANIES && owner != OWNER_NONE) return; Company *c; diff --git a/src/road_map.h b/src/road_map.h index 3ee5de72c1..f8436d4258 100644 --- a/src/road_map.h +++ b/src/road_map.h @@ -459,7 +459,7 @@ enum Roadside : uint8_t { ROADSIDE_GRASS = 1, ///< Road on grass ROADSIDE_PAVED = 2, ///< Road with paved sidewalks ROADSIDE_STREET_LIGHTS = 3, ///< Road with street lights on paved sidewalks - // 4 is unused for historical reasons + /* 4 is unused for historical reasons */ ROADSIDE_TREES = 5, ///< Road with trees on paved sidewalks ROADSIDE_GRASS_ROAD_WORKS = 6, ///< Road on grass with road works ROADSIDE_PAVED_ROAD_WORKS = 7, ///< Road with sidewalks and road works diff --git a/src/script/script_config.hpp b/src/script/script_config.hpp index cb019d90ab..7368d0001b 100644 --- a/src/script/script_config.hpp +++ b/src/script/script_config.hpp @@ -19,7 +19,7 @@ static const int INT32_DIGITS_WITH_SIGN_AND_TERMINATION = 10 + 1 + 1; /** Flags for Script settings. */ enum class ScriptConfigFlag : uint8_t { - // Unused flag 0x1. + /* Unused flag 0x1. */ Boolean = 1, ///< This value is a boolean (either 0 (false) or 1 (true) ). InGame = 2, ///< This setting can be changed while the Script is running. Developer = 3, ///< This setting will only be visible when the Script development tools are active. diff --git a/src/script/script_info.cpp b/src/script/script_info.cpp index ffb74bea5f..3963325b3d 100644 --- a/src/script/script_info.cpp +++ b/src/script/script_info.cpp @@ -122,7 +122,7 @@ SQInteger ScriptInfo::AddSetting(HSQUIRRELVM vm) config.max_value = ClampTo(res); items |= 0x008; } else if (key == "easy_value") { - // No longer parsed. + /* No longer parsed. */ items |= 0x010; } else if (key == "medium_value") { SQInteger res; @@ -130,17 +130,17 @@ SQInteger ScriptInfo::AddSetting(HSQUIRRELVM vm) medium_value = ClampTo(res); items |= 0x020; } else if (key == "hard_value") { - // No longer parsed. + /* No longer parsed. */ items |= 0x040; } else if (key == "custom_value") { - // No longer parsed. + /* No longer parsed. */ } else if (key == "default_value") { SQInteger res; if (SQ_FAILED(sq_getinteger(vm, -1, &res))) return SQ_ERROR; config.default_value = ClampTo(res); items |= 0x080; } else if (key == "random_deviation") { - // No longer parsed. + /* No longer parsed. */ } else if (key == "step_size") { SQInteger res; if (SQ_FAILED(sq_getinteger(vm, -1, &res))) return SQ_ERROR; diff --git a/src/script/squirrel.cpp b/src/script/squirrel.cpp index 05967deecc..35ada7bc1f 100644 --- a/src/script/squirrel.cpp +++ b/src/script/squirrel.cpp @@ -570,7 +570,7 @@ public: size_t buffer_size = this->buffer.size(); size_t read_size = Align(min_size - buffer_size, 4096); // read pages of 4096 bytes - // TODO C++23: use std::string::resize_and_overwrite() + /* TODO C++23: use std::string::resize_and_overwrite() */ this->buffer.resize(buffer_size + read_size); auto dest = std::span(this->buffer.data(), this->buffer.size()).subspan(buffer_size); buffer_size += this->ReadInternal(dest); diff --git a/src/settings_gui.cpp b/src/settings_gui.cpp index cd6dc46973..918646af4a 100644 --- a/src/settings_gui.cpp +++ b/src/settings_gui.cpp @@ -188,7 +188,7 @@ static std::optional VolumeMarkFunc(int, int mark, int value) /* Label only every other mark. */ if (mark % 2 != 0) return std::string{}; - // 0-127 does not map nicely to 0-100. Dividing first gives us nice round numbers. + /* 0-127 does not map nicely to 0-100. Dividing first gives us nice round numbers. */ return GetString(STR_GAME_OPTIONS_VOLUME_MARK, value / 31 * 25); } diff --git a/src/ship_cmd.cpp b/src/ship_cmd.cpp index a226867165..f0200994e8 100644 --- a/src/ship_cmd.cpp +++ b/src/ship_cmd.cpp @@ -549,7 +549,7 @@ struct ShipSubcoordData { * so each Diagdir sub-array will have three valid and three invalid structures per Track. */ static const ShipSubcoordData _ship_subcoord[DIAGDIR_END][TRACK_END] = { - // DIAGDIR_NE + /* DIAGDIR_NE */ { {15, 8, DIR_NE}, // TRACK_X { 0, 0, INVALID_DIR}, // TRACK_Y @@ -558,7 +558,7 @@ static const ShipSubcoordData _ship_subcoord[DIAGDIR_END][TRACK_END] = { {15, 7, DIR_N}, // TRACK_LEFT { 0, 0, INVALID_DIR}, // TRACK_RIGHT }, - // DIAGDIR_SE + /* DIAGDIR_SE */ { { 0, 0, INVALID_DIR}, // TRACK_X { 8, 0, DIR_SE}, // TRACK_Y @@ -567,7 +567,7 @@ static const ShipSubcoordData _ship_subcoord[DIAGDIR_END][TRACK_END] = { { 8, 0, DIR_S}, // TRACK_LEFT { 0, 0, INVALID_DIR}, // TRACK_RIGHT }, - // DIAGDIR_SW + /* DIAGDIR_SW */ { { 0, 8, DIR_SW}, // TRACK_X { 0, 0, INVALID_DIR}, // TRACK_Y @@ -576,7 +576,7 @@ static const ShipSubcoordData _ship_subcoord[DIAGDIR_END][TRACK_END] = { { 0, 0, INVALID_DIR}, // TRACK_LEFT { 0, 8, DIR_S}, // TRACK_RIGHT }, - // DIAGDIR_NW + /* DIAGDIR_NW */ { { 0, 0, INVALID_DIR}, // TRACK_X { 8, 15, DIR_NW}, // TRACK_Y diff --git a/src/sound/xaudio2_s.cpp b/src/sound/xaudio2_s.cpp index 9f38939da5..0d565fcfc2 100644 --- a/src/sound/xaudio2_s.cpp +++ b/src/sound/xaudio2_s.cpp @@ -15,7 +15,7 @@ #include "../core/bitmath_func.hpp" #include "../core/math_func.hpp" -// Windows 8 SDK required for XAudio2 +/* Windows 8 SDK required for XAudio2 */ #undef NTDDI_VERSION #undef _WIN32_WINNT @@ -34,7 +34,7 @@ using Microsoft::WRL::ComPtr; #include "../os/windows/win32.h" #include "../safeguards.h" -// Definition of the "XAudio2Create" call used to initialise XAudio2 +/* Definition of the "XAudio2Create" call used to initialise XAudio2 */ typedef HRESULT(__stdcall *API_XAudio2Create)(_Outptr_ IXAudio2 **ppXAudio2, UINT32 Flags, XAUDIO2_PROCESSOR XAudio2Processor); static FSoundDriver_XAudio2 iFSoundDriver_XAudio2; @@ -60,7 +60,7 @@ public: HRESULT SubmitBuffer() { - // Ensure we do have a valid voice + /* Ensure we do have a valid voice */ if (this->source_voice == nullptr) { return E_FAIL; } @@ -159,7 +159,7 @@ std::optional SoundDriver_XAudio2::Start(const StringList &par return "Failed to load XAudio2 DLL"; } - // Create the XAudio engine + /* Create the XAudio engine */ hr = CreateXAudio(xAudio2Create); if (FAILED(hr)) { @@ -170,7 +170,7 @@ std::optional SoundDriver_XAudio2::Start(const StringList &par return "Failed to inititialise the XAudio2 engine"; } - // Create a mastering voice + /* Create a mastering voice */ hr = _xaudio2->CreateMasteringVoice(&_mastering_voice); if (FAILED(hr)) { @@ -182,7 +182,7 @@ std::optional SoundDriver_XAudio2::Start(const StringList &par return "Failed to create a mastering voice"; } - // Create a source voice to stream our audio + /* Create a source voice to stream our audio */ WAVEFORMATEX wfex; wfex.wFormatTag = WAVE_FORMAT_PCM; @@ -192,7 +192,7 @@ std::optional SoundDriver_XAudio2::Start(const StringList &par wfex.nBlockAlign = (wfex.nChannels * wfex.wBitsPerSample) / 8; wfex.nAvgBytesPerSec = wfex.nSamplesPerSec * wfex.nBlockAlign; - // Limit buffer size to prevent overflows + /* Limit buffer size to prevent overflows */ int bufsize = GetDriverParamInt(parm, "samples", 1024); bufsize = std::min(bufsize, UINT16_MAX); @@ -231,7 +231,7 @@ std::optional SoundDriver_XAudio2::Start(const StringList &par MxInitialize(wfex.nSamplesPerSec); - // Submit the first buffer + /* Submit the first buffer */ hr = _voice_context->SubmitBuffer(); if (FAILED(hr)) { @@ -249,7 +249,7 @@ std::optional SoundDriver_XAudio2::Start(const StringList &par */ void SoundDriver_XAudio2::Stop() { - // Clean up XAudio2 + /* Clean up XAudio2 */ _source_voice->DestroyVoice(); _voice_context = nullptr; diff --git a/src/stdafx.h b/src/stdafx.h index cc5dce3972..a9a5204f5e 100644 --- a/src/stdafx.h +++ b/src/stdafx.h @@ -87,7 +87,7 @@ #endif #if defined(_MSC_VER) - // See https://learn.microsoft.com/en-us/cpp/cpp/empty-bases?view=msvc-170 + /* See https://learn.microsoft.com/en-us/cpp/cpp/empty-bases?view=msvc-170 */ # define EMPTY_BASES __declspec(empty_bases) #else # define EMPTY_BASES diff --git a/src/strings.cpp b/src/strings.cpp index 102f08d132..2470962826 100644 --- a/src/strings.cpp +++ b/src/strings.cpp @@ -1477,7 +1477,7 @@ static void FormatString(StringBuilder &builder, std::string_view str_arg, Strin case SCC_VELOCITY: { // {VELOCITY} int64_t arg = args.GetNextParameter(); - // Unpack vehicle type from packed argument to get desired units. + /* Unpack vehicle type from packed argument to get desired units. */ VehicleType vt = static_cast(GB(arg, 56, 8)); const auto &x = GetVelocityUnits(vt); auto tmp_params = MakeParameters(ConvertKmhishSpeedToDisplaySpeed(GB(arg, 0, 56), vt), x.decimal_places); diff --git a/src/table/newgrf_debug_data.h b/src/table/newgrf_debug_data.h index 0d0da8254a..14e16f127b 100644 --- a/src/table/newgrf_debug_data.h +++ b/src/table/newgrf_debug_data.h @@ -60,7 +60,7 @@ static const NIVariable _niv_vehicles[] = { NIV(0x4C, "current max speed"), NIV(0x4D, "position in articulated vehicle"), NIV(0x60, "count vehicle id occurrences"), - // 0x61 not useful, since it requires register 0x10F + /* 0x61 not useful, since it requires register 0x10F */ NIV(0x62, "curvature/position difference to other vehicle"), NIV(0x63, "tile compatibility wrt. track-type"), }; diff --git a/src/toolbar_gui.cpp b/src/toolbar_gui.cpp index b0b934ae00..f567da94f9 100644 --- a/src/toolbar_gui.cpp +++ b/src/toolbar_gui.cpp @@ -1540,7 +1540,7 @@ class NWidgetMainToolbarContainer : public NWidgetToolbarContainer { WID_TN_AIR, WID_TN_LANDSCAPE, WID_TN_SWITCH_BAR, - // lower toolbar + /* lower toolbar */ WID_TN_SETTINGS, WID_TN_SAVE, WID_TN_SMALL_MAP, @@ -1572,7 +1572,7 @@ class NWidgetMainToolbarContainer : public NWidgetToolbarContainer { WID_TN_ZOOM_IN, WID_TN_ZOOM_OUT, WID_TN_SWITCH_BAR, - // lower toolbar + /* lower toolbar */ WID_TN_PAUSE, WID_TN_SETTINGS, WID_TN_SMALL_MAP, @@ -1606,7 +1606,7 @@ class NWidgetMainToolbarContainer : public NWidgetToolbarContainer { WID_TN_ZOOM_IN, WID_TN_ZOOM_OUT, WID_TN_SWITCH_BAR, - // lower toolbar + /* lower toolbar */ WID_TN_PAUSE, WID_TN_FAST_FORWARD, WID_TN_SAVE, @@ -1642,7 +1642,7 @@ class NWidgetMainToolbarContainer : public NWidgetToolbarContainer { WID_TN_ZOOM_IN, WID_TN_ZOOM_OUT, WID_TN_SWITCH_BAR, - // lower toolbar + /* lower toolbar */ WID_TN_PAUSE, WID_TN_FAST_FORWARD, WID_TN_SAVE, @@ -1680,7 +1680,7 @@ class NWidgetMainToolbarContainer : public NWidgetToolbarContainer { WID_TN_ZOOM_IN, WID_TN_ZOOM_OUT, WID_TN_SWITCH_BAR, - // lower toolbar + /* lower toolbar */ WID_TN_PAUSE, WID_TN_FAST_FORWARD, WID_TN_SAVE, @@ -1720,7 +1720,7 @@ class NWidgetMainToolbarContainer : public NWidgetToolbarContainer { WID_TN_ZOOM_IN, WID_TN_ZOOM_OUT, WID_TN_SWITCH_BAR, - // lower toolbar + /* lower toolbar */ WID_TN_PAUSE, WID_TN_FAST_FORWARD, WID_TN_SAVE, @@ -1762,7 +1762,7 @@ class NWidgetMainToolbarContainer : public NWidgetToolbarContainer { WID_TN_ZOOM_IN, WID_TN_ZOOM_OUT, WID_TN_SWITCH_BAR, - // lower toolbar + /* lower toolbar */ WID_TN_PAUSE, WID_TN_FAST_FORWARD, WID_TN_SAVE, @@ -1909,7 +1909,7 @@ class NWidgetScenarioToolbarContainer : public NWidgetToolbarContainer { WID_TE_TREES, WID_TE_SIGNS, WID_TE_SWITCH_BAR, - // lower toolbar + /* lower toolbar */ WID_TE_PAUSE, WID_TE_FAST_FORWARD, WID_TE_SETTINGS, diff --git a/src/town_cmd.cpp b/src/town_cmd.cpp index 6cb0b5ff27..3b2ed0891d 100644 --- a/src/town_cmd.cpp +++ b/src/town_cmd.cpp @@ -235,7 +235,7 @@ static int _grow_town_result; enum TownGrowthResult { GROWTH_SUCCEED = -1, GROWTH_SEARCH_STOPPED = 0 -// GROWTH_SEARCH_RUNNING >= 1 + /* GROWTH_SEARCH_RUNNING >= 1 */ }; static bool TryBuildTownHouse(Town *t, TileIndex tile); diff --git a/src/tree_gui.cpp b/src/tree_gui.cpp index 109fd08e18..79cf837db3 100644 --- a/src/tree_gui.cpp +++ b/src/tree_gui.cpp @@ -134,7 +134,7 @@ class BuildTreesWindow : public Window } const uint radius = this->mode == PM_FOREST_LG ? 12 : 5; const uint count = this->mode == PM_FOREST_LG ? 12 : 5; - // Create tropic zones only when the tree type is selected by the user and not picked randomly. + /* Create tropic zones only when the tree type is selected by the user and not picked randomly. */ PlaceTreeGroupAroundTile(tile, treetype, radius, count, this->tree_to_plant != TREE_INVALID); } diff --git a/src/video/opengl.cpp b/src/video/opengl.cpp index 561324d6f1..9bd4d0026d 100644 --- a/src/video/opengl.cpp +++ b/src/video/opengl.cpp @@ -695,7 +695,7 @@ std::optional OpenGLBackend::Init(const Dimension &screen_res) /* Prime vertex buffer with a full-screen quad and store * the corresponding state in a vertex array object. */ static const Simple2DVertex vert_array[] = { - // x y u v + /* x y u v */ { 1.f, -1.f, 1.f, 1.f }, { 1.f, 1.f, 1.f, 0.f }, { -1.f, -1.f, 0.f, 1.f }, diff --git a/src/video/sdl2_v.cpp b/src/video/sdl2_v.cpp index 799f05c960..05c1119199 100644 --- a/src/video/sdl2_v.cpp +++ b/src/video/sdl2_v.cpp @@ -471,8 +471,8 @@ bool VideoDriver_SDL_Base::PollEvent() char32_t character; uint keycode = ConvertSdlKeyIntoMy(&ev.key.keysym, &character); - // Only handle non-text keys here. Text is handled in - // SDL_TEXTINPUT below. + /* Only handle non-text keys here. Text is handled in + * SDL_TEXTINPUT below. */ if (!this->edit_box_focused || keycode == WKC_DELETE || keycode == WKC_NUM_ENTER || @@ -507,19 +507,19 @@ bool VideoDriver_SDL_Base::PollEvent() } case SDL_WINDOWEVENT: { if (ev.window.event == SDL_WINDOWEVENT_EXPOSED) { - // Force a redraw of the entire screen. + /* Force a redraw of the entire screen. */ this->MakeDirty(0, 0, _screen.width, _screen.height); } else if (ev.window.event == SDL_WINDOWEVENT_SIZE_CHANGED) { int w = std::max(ev.window.data1, 64); int h = std::max(ev.window.data2, 64); CreateMainSurface(w, h, w != ev.window.data1 || h != ev.window.data2); } else if (ev.window.event == SDL_WINDOWEVENT_ENTER) { - // mouse entered the window, enable cursor + /* mouse entered the window, enable cursor */ _cursor.in_window = true; /* Ensure pointer lock will not occur. */ SDL_SetRelativeMouseMode(SDL_FALSE); } else if (ev.window.event == SDL_WINDOWEVENT_LEAVE) { - // mouse left the window, undraw cursor + /* mouse left the window, undraw cursor */ UndrawMouseCursor(); _cursor.in_window = false; }