Fix minor compiler warnings in g++ and clang.

This commit is contained in:
Stephen Anthony 2021-08-26 19:17:18 -02:30
parent f67bcec1b6
commit eba34b5320
6 changed files with 14 additions and 9 deletions

View File

@ -30,6 +30,7 @@
#pragma clang diagnostic ignored "-Wdocumentation-unknown-command"
#pragma clang diagnostic ignored "-Wimplicit-fallthrough"
#pragma clang diagnostic ignored "-Wreserved-id-macro"
#pragma clang diagnostic ignored "-Wold-style-cast"
#include <SDL.h>
#pragma clang diagnostic pop
#else

View File

@ -266,7 +266,7 @@ void CartridgeARMWidget::handleArmCycles()
{
bool devSettings = instance().settings().getBool("dev.settings");
bool enable = myIncCycles->getState();
double factor = myCycleFactor->getValue() / 100.F;
double factor = static_cast<double>(myCycleFactor->getValue()) / 100.0;
if(devSettings)
{

View File

@ -107,7 +107,8 @@ CartridgeCDF::CartridgeCDF(const ByteBuffer& image, size_t size,
static_cast<uInt32>(mySize),
cBase, cStart, cStack,
devSettings ? settings.getBool("dev.thumb.trapfatal") : false,
devSettings ? settings.getFloat("dev.thumb.cyclefactor") : 1.0,
devSettings ? static_cast<double>(
settings.getFloat("dev.thumb.cyclefactor")) : 1.0,
thumulatorConfiguration(myCDFSubtype),
this);

View File

@ -57,7 +57,8 @@ CartridgeDPCPlus::CartridgeDPCPlus(const ByteBuffer& image, size_t size,
0x00000C08,
0x40001FDC,
devSettings ? settings.getBool("dev.thumb.trapfatal") : false,
devSettings ? settings.getFloat("dev.thumb.cyclefactor") : 1.0,
devSettings ? static_cast<double>(
settings.getFloat("dev.thumb.cyclefactor")) : 1.0,
Thumbulator::ConfigureFor::DPCplus,
this);

View File

@ -74,13 +74,13 @@ using Common::Base;
#define INC_LDR_CYCLES \
INC_N_CYCLES(rb, AccessType::data); \
INC_I_CYCLES; \
//FETCH_TYPE(CycleType::N, AccessType::data); \
//FETCH_TYPE_N;
/*FETCH_TYPE(CycleType::N, AccessType::data); \
FETCH_TYPE_N;*/
#define INC_LDRB_CYCLES \
INC_N_CYCLES(rb & (~1U), AccessType::data); \
INC_I_CYCLES; \
//FETCH_TYPE(CycleType::N, AccessType::data); \
//FETCH_TYPE_N;
/*FETCH_TYPE(CycleType::N, AccessType::data); \
FETCH_TYPE_N;*/
#define INC_STR_CYCLES \
INC_N_CYCLES(rb, AccessType::data); \
@ -91,9 +91,11 @@ using Common::Base;
FETCH_TYPE_N; \
//INC_N_CYCLES(rb & (~1U), AccessType::data);
#if 0 // unused for now
#define FETCH_TYPE(cycleType, accessType) \
_prefetchCycleType[_pipeIdx] = cycleType; \
_prefetchAccessType[_pipeIdx] = accessType
#endif
#define FETCH_TYPE_N \
_prefetchCycleType[_pipeIdx] = CycleType::N
@ -290,7 +292,7 @@ uInt32 Thumbulator::fetch16(uInt32 addr)
uInt32 data;
#ifdef THUMB_CYCLE_COUNT
_pipeIdx = (++_pipeIdx) % 3;
_pipeIdx = (_pipeIdx+1) % 3;
#ifdef MERGE_I_S
if(_lastCycleType[2] == CycleType::I)

View File

@ -40,7 +40,7 @@ PopUpWidget::PopUpWidget(GuiObject* boss, const GUI::Font& font,
_textcolorhi = kTextColor; // do not highlight the label
setTextFilter([](char c) {
return isprint(c) && c != '\"' || c == '\x1c' || c == '\x1d'; // DEGREE || ELLIPSIS
return (isprint(c) && c != '\"') || c == '\x1c' || c == '\x1d'; // DEGREE || ELLIPSIS
});
setEditable(false);