From 921ab68a480afc969d2d8c8150c23250f245ba52 Mon Sep 17 00:00:00 2001 From: Patric Stout Date: Mon, 31 May 2021 10:56:06 +0200 Subject: Codechange: use AsIntSetting()->Read() wrapper if possible (#9324) --- src/news_gui.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src/news_gui.cpp') diff --git a/src/news_gui.cpp b/src/news_gui.cpp index a8d7c4398..731eb95c2 100644 --- a/src/news_gui.cpp +++ b/src/news_gui.cpp @@ -254,9 +254,8 @@ static_assert(lengthof(_news_type_data) == NT_END); NewsDisplay NewsTypeData::GetDisplay() const { const SettingDesc *sd = GetSettingFromName(this->name); - assert(sd != nullptr); - void *ptr = GetVariableAddress(nullptr, &sd->save); - return (NewsDisplay)ReadValue(ptr, sd->save.conv); + assert(sd != nullptr && sd->IsIntSetting()); + return (NewsDisplay)sd->AsIntSetting()->Read(nullptr); } /** Window class displaying a news item. */ -- cgit v1.2.3-54-g00ecf