Fix warnings from clang.

This commit is contained in:
Stephen Anthony 2020-05-02 16:07:12 -02:30
parent 5c7bea8923
commit 5da1543066
14 changed files with 12 additions and 32 deletions

View File

@ -42,7 +42,6 @@ CheatCodeDialog::CheatCodeDialog(OSystem& osystem, DialogContainer& parent,
buttonHeight = font.getLineHeight() * 1.25; buttonHeight = font.getLineHeight() * 1.25;
const int VBORDER = fontHeight / 2; const int VBORDER = fontHeight / 2;
const int HBORDER = fontWidth * 1.25; const int HBORDER = fontWidth * 1.25;
const int INDENT = fontWidth * 2;
const int VGAP = fontHeight / 4; const int VGAP = fontHeight / 4;
int xpos, ypos; int xpos, ypos;

View File

@ -71,7 +71,7 @@ class DebuggerDialog : public Dialog
ButtonWidget& unwindButton() const { return *myUnwindButton; } ButtonWidget& unwindButton() const { return *myUnwindButton; }
void showFatalMessage(const string& msg); void showFatalMessage(const string& msg);
void saveConfig(); void saveConfig() override;
private: private:
void center() override { positionAt(0); } void center() override { positionAt(0); }

View File

@ -34,7 +34,6 @@ AboutDialog::AboutDialog(OSystem& osystem, DialogContainer& parent,
buttonHeight = font.getLineHeight() * 1.25; buttonHeight = font.getLineHeight() * 1.25;
const int VBORDER = fontHeight / 2; const int VBORDER = fontHeight / 2;
const int HBORDER = fontWidth * 1.25; const int HBORDER = fontWidth * 1.25;
const int INDENT = fontWidth * 2;
const int VGAP = fontHeight / 4; const int VGAP = fontHeight / 4;
int xpos, ypos; int xpos, ypos;

View File

@ -37,7 +37,6 @@ ComboDialog::ComboDialog(GuiObject* boss, const GUI::Font& font,
buttonHeight = font.getLineHeight() * 1.25; buttonHeight = font.getLineHeight() * 1.25;
const int VBORDER = fontHeight / 2; const int VBORDER = fontHeight / 2;
const int HBORDER = fontWidth * 1.25; const int HBORDER = fontWidth * 1.25;
const int INDENT = fontWidth * 2;
const int VGAP = fontHeight / 4; const int VGAP = fontHeight / 4;
int xpos, ypos; int xpos, ypos;

View File

@ -33,8 +33,7 @@
CommandDialog::CommandDialog(OSystem& osystem, DialogContainer& parent) CommandDialog::CommandDialog(OSystem& osystem, DialogContainer& parent)
: Dialog(osystem, parent, osystem.frameBuffer().font(), "Commands") : Dialog(osystem, parent, osystem.frameBuffer().font(), "Commands")
{ {
const int lineHeight = _font.getLineHeight(), const int fontHeight = _font.getFontHeight(),
fontHeight = _font.getFontHeight(),
fontWidth = _font.getMaxCharWidth(), fontWidth = _font.getMaxCharWidth(),
buttonHeight = _font.getLineHeight() * 1.25, buttonHeight = _font.getLineHeight() * 1.25,
buttonWidth = _font.getStringWidth("Time Machine On") + fontWidth * 2; buttonWidth = _font.getStringWidth("Time Machine On") + fontWidth * 2;

View File

@ -54,7 +54,6 @@ DeveloperDialog::DeveloperDialog(OSystem& osystem, DialogContainer& parent,
buttonHeight = font.getLineHeight() * 1.25; buttonHeight = font.getLineHeight() * 1.25;
const int VBORDER = fontHeight / 2; const int VBORDER = fontHeight / 2;
const int HBORDER = fontWidth * 1.25; const int HBORDER = fontWidth * 1.25;
const int INDENT = fontWidth * 2;
const int VGAP = fontHeight / 4; const int VGAP = fontHeight / 4;
int xpos, ypos; int xpos, ypos;
@ -90,8 +89,7 @@ void DeveloperDialog::addEmulationTab(const GUI::Font& font)
{ {
const int lineHeight = font.getLineHeight(), const int lineHeight = font.getLineHeight(),
fontHeight = font.getFontHeight(), fontHeight = font.getFontHeight(),
fontWidth = font.getMaxCharWidth(), fontWidth = font.getMaxCharWidth();
buttonHeight = font.getLineHeight() * 1.25;
const int VBORDER = fontHeight / 2; const int VBORDER = fontHeight / 2;
const int HBORDER = fontWidth * 1.25; const int HBORDER = fontWidth * 1.25;
const int INDENT = fontWidth * 2; const int INDENT = fontWidth * 2;
@ -197,8 +195,7 @@ void DeveloperDialog::addTiaTab(const GUI::Font& font)
{ {
const int lineHeight = font.getLineHeight(), const int lineHeight = font.getLineHeight(),
fontHeight = font.getFontHeight(), fontHeight = font.getFontHeight(),
fontWidth = font.getMaxCharWidth(), fontWidth = font.getMaxCharWidth();
buttonHeight = font.getLineHeight() * 1.25;
const int VBORDER = fontHeight / 2; const int VBORDER = fontHeight / 2;
const int HBORDER = fontWidth * 1.25; const int HBORDER = fontWidth * 1.25;
const int INDENT = fontWidth * 2; const int INDENT = fontWidth * 2;
@ -287,8 +284,7 @@ void DeveloperDialog::addVideoTab(const GUI::Font& font)
{ {
const int lineHeight = font.getLineHeight(), const int lineHeight = font.getLineHeight(),
fontHeight = font.getFontHeight(), fontHeight = font.getFontHeight(),
fontWidth = font.getMaxCharWidth(), fontWidth = font.getMaxCharWidth();
buttonHeight = font.getLineHeight() * 1.25;
const int VBORDER = fontHeight / 2; const int VBORDER = fontHeight / 2;
const int HBORDER = fontWidth * 1.25; const int HBORDER = fontWidth * 1.25;
const int INDENT = fontWidth * 2; const int INDENT = fontWidth * 2;
@ -428,8 +424,7 @@ void DeveloperDialog::addTimeMachineTab(const GUI::Font& font)
}; };
const int lineHeight = font.getLineHeight(), const int lineHeight = font.getLineHeight(),
fontHeight = font.getFontHeight(), fontHeight = font.getFontHeight(),
fontWidth = font.getMaxCharWidth(), fontWidth = font.getMaxCharWidth();
buttonHeight = font.getLineHeight() * 1.25;
const int VBORDER = fontHeight / 2; const int VBORDER = fontHeight / 2;
const int HBORDER = fontWidth * 1.25; const int HBORDER = fontWidth * 1.25;
const int INDENT = fontWidth * 2; const int INDENT = fontWidth * 2;
@ -548,11 +543,9 @@ void DeveloperDialog::addDebuggerTab(const GUI::Font& font)
#ifdef DEBUGGER_SUPPORT #ifdef DEBUGGER_SUPPORT
const int lineHeight = font.getLineHeight(), const int lineHeight = font.getLineHeight(),
fontHeight = font.getFontHeight(), fontHeight = font.getFontHeight(),
fontWidth = font.getMaxCharWidth(), fontWidth = font.getMaxCharWidth();
buttonHeight = font.getLineHeight() * 1.25;
const int VBORDER = fontHeight / 2; const int VBORDER = fontHeight / 2;
const int HBORDER = fontWidth * 1.25; const int HBORDER = fontWidth * 1.25;
const int INDENT = fontWidth * 2;
const int VGAP = fontHeight / 4; const int VGAP = fontHeight / 4;
VariantList items; VariantList items;

View File

@ -772,8 +772,7 @@ void Dialog::addOKCancelBGroup(WidgetArray& wid, const GUI::Font& font,
const string& okText, const string& cancelText, const string& okText, const string& cancelText,
bool focusOKButton, int buttonWidth) bool focusOKButton, int buttonWidth)
{ {
const int lineHeight = font.getLineHeight(), const int fontWidth = font.getMaxCharWidth(),
fontWidth = font.getMaxCharWidth(),
fontHeight = font.getFontHeight(), fontHeight = font.getFontHeight(),
buttonHeight = font.getLineHeight() * 1.25; buttonHeight = font.getLineHeight() * 1.25;
const int VBORDER = fontHeight / 2; const int VBORDER = fontHeight / 2;
@ -821,8 +820,7 @@ void Dialog::addDefaultsOKCancelBGroup(WidgetArray& wid, const GUI::Font& font,
const string& defaultsText, const string& defaultsText,
bool focusOKButton) bool focusOKButton)
{ {
const int lineHeight = font.getLineHeight(), const int fontWidth = font.getMaxCharWidth(),
fontWidth = font.getMaxCharWidth(),
fontHeight = font.getFontHeight(), fontHeight = font.getFontHeight(),
buttonHeight = font.getLineHeight() * 1.25; buttonHeight = font.getLineHeight() * 1.25;
const int VBORDER = fontHeight / 2; const int VBORDER = fontHeight / 2;

View File

@ -39,7 +39,6 @@ GlobalPropsDialog::GlobalPropsDialog(GuiObject* boss, const GUI::Font& font)
buttonHeight = lineHeight * 1.25; buttonHeight = lineHeight * 1.25;
const int VBORDER = fontHeight / 2; const int VBORDER = fontHeight / 2;
const int HBORDER = fontWidth * 1.25; const int HBORDER = fontWidth * 1.25;
const int INDENT = fontWidth * 2;
const int VGAP = fontHeight / 4; const int VGAP = fontHeight / 4;
int xpos, ypos; int xpos, ypos;

View File

@ -35,7 +35,6 @@ HelpDialog::HelpDialog(OSystem& osystem, DialogContainer& parent,
buttonHeight = font.getLineHeight() * 1.25; buttonHeight = font.getLineHeight() * 1.25;
const int VBORDER = fontHeight / 2; const int VBORDER = fontHeight / 2;
const int HBORDER = fontWidth * 1.25; const int HBORDER = fontWidth * 1.25;
const int INDENT = fontWidth * 2;
const int VGAP = fontHeight / 4; const int VGAP = fontHeight / 4;
int xpos, ypos; int xpos, ypos;
@ -73,7 +72,7 @@ HelpDialog::HelpDialog(OSystem& osystem, DialogContainer& parent,
int lwidth = 15 * fontWidth; int lwidth = 15 * fontWidth;
ypos += lineHeight + VGAP * 2; ypos += lineHeight + VGAP * 2;
for(int i = 0; i < LINES_PER_PAGE; ++i) for(uInt32 i = 0; i < LINES_PER_PAGE; ++i)
{ {
myKey[i] = myKey[i] =
new StaticTextWidget(this, font, xpos, ypos, lwidth, new StaticTextWidget(this, font, xpos, ypos, lwidth,

View File

@ -39,8 +39,6 @@ JoystickDialog::JoystickDialog(GuiObject* boss, const GUI::Font& font,
buttonHeight = font.getLineHeight() * 1.25; buttonHeight = font.getLineHeight() * 1.25;
const int VBORDER = fontHeight / 2; const int VBORDER = fontHeight / 2;
const int HBORDER = fontWidth * 1.25; const int HBORDER = fontWidth * 1.25;
const int INDENT = fontWidth * 2;
const int VGAP = fontHeight / 4;
// Joystick list // Joystick list
xpos = HBORDER; ypos = VBORDER + _th; xpos = HBORDER; ypos = VBORDER + _th;

View File

@ -43,7 +43,6 @@ LoggerDialog::LoggerDialog(OSystem& osystem, DialogContainer& parent,
buttonHeight = font.getLineHeight() * 1.25; buttonHeight = font.getLineHeight() * 1.25;
const int VBORDER = fontHeight / 2; const int VBORDER = fontHeight / 2;
const int HBORDER = fontWidth * 1.25; const int HBORDER = fontWidth * 1.25;
const int INDENT = fontWidth * 2;
const int VGAP = fontHeight / 4; const int VGAP = fontHeight / 4;
int xpos, ypos; int xpos, ypos;

View File

@ -54,7 +54,7 @@ OptionsDialog::OptionsDialog(OSystem& osystem, DialogContainer& parent,
{ {
// do not show basic settings options in debugger // do not show basic settings options in debugger
bool minSettings = osystem.settings().getBool("minimal_ui") && mode != Menu::AppMode::debugger; bool minSettings = osystem.settings().getBool("minimal_ui") && mode != Menu::AppMode::debugger;
const int lineHeight = _font.getLineHeight(), const int
fontWidth = _font.getMaxCharWidth(), fontWidth = _font.getMaxCharWidth(),
fontHeight = _font.getFontHeight(), fontHeight = _font.getFontHeight(),
buttonHeight = _font.getLineHeight() * 1.25, buttonHeight = _font.getLineHeight() * 1.25,

View File

@ -48,8 +48,6 @@ RomAuditDialog::RomAuditDialog(OSystem& osystem, DialogContainer& parent,
lwidth = font.getStringWidth("ROMs without properties (skipped) "); lwidth = font.getStringWidth("ROMs without properties (skipped) ");
const int VBORDER = _th + fontHeight / 2; const int VBORDER = _th + fontHeight / 2;
const int HBORDER = fontWidth * 1.25; const int HBORDER = fontWidth * 1.25;
const int INDENT = fontWidth * 2;
const int VGAP = fontHeight / 4;
int xpos, ypos = VBORDER; int xpos, ypos = VBORDER;
WidgetArray wid; WidgetArray wid;

View File

@ -205,7 +205,7 @@ void RomInfoWidget::drawWidget(bool hilite)
int xpos = _x + 8, ypos = _y + yoff + 5; int xpos = _x + 8, ypos = _y + yoff + 5;
for(const auto& info : myRomInfo) for(const auto& info : myRomInfo)
{ {
if(info.length() * _font.getMaxCharWidth() <= _w - 16) if(info.length() * _font.getMaxCharWidth() <= uInt64(_w - 16))
{ {
// 1 line for next entry // 1 line for next entry