Merge: Codechange: Use null pointer literal instead of the NULL macro
This commit is contained in:
@@ -324,15 +324,15 @@ void LinkGraphOverlay::RefreshDrawCache()
|
||||
{
|
||||
for (StationSupplyList::iterator i(this->cached_stations.begin()); i != this->cached_stations.end(); ++i) {
|
||||
const Station *st = Station::GetIfValid(i->id);
|
||||
if (st == NULL) continue;
|
||||
if (st == nullptr) continue;
|
||||
|
||||
i->pt = this->GetStationMiddle(st);
|
||||
}
|
||||
for (LinkList::iterator i(this->cached_links.begin()); i != this->cached_links.end(); ++i) {
|
||||
const Station *sta = Station::GetIfValid(i->from_id);
|
||||
if (sta == NULL) continue;
|
||||
if (sta == nullptr) continue;
|
||||
const Station *stb = Station::GetIfValid(i->to_id);
|
||||
if (stb == NULL) continue;
|
||||
if (stb == nullptr) continue;
|
||||
|
||||
i->from_pt = this->GetStationMiddle(sta);
|
||||
i->to_pt = this->GetStationMiddle(stb);
|
||||
@@ -408,7 +408,7 @@ void LinkGraphOverlay::DrawStationDots(const DrawPixelInfo *dpi) const
|
||||
if (!this->IsPointVisible(pt, dpi, 3 * this->scale)) continue;
|
||||
|
||||
const Station *st = Station::GetIfValid(i->id);
|
||||
if (st == NULL) continue;
|
||||
if (st == nullptr) continue;
|
||||
|
||||
uint r = this->scale * 2 + this->scale * 2 * min(200, i->quantity) / 200;
|
||||
|
||||
@@ -450,7 +450,7 @@ void LinkGraphOverlay::DrawStationDots(const DrawPixelInfo *dpi) const
|
||||
*/
|
||||
Point LinkGraphOverlay::GetStationMiddle(const Station *st) const
|
||||
{
|
||||
if (this->window->viewport != NULL) {
|
||||
if (this->window->viewport != nullptr) {
|
||||
return GetViewportStationMiddle(this->window->viewport, st);
|
||||
} else {
|
||||
/* assume this is a smallmap */
|
||||
@@ -504,7 +504,7 @@ NWidgetBase *MakeCargoesLegendLinkGraphGUI(int *biggest_index)
|
||||
{
|
||||
static const uint ENTRIES_PER_ROW = CeilDiv(NUM_CARGO, 5);
|
||||
NWidgetVertical *panel = new NWidgetVertical(NC_EQUALSIZE);
|
||||
NWidgetHorizontal *row = NULL;
|
||||
NWidgetHorizontal *row = nullptr;
|
||||
for (uint i = 0; i < NUM_CARGO; ++i) {
|
||||
if (i % ENTRIES_PER_ROW == 0) {
|
||||
if (row) panel->Add(row);
|
||||
@@ -668,7 +668,7 @@ bool LinkGraphLegendWindow::OnTooltip(Point pt, int widget, TooltipCloseConditio
|
||||
{
|
||||
if (IsInsideMM(widget, WID_LGL_COMPANY_FIRST, WID_LGL_COMPANY_LAST + 1)) {
|
||||
if (this->IsWidgetDisabled(widget)) {
|
||||
GuiShowTooltips(this, STR_LINKGRAPH_LEGEND_SELECT_COMPANIES, 0, NULL, close_cond);
|
||||
GuiShowTooltips(this, STR_LINKGRAPH_LEGEND_SELECT_COMPANIES, 0, nullptr, close_cond);
|
||||
} else {
|
||||
uint64 params[2];
|
||||
CompanyID cid = (CompanyID)(widget - WID_LGL_COMPANY_FIRST);
|
||||
|
Reference in New Issue
Block a user