Codechange: Use null pointer literal instead of the NULL macro
This commit is contained in:
committed by
Michael Lutz
parent
3b4f224c0b
commit
7c8e7c6b6e
@@ -48,7 +48,7 @@ private:
|
||||
uint16 max_speed; ///< How fast the vehicle may go on the way to the destination.
|
||||
|
||||
public:
|
||||
Order *next; ///< Pointer to next order. If NULL, end of list
|
||||
Order *next; ///< Pointer to next order. If nullptr, end of list
|
||||
|
||||
Order() : flags(0), refit_cargo(CT_NO_REFIT), max_speed(UINT16_MAX) {}
|
||||
~Order();
|
||||
@@ -268,7 +268,7 @@ private:
|
||||
public:
|
||||
/** Default constructor producing an invalid order list. */
|
||||
OrderList(VehicleOrderID num_orders = INVALID_VEH_ORDER_ID)
|
||||
: first(NULL), num_orders(num_orders), num_manual_orders(0), num_vehicles(0), first_shared(NULL),
|
||||
: first(nullptr), num_orders(num_orders), num_manual_orders(0), num_vehicles(0), first_shared(nullptr),
|
||||
timetable_duration(0), total_duration(0) { }
|
||||
|
||||
/**
|
||||
@@ -303,7 +303,7 @@ public:
|
||||
* @param curr Order to find the next one for.
|
||||
* @return Next order.
|
||||
*/
|
||||
inline const Order *GetNext(const Order *curr) const { return (curr->next == NULL) ? this->GetFirstOrder() : curr->next; }
|
||||
inline const Order *GetNext(const Order *curr) const { return (curr->next == nullptr) ? this->GetFirstOrder() : curr->next; }
|
||||
|
||||
/**
|
||||
* Get number of orders in the order list.
|
||||
@@ -317,7 +317,7 @@ public:
|
||||
*/
|
||||
inline VehicleOrderID GetNumManualOrders() const { return this->num_manual_orders; }
|
||||
|
||||
StationIDStack GetNextStoppingStation(const Vehicle *v, const Order *first = NULL, uint hops = 0) const;
|
||||
StationIDStack GetNextStoppingStation(const Vehicle *v, const Order *first = nullptr, uint hops = 0) const;
|
||||
const Order *GetNextDecisionNode(const Order *next, uint hops) const;
|
||||
|
||||
void InsertOrderAt(Order *new_order, int index);
|
||||
@@ -396,7 +396,7 @@ public:
|
||||
#define FOR_ALL_ORDERS(var) FOR_ALL_ORDERS_FROM(var, 0)
|
||||
|
||||
|
||||
#define FOR_VEHICLE_ORDERS(v, order) for (order = (v->orders.list == NULL) ? NULL : v->orders.list->GetFirstOrder(); order != NULL; order = order->next)
|
||||
#define FOR_VEHICLE_ORDERS(v, order) for (order = (v->orders.list == nullptr) ? nullptr : v->orders.list->GetFirstOrder(); order != nullptr; order = order->next)
|
||||
|
||||
|
||||
#define FOR_ALL_ORDER_LISTS_FROM(var, start) FOR_ALL_ITEMS_FROM(OrderList, orderlist_index, var, start)
|
||||
|
||||
Reference in New Issue
Block a user