mirror of https://github.com/OpenTTD/OpenTTD
Codechange: Use SQInteger for generic numbers in script_priorityqueue
parent
777b4d0987
commit
cb2e76aae3
|
@ -35,7 +35,7 @@ ScriptPriorityQueue::~ScriptPriorityQueue()
|
||||||
SQInteger ScriptPriorityQueue::Insert(HSQUIRRELVM vm)
|
SQInteger ScriptPriorityQueue::Insert(HSQUIRRELVM vm)
|
||||||
{
|
{
|
||||||
HSQOBJECT item;
|
HSQOBJECT item;
|
||||||
int64 priority;
|
SQInteger priority;
|
||||||
sq_resetobject(&item);
|
sq_resetobject(&item);
|
||||||
sq_getstackobj(vm, 2, &item);
|
sq_getstackobj(vm, 2, &item);
|
||||||
sq_getinteger(vm, 3, &priority);
|
sq_getinteger(vm, 3, &priority);
|
||||||
|
|
|
@ -21,7 +21,7 @@
|
||||||
*/
|
*/
|
||||||
class ScriptPriorityQueue : public ScriptObject {
|
class ScriptPriorityQueue : public ScriptObject {
|
||||||
public:
|
public:
|
||||||
typedef std::pair<int64, HSQOBJECT> PriorityItem;
|
typedef std::pair<SQInteger, HSQOBJECT> PriorityItem;
|
||||||
private:
|
private:
|
||||||
struct PriorityComparator {
|
struct PriorityComparator {
|
||||||
bool operator()(const PriorityItem &lhs, const PriorityItem &rhs) const noexcept
|
bool operator()(const PriorityItem &lhs, const PriorityItem &rhs) const noexcept
|
||||||
|
@ -43,7 +43,7 @@ public:
|
||||||
* @param priority The priority to assign the item.
|
* @param priority The priority to assign the item.
|
||||||
* @return True if the item was inserted, false if it was already in the queue.
|
* @return True if the item was inserted, false if it was already in the queue.
|
||||||
*/
|
*/
|
||||||
bool Insert(void *item, int64 priority);
|
bool Insert(void *item, SQInteger priority);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Remove and return the item with the lowest priority.
|
* Remove and return the item with the lowest priority.
|
||||||
|
|
Loading…
Reference in New Issue