# HG changeset patch # User Peter Nelson # Date 2024-01-05 21:50:37 # Node ID ddd9f9f09a4d9c2bfb95b1534771b35ddae1ffce # Parent bbda8868bcc8ff655a216c4199825f0cf2635558 Codechange: Use CompanyMask to pass Companies to PopupMainCompanyToolbMenu(). It's like the type was designed for it. diff --git a/src/toolbar_gui.cpp b/src/toolbar_gui.cpp --- a/src/toolbar_gui.cpp +++ b/src/toolbar_gui.cpp @@ -145,9 +145,9 @@ static const int CTMN_SPECTATOR = -3; * Pop up a generic company list menu. * @param w The toolbar window. * @param widget The button widget id. - * @param grey A bitbask of which items to mark as disabled. + * @param grey A bitmask of which companies to mark as disabled. */ -static void PopupMainCompanyToolbMenu(Window *w, WidgetID widget, int grey = 0) +static void PopupMainCompanyToolbMenu(Window *w, WidgetID widget, CompanyMask grey = 0) { DropDownList list; @@ -728,7 +728,7 @@ static CallBackFunction MenuClickIndustr static void ToolbarVehicleClick(Window *w, VehicleType veh) { - int dis = 0; + CompanyMask dis = 0; for (const Company *c : Company::Iterate()) { if (c->group_all[veh].num_vehicle == 0) SetBit(dis, c->index);