mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-03-09 07:29:44 +00:00
(svn r13683) -Codechange: privatize a function that is not used outside of the class who calls it
This commit is contained in:
parent
cb452bcc7d
commit
33150af3e2
@ -113,27 +113,6 @@ uint GetMaskOfTownActions(int *nump, PlayerID pid, const Town *t)
|
||||
return buttons;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the position of the Nth set bit.
|
||||
*
|
||||
* If there is no Nth bit set return -1
|
||||
*
|
||||
* @param bits The value to search in
|
||||
* @param n The Nth set bit from which we want to know the position
|
||||
* @return The position of the Nth set bit
|
||||
*/
|
||||
static int GetNthSetBit(uint32 bits, int n)
|
||||
{
|
||||
if (n >= 0) {
|
||||
uint i;
|
||||
FOR_EACH_SET_BIT(i, bits) {
|
||||
n--;
|
||||
if (n < 0) return i;
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
struct TownAuthorityWindow : Window {
|
||||
private:
|
||||
Town *town;
|
||||
@ -149,6 +128,27 @@ private:
|
||||
TWA_EXECUTE,
|
||||
};
|
||||
|
||||
/**
|
||||
* Get the position of the Nth set bit.
|
||||
*
|
||||
* If there is no Nth bit set return -1
|
||||
*
|
||||
* @param bits The value to search in
|
||||
* @param n The Nth set bit from which we want to know the position
|
||||
* @return The position of the Nth set bit
|
||||
*/
|
||||
static int GetNthSetBit(uint32 bits, int n)
|
||||
{
|
||||
if (n >= 0) {
|
||||
uint i;
|
||||
FOR_EACH_SET_BIT(i, bits) {
|
||||
n--;
|
||||
if (n < 0) return i;
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
public:
|
||||
TownAuthorityWindow(const WindowDesc *desc, WindowNumber window_number) :
|
||||
Window(desc, window_number), sel_index(-1)
|
||||
|
Loading…
Reference in New Issue
Block a user