Codechange: Silence warnings about intentionally unused parameters.

This commit is contained in:
frosch
2023-09-16 22:20:53 +02:00
committed by frosch
parent df400ef84a
commit b6c8f301be
227 changed files with 972 additions and 1039 deletions

View File

@@ -243,12 +243,11 @@ void SortIndustryTypes()
/**
* Command callback. In case of failure to build an industry, show an error message.
* @param cmd Unused.
* @param result Result of the command.
* @param tile Tile where the industry is placed.
* @param indtype Industry type.
*/
void CcBuildIndustry(Commands cmd, const CommandCost &result, TileIndex tile, IndustryType indtype, uint32_t, bool, uint32_t)
void CcBuildIndustry(Commands, const CommandCost &result, TileIndex tile, IndustryType indtype, uint32_t, bool, uint32_t)
{
if (result.Succeeded()) return;
@@ -425,7 +424,7 @@ public:
this->SetupArrays();
}
void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) override
void UpdateWidgetSize(int widget, Dimension *size, [[maybe_unused]] const Dimension &padding, [[maybe_unused]] Dimension *fill, [[maybe_unused]] Dimension *resize) override
{
switch (widget) {
case WID_DPI_MATRIX_WIDGET: {
@@ -598,7 +597,7 @@ public:
}
}
static void AskManyRandomIndustriesCallback(Window *w, bool confirmed)
static void AskManyRandomIndustriesCallback(Window *, bool confirmed)
{
if (!confirmed) return;
@@ -613,7 +612,7 @@ public:
}
}
static void AskRemoveAllIndustriesCallback(Window *w, bool confirmed)
static void AskRemoveAllIndustriesCallback(Window *, bool confirmed)
{
if (!confirmed) return;
@@ -629,7 +628,7 @@ public:
MarkWholeScreenDirty();
}
void OnClick(Point pt, int widget, int click_count) override
void OnClick([[maybe_unused]] Point pt, int widget, [[maybe_unused]] int click_count) override
{
switch (widget) {
case WID_DPI_CREATE_RANDOM_INDUSTRIES_WIDGET: {
@@ -693,7 +692,7 @@ public:
this->vscroll->SetCapacityFromWidget(this, WID_DPI_MATRIX_WIDGET);
}
void OnPlaceObject(Point pt, TileIndex tile) override
void OnPlaceObject([[maybe_unused]] Point pt, TileIndex tile) override
{
bool success = true;
/* We do not need to protect ourselves against "Random Many Industries" in this mode */
@@ -753,7 +752,7 @@ public:
* @param data Information about the changed data.
* @param gui_scope Whether the call is done from GUI scope. You may not do everything when not in GUI scope. See #InvalidateWindowData() for details.
*/
void OnInvalidateData(int data = 0, bool gui_scope = true) override
void OnInvalidateData([[maybe_unused]] int data = 0, [[maybe_unused]] bool gui_scope = true) override
{
if (!gui_scope) return;
this->SetupArrays();
@@ -989,12 +988,12 @@ public:
if (widget == WID_IV_CAPTION) SetDParam(0, this->window_number);
}
void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) override
void UpdateWidgetSize(int widget, Dimension *size, [[maybe_unused]] const Dimension &padding, [[maybe_unused]] Dimension *fill, [[maybe_unused]] Dimension *resize) override
{
if (widget == WID_IV_INFO) size->height = this->info_height;
}
void OnClick(Point pt, int widget, int click_count) override
void OnClick([[maybe_unused]] Point pt, int widget, [[maybe_unused]] int click_count) override
{
switch (widget) {
case WID_IV_INFO: {
@@ -1142,7 +1141,7 @@ public:
* @param data Information about the changed data.
* @param gui_scope Whether the call is done from GUI scope. You may not do everything when not in GUI scope. See #InvalidateWindowData() for details.
*/
void OnInvalidateData(int data = 0, bool gui_scope = true) override
void OnInvalidateData([[maybe_unused]] int data = 0, [[maybe_unused]] bool gui_scope = true) override
{
if (!gui_scope) return;
const Industry *i = Industry::Get(this->window_number);
@@ -1617,7 +1616,7 @@ protected:
}
public:
IndustryDirectoryWindow(WindowDesc *desc, WindowNumber number) : Window(desc), industry_editbox(MAX_FILTER_LENGTH * MAX_CHAR_LENGTH, MAX_FILTER_LENGTH)
IndustryDirectoryWindow(WindowDesc *desc, WindowNumber) : Window(desc), industry_editbox(MAX_FILTER_LENGTH * MAX_CHAR_LENGTH, MAX_FILTER_LENGTH)
{
this->CreateNestedTree();
this->vscroll = this->GetScrollbar(WID_ID_SCROLLBAR);
@@ -1694,7 +1693,7 @@ public:
}
}
void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) override
void UpdateWidgetSize(int widget, Dimension *size, [[maybe_unused]] const Dimension &padding, [[maybe_unused]] Dimension *fill, [[maybe_unused]] Dimension *resize) override
{
switch (widget) {
case WID_ID_DROPDOWN_ORDER: {
@@ -1732,7 +1731,7 @@ public:
}
void OnClick(Point pt, int widget, int click_count) override
void OnClick([[maybe_unused]] Point pt, int widget, [[maybe_unused]] int click_count) override
{
switch (widget) {
case WID_ID_DROPDOWN_ORDER:
@@ -1821,7 +1820,7 @@ public:
* @param data Information about the changed data.
* @param gui_scope Whether the call is done from GUI scope. You may not do everything when not in GUI scope. See #InvalidateWindowData() for details.
*/
void OnInvalidateData(int data = 0, bool gui_scope = true) override
void OnInvalidateData([[maybe_unused]] int data = 0, [[maybe_unused]] bool gui_scope = true) override
{
switch (data) {
case IDIWD_FORCE_REBUILD:
@@ -2586,7 +2585,7 @@ struct IndustryCargoesWindow : public Window {
CargoesField::cargo_field_width = CargoesField::cargo_border.width * 2 + CargoesField::cargo_line.width * CargoesField::max_cargoes + CargoesField::cargo_space.width * (CargoesField::max_cargoes - 1);
}
void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) override
void UpdateWidgetSize(int widget, Dimension *size, [[maybe_unused]] const Dimension &padding, [[maybe_unused]] Dimension *fill, [[maybe_unused]] Dimension *resize) override
{
switch (widget) {
case WID_IC_PANEL:
@@ -2924,7 +2923,7 @@ struct IndustryCargoesWindow : public Window {
* - data = NUM_INDUSTRYTYPES: Stop sending updates to the smallmap window.
* @param gui_scope Whether the call is done from GUI scope. You may not do everything when not in GUI scope. See #InvalidateWindowData() for details.
*/
void OnInvalidateData(int data = 0, bool gui_scope = true) override
void OnInvalidateData([[maybe_unused]] int data = 0, [[maybe_unused]] bool gui_scope = true) override
{
if (!gui_scope) return;
if (data == NUM_INDUSTRYTYPES) {
@@ -3021,7 +3020,7 @@ struct IndustryCargoesWindow : public Window {
return true;
}
void OnClick(Point pt, int widget, int click_count) override
void OnClick([[maybe_unused]] Point pt, int widget, [[maybe_unused]] int click_count) override
{
switch (widget) {
case WID_IC_PANEL: {
@@ -3108,7 +3107,7 @@ struct IndustryCargoesWindow : public Window {
}
}
bool OnTooltip(Point pt, int widget, TooltipCloseCondition close_cond) override
bool OnTooltip([[maybe_unused]] Point pt, int widget, TooltipCloseCondition close_cond) override
{
if (widget != WID_IC_PANEL) return false;