Fixes from clang-tidy for the entire codebase, including header files.

This commit is contained in:
Stephen Anthony 2024-08-03 20:35:45 -02:30
parent 6c0e6598f5
commit 67974a92e0
149 changed files with 433 additions and 389 deletions

View File

@ -127,7 +127,7 @@ class AudioSettings
private:
Settings& mySettings;
Settings& mySettings; // NOLINT: we want a reference here
Preset myPreset{Preset::custom};

View File

@ -326,8 +326,7 @@ bool PhysicalJoystickHandler::hasStelladaptors() const
// 2. reset all events to default (event == Event::NoType, updateDefault == false)
// 3. reset one event to default (event != Event::NoType)
void PhysicalJoystickHandler::setDefaultAction(int stick,
EventMapping map, Event::Type event,
EventMode mode, bool updateDefaults)
EventMapping map, Event::Type event, EventMode mode, bool updateDefaults)
{
const PhysicalJoystickPtr j = joy(stick);
@ -406,11 +405,11 @@ void PhysicalJoystickHandler::setStickDefaultMapping(
setDefaultAction(stick, item, event, EventMode::kDrivingMode, updateDefaults);
}
#if defined(RETRON77)
#if defined(RETRON77)
constexpr bool retron77 = true;
#else
#else
constexpr bool retron77 = false;
#endif
#endif
// Regular joysticks can only be used by one player at a time,
// so we need to separate the paddles onto different
@ -501,7 +500,7 @@ void PhysicalJoystickHandler::setDefaultMapping(Event::Type event, EventMode mod
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void PhysicalJoystickHandler::defineControllerMappings(
const Controller::Type type, Controller::Jack port, const Properties& properties,
Controller::Type type, Controller::Jack port, const Properties& properties,
Controller::Type qtType1, Controller::Type qtType2)
{
// Determine controller events to use
@ -531,7 +530,7 @@ void PhysicalJoystickHandler::defineControllerMappings(
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
EventMode PhysicalJoystickHandler::getMode(const Properties& properties,
const PropType propType)
PropType propType)
{
const string& propName = properties.get(propType);
@ -542,7 +541,7 @@ EventMode PhysicalJoystickHandler::getMode(const Properties& properties,
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
EventMode PhysicalJoystickHandler::getMode(const Controller::Type type)
EventMode PhysicalJoystickHandler::getMode(Controller::Type type)
{
switch(type)
{
@ -671,7 +670,7 @@ void PhysicalJoystickHandler::enableMappings(const Event::EventSet& events, Even
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void PhysicalJoystickHandler::enableMapping(const Event::Type event, EventMode mode)
void PhysicalJoystickHandler::enableMapping(Event::Type event, EventMode mode)
{
// copy from controller mode into emulation mode
for (auto& stick : mySticks)
@ -687,8 +686,7 @@ void PhysicalJoystickHandler::enableMapping(const Event::Type event, EventMode m
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
EventMode PhysicalJoystickHandler::getEventMode(const Event::Type event,
const EventMode mode)
EventMode PhysicalJoystickHandler::getEventMode(Event::Type event, EventMode mode)
{
if(mode == EventMode::kEmulationMode)
{
@ -712,7 +710,7 @@ EventMode PhysicalJoystickHandler::getEventMode(const Event::Type event,
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
bool PhysicalJoystickHandler::isJoystickEvent(const Event::Type event)
bool PhysicalJoystickHandler::isJoystickEvent(Event::Type event)
{
return LeftJoystickEvents.contains(event)
|| QTJoystick3Events.contains(event)
@ -721,7 +719,7 @@ bool PhysicalJoystickHandler::isJoystickEvent(const Event::Type event)
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
bool PhysicalJoystickHandler::isPaddleEvent(const Event::Type event)
bool PhysicalJoystickHandler::isPaddleEvent(Event::Type event)
{
return LeftPaddlesEvents.contains(event)
|| QTPaddles3Events.contains(event)
@ -730,21 +728,21 @@ bool PhysicalJoystickHandler::isPaddleEvent(const Event::Type event)
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
bool PhysicalJoystickHandler::isKeyboardEvent(const Event::Type event)
bool PhysicalJoystickHandler::isKeyboardEvent(Event::Type event)
{
return LeftKeyboardEvents.contains(event)
|| RightKeyboardEvents.contains(event);
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
bool PhysicalJoystickHandler::isDrivingEvent(const Event::Type event)
bool PhysicalJoystickHandler::isDrivingEvent(Event::Type event)
{
return LeftDrivingEvents.contains(event)
|| RightDrivingEvents.contains(event);
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
bool PhysicalJoystickHandler::isCommonEvent(const Event::Type event)
bool PhysicalJoystickHandler::isCommonEvent(Event::Type event)
{
return !(isJoystickEvent(event) || isPaddleEvent(event)
|| isKeyboardEvent(event) || isDrivingEvent(event));
@ -820,8 +818,8 @@ string PhysicalJoystickHandler::getMappingDesc(Event::Type event, EventMode mode
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
bool PhysicalJoystickHandler::addJoyMapping(Event::Type event, EventMode mode, int stick,
int button, JoyAxis axis, JoyDir adir)
bool PhysicalJoystickHandler::addJoyMapping(Event::Type event, EventMode mode,
int stick, int button, JoyAxis axis, JoyDir adir)
{
const PhysicalJoystickPtr j = joy(stick);
@ -861,8 +859,8 @@ bool PhysicalJoystickHandler::addJoyMapping(Event::Type event, EventMode mode, i
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
bool PhysicalJoystickHandler::addJoyHatMapping(Event::Type event, EventMode mode, int stick,
int button, int hat, JoyHatDir hdir)
bool PhysicalJoystickHandler::addJoyHatMapping(Event::Type event, EventMode mode,
int stick, int button, int hat, JoyHatDir hdir)
{
const PhysicalJoystickPtr j = joy(stick);

View File

@ -53,7 +53,7 @@ class PhysicalJoystickHandler
int ID;
PhysicalJoystick::Port port;
explicit MinStrickInfo(string _name, int _id, PhysicalJoystick::Port _port)
explicit MinStrickInfo(string_view _name, int _id, PhysicalJoystick::Port _port)
: name{_name}, ID{_id}, port{_port} {}
};
using MinStrickInfoList = std::vector<MinStrickInfo>;
@ -66,7 +66,7 @@ class PhysicalJoystickHandler
// on the 'mapping' instance variable; there lay dragons ...
// https://json.nlohmann.me/home/faq/#brace-initialization-yields-arrays
explicit StickInfo(nlohmann::json map, PhysicalJoystickPtr stick = nullptr)
: mapping(map), joy{std::move(stick)} {}
: mapping(map), joy{std::move(stick)} {} // NOLINT
nlohmann::json mapping;
PhysicalJoystickPtr joy;
@ -92,7 +92,7 @@ class PhysicalJoystickHandler
void setDefaultMapping(Event::Type event, EventMode mode);
/** define mappings for current controllers */
void defineControllerMappings(const Controller::Type type, Controller::Jack port,
void defineControllerMappings(Controller::Type type, Controller::Jack port,
const Properties& properties,
Controller::Type qtType1 = Controller::Type::Unknown,
Controller::Type qtType2 = Controller::Type::Unknown);
@ -145,9 +145,9 @@ class PhysicalJoystickHandler
using StickDatabase = std::map<string, StickInfo, std::less<>>;
using StickList = std::map<int, PhysicalJoystickPtr>;
OSystem& myOSystem;
EventHandler& myHandler;
Event& myEvent;
OSystem& myOSystem; // NOLINT: we want a reference here
EventHandler& myHandler; // NOLINT: we want a reference here
Event& myEvent; // NOLINT: we want a reference here
// Contains all joysticks that Stella knows about, indexed by name
StickDatabase myDatabase;
@ -157,7 +157,7 @@ class PhysicalJoystickHandler
// Get joystick corresponding to given id (or nullptr if it doesn't exist)
// Make this inline so it's as fast as possible
const PhysicalJoystickPtr joy(int id) const {
PhysicalJoystickPtr joy(int id) const {
const auto& i = mySticks.find(id);
return i != mySticks.cend() ? i->second : nullptr;
}
@ -171,8 +171,10 @@ class PhysicalJoystickHandler
friend ostream& operator<<(ostream& os, const PhysicalJoystickHandler& jh);
JoyDir convertAxisValue(int value) const {
return value == int(JoyDir::NONE) ? JoyDir::NONE : value > 0 ? JoyDir::POS : JoyDir::NEG;
static constexpr JoyDir convertAxisValue(int value) {
return value == static_cast<int>(JoyDir::NONE)
? JoyDir::NONE
: value > 0 ? JoyDir::POS : JoyDir::NEG;
}
// Handle regular axis events (besides special Stelladaptor handling)
@ -196,23 +198,23 @@ class PhysicalJoystickHandler
bool updateDefaults = false);
/** return event mode for given property */
static EventMode getMode(const Properties& properties, const PropType propType);
static EventMode getMode(const Properties& properties, PropType propType);
/** return event mode for given controller type */
static EventMode getMode(const Controller::Type type);
static EventMode getMode(Controller::Type type);
/** returns the event's controller mode */
static EventMode getEventMode(const Event::Type event, const EventMode mode);
static EventMode getEventMode(Event::Type event, EventMode mode);
/** Checks event type. */
static bool isJoystickEvent(const Event::Type event);
static bool isPaddleEvent(const Event::Type event);
static bool isKeyboardEvent(const Event::Type event);
static bool isDrivingEvent(const Event::Type event);
static bool isCommonEvent(const Event::Type event);
static bool isJoystickEvent(Event::Type event);
static bool isPaddleEvent(Event::Type event);
static bool isKeyboardEvent(Event::Type event);
static bool isDrivingEvent(Event::Type event);
static bool isCommonEvent(Event::Type event);
void enableCommonMappings();
void enableMappings(const Event::EventSet& events, EventMode mode);
void enableMapping(const Event::Type event, EventMode mode);
void enableMapping(Event::Type event, EventMode mode);
private:
EventMode myLeftMode{EventMode::kEmulationMode};

View File

@ -36,7 +36,7 @@
*/
// This comes directly from SDL_scancode.h
enum StellaKey
enum StellaKey // NOLINT: use 32-bit, even though 16-bit is sufficient
{
KBDK_UNKNOWN = 0,
@ -393,7 +393,7 @@ enum StellaKey
};
// This comes directly from SDL_keycode.h
enum StellaMod
enum StellaMod: uInt16
{
KBDM_NONE = 0x0000,
KBDM_LSHIFT = 0x0001,

View File

@ -29,6 +29,7 @@
@author Stephen Anthony
*/
// NOLINTBEGIN: c'tors cannot be explicit here
class Variant
{
private:
@ -91,4 +92,5 @@ namespace VarList {
}
} // namespace VarList
// NOLINTEND
#endif

View File

@ -187,7 +187,7 @@ class ZipHandler
}
private:
const uInt8* const myBuf{nullptr};
const uInt8* const myBuf{nullptr}; // NOLINT: we want const here
};
class LocalFileHeaderReader : public ReaderBase

View File

@ -253,7 +253,7 @@ namespace BSPF
// starting from 'startpos' in the first string
static size_t findIgnoreCase(string_view s1, string_view s2, size_t startpos = 0)
{
const auto pos = std::search(s1.cbegin()+startpos, s1.cend(),
const auto pos = std::search(s1.cbegin()+startpos, s1.cend(), // NOLINT
s2.cbegin(), s2.cend(), [](char ch1, char ch2) {
return toupper(static_cast<uInt8>(ch1)) == toupper(static_cast<uInt8>(ch2));
});

View File

@ -18,6 +18,9 @@
#ifndef JSON_DEFINITIONS_HXX
#define JSON_DEFINITIONS_HXX
// NOLINTBEGIN: NLOHMANN_JSON_SERIALIZE_ENUM
// warning: use c++17 style variable templates [modernize-type-traits]
#include "EventHandlerConstants.hxx"
#include "Event.hxx"
#include "json_lib.hxx"
@ -769,4 +772,6 @@ NLOHMANN_JSON_SERIALIZE_ENUM(StellaMod, {
{StellaMod::KBDM_GUI, "gui"}
})
// NOLINTEND
#endif // JSON_DEFINITIONS_HXX

View File

@ -36,7 +36,7 @@ class KeyValueRepositoryFile : public KeyValueRepository {
protected:
const FSNode& myNode;
const FSNode& myNode; // NOLINT: we want a reference here
};
///////////////////////////////////////////////////////////////////////////////

View File

@ -1248,12 +1248,12 @@ void DebuggerParser::executeDump()
{
const auto dump = [&](ostream& os, int start, int end)
{
for(int i = start; i <= end; i += 16)
for(int i = start; i <= end; i += 16) // NOLINT (i is not a const)
{
// Print label every 16 bytes
os << Base::toString(i) << ": ";
for(int j = i; j < i+16 && j <= end; ++j)
for(int j = i; j < i+16 && j <= end; ++j) // NOLINT (j is not a const)
{
os << Base::toString(debugger.peek(j)) << " ";
if(j == i+7 && j != end) os << "- ";
@ -1291,7 +1291,7 @@ void DebuggerParser::executeDump()
return;
}
ostringstream path;
ostringstream path; // NOLINT (path is not a const)
path << debugger.myOSystem.userDir() << cartName() << "_dbg_";
if(execDepth > 0)
path << execPrefix;
@ -1302,7 +1302,7 @@ void DebuggerParser::executeDump()
commandResult << "dumped ";
stringstream out;
stringstream out; // NOLINT (out is not a const)
if((args[2] & 0x01) != 0)
{
// dump memory
@ -1381,6 +1381,7 @@ void DebuggerParser::executeDump()
if(OK)
{
const stringstream localOut(outStr);
// NOLINTNEXTLINE (localOut is not a const)
ostringstream localResult(resultStr, std::ios_base::app);
saveDump(node, localOut, localResult);
@ -2171,7 +2172,7 @@ void DebuggerParser::executeSaveRom()
// "saveSes"
void DebuggerParser::executeSaveSes()
{
ostringstream filename;
ostringstream filename; // NOLINT (filename is not a const)
auto timeinfo = BSPF::localTime();
filename << std::put_time(&timeinfo, "session_%F_%H-%M-%S.txt");
@ -2193,7 +2194,7 @@ void DebuggerParser::executeSaveSes()
}
else
{
ostringstream path;
ostringstream path; // NOLINT (path is not a const)
if(argCount)
path << argStrings[0];

View File

@ -24,7 +24,7 @@ AmigaMouseWidget::AmigaMouseWidget(GuiObject* boss, const GUI::Font& font,
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
uInt8 AmigaMouseWidget::getGrayCodeTable(const int index, const int) const
uInt8 AmigaMouseWidget::getGrayCodeTable(int index, int) const
{
return myGrayCodeTable[index];
}

View File

@ -31,9 +31,11 @@ class AmigaMouseWidget : public PointingDeviceWidget
~AmigaMouseWidget() override = default;
private:
const std::array<uInt8, 4> myGrayCodeTable = { 0b00, 0b10, 0b11, 0b01 };
static constexpr std::array<uInt8, 4> myGrayCodeTable = {
0b00, 0b10, 0b11, 0b01
};
uInt8 getGrayCodeTable(const int index, const int direction) const override;
uInt8 getGrayCodeTable(int index, int direction) const override;
// Following constructors and assignment operators not supported
AmigaMouseWidget() = delete;

View File

@ -24,7 +24,7 @@ AtariMouseWidget::AtariMouseWidget(GuiObject* boss, const GUI::Font& font,
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
uInt8 AtariMouseWidget::getGrayCodeTable(const int index, const int direction) const
uInt8 AtariMouseWidget::getGrayCodeTable(int index, int) const
{
return myGrayCodeTable[index];
}

View File

@ -30,9 +30,11 @@ class AtariMouseWidget : public PointingDeviceWidget
~AtariMouseWidget() override = default;
private:
const std::array<uInt8, 4> myGrayCodeTable = { 0b00, 0b01, 0b11, 0b10 };
static constexpr std::array<uInt8, 4> myGrayCodeTable = {
0b00, 0b01, 0b11, 0b10
};
uInt8 getGrayCodeTable(const int index, const int direction) const override;
uInt8 getGrayCodeTable(int index, int direction) const override;
// Following constructors and assignment operators not supported
AtariMouseWidget() = delete;

View File

@ -34,7 +34,7 @@ class AudioWidget : public Widget, public CommandSender
private:
// ID's for the various widgets
// We need ID's, since there are more than one of several types of widgets
enum {
enum: uInt8 {
kAUDFID,
kAUDCID,
kAUDVID
@ -48,7 +48,7 @@ class AudioWidget : public Widget, public CommandSender
StaticTextWidget* myAudEffV{nullptr};
// Audio channels
enum
enum: uInt8
{
kAud0Addr,
kAud1Addr

View File

@ -29,7 +29,9 @@ class BoosterWidget : public ControllerWidget
~BoosterWidget() override = default;
private:
enum { kJUp = 0, kJDown, kJLeft, kJRight, kJFire, kJBooster, kJTrigger };
enum: uInt8 {
kJUp = 0, kJDown, kJLeft, kJRight, kJFire, kJBooster, kJTrigger
};
std::array<CheckboxWidget*, 7> myPins{nullptr};
static constexpr std::array<Controller::DigitalPin, 5> ourPinNo = {{

View File

@ -39,7 +39,7 @@ CartDebugWidget::CartDebugWidget(GuiObject* boss, const GUI::Font& lfont,
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
int CartDebugWidget::addBaseInformation(size_t bytes, string_view manufacturer,
string_view desc, const uInt16 maxlines)
string_view desc, uInt16 maxlines)
{
const int lwidth = _font.getStringWidth("Manufacturer "),
fwidth = _w - lwidth - 12;

View File

@ -23,7 +23,7 @@ class StringListWidget;
namespace GUI {
class Font;
}
} // namespace GUI
#include "Base.hxx" // not needed here, but all child classes need it
#include "Command.hxx"
@ -39,7 +39,7 @@ class CartDebugWidget : public Widget, public CommandSender
public:
int addBaseInformation(size_t bytes, string_view manufacturer,
string_view desc, const uInt16 maxlines = 10);
string_view desc, uInt16 maxlines = 10);
// Inform the ROM Widget that the underlying cart has somehow changed
void invalidate();

View File

@ -25,7 +25,7 @@ class PopUpWidget;
namespace GUI {
class Font;
}
} // namespace GUI
#include "Variant.hxx"
#include "CartDebugWidget.hxx"

View File

@ -44,14 +44,14 @@ class CpuWidget : public Widget, public CommandSender
private:
// ID's for the various widgets
// We need ID's, since there are more than one of several types of widgets
enum {
enum: uInt8 {
kPCRegID,
kCpuRegID,
kCpuRegDecID,
kCpuRegBinID
};
enum {
enum: uInt8 {
kPCRegAddr,
kSPRegAddr,
kARegAddr,
@ -59,7 +59,7 @@ class CpuWidget : public Widget, public CommandSender
kYRegAddr
};
enum {
enum: uInt8 {
kPSRegN = 0,
kPSRegV = 1,
kPSRegB = 3,

View File

@ -78,7 +78,7 @@ class DataGridWidget : public EditableWidget
// Account for the extra width of embedded scrollbar
int getWidth() const override;
int colWidth() { return _colWidth; }
int colWidth() const { return _colWidth; }
void setOpsWidget(DataGridOpsWidget* w) { _opsWidget = w; }

View File

@ -38,10 +38,10 @@ class OptionsDialog;
namespace GUI {
class MessageBox;
}
} // namespace GUI
namespace Common {
struct Rect;
}
} // namespace Common
#include "Dialog.hxx"
@ -50,7 +50,7 @@ class DebuggerDialog : public Dialog
public:
// Note: these sizes make sure that all major tabs are fully visible
// cart dependend information (e.g. DPC+) may require more space
enum {
enum: uInt16 {
kSmallFontMinW = 1090, kSmallFontMinH = 720,
kMediumFontMinW = 1160, kMediumFontMinH = 770,
kLargeFontMinW = 1160, kLargeFontMinH = 870

View File

@ -29,7 +29,7 @@ class GenesisWidget : public ControllerWidget
~GenesisWidget() override = default;
private:
enum { kJUp = 0, kJDown, kJLeft, kJRight, kJBbtn, kJCbtn };
enum: uInt8 { kJUp = 0, kJDown, kJLeft, kJRight, kJBbtn, kJCbtn };
std::array<CheckboxWidget*, 6> myPins{nullptr};
static constexpr std::array<Controller::DigitalPin, 5> ourPinNo = {{

View File

@ -29,7 +29,7 @@ class Joy2BPlusWidget : public ControllerWidget
~Joy2BPlusWidget() override = default;
private:
enum { kJUp = 0, kJDown, kJLeft, kJRight, kJButtonB, kJButtonC, kJButton3 };
enum: uInt8 { kJUp = 0, kJDown, kJLeft, kJRight, kJButtonB, kJButtonC, kJButton3 };
std::array<CheckboxWidget*, 7> myPins{nullptr};
static constexpr std::array<Controller::DigitalPin, 5> ourPinNo = {{

View File

@ -29,7 +29,7 @@ class JoystickWidget : public ControllerWidget
~JoystickWidget() override = default;
private:
enum { kJUp = 0, kJDown, kJLeft, kJRight, kJFire };
enum: uInt8 { kJUp = 0, kJDown, kJLeft, kJRight, kJFire };
std::array<CheckboxWidget*, 5> myPins{nullptr};
static constexpr std::array<Controller::DigitalPin, 5> ourPinNo = {{

View File

@ -141,7 +141,7 @@ void PointingDeviceWidget::setGrayCodeV()
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void PointingDeviceWidget::setValue(DataGridWidget* grayValue,
const int index, const int direction)
int index, int direction)
{
const uInt8 grayCode = getGrayCodeTable(index, direction);

View File

@ -45,14 +45,14 @@ class PointingDeviceWidget : public ControllerWidget
CheckboxWidget* myFire{nullptr};
private:
virtual uInt8 getGrayCodeTable(const int index, const int direction) const = 0;
virtual uInt8 getGrayCodeTable(int index, int direction) const = 0;
void loadConfig() override;
void handleCommand(CommandSender* sender, int cmd, int data, int id) override;
void setGrayCodeH();
void setGrayCodeV();
void setValue(DataGridWidget* grayValue, const int index, const int direction);
void setValue(DataGridWidget* grayValue, int index, int direction);
// Following constructors and assignment operators not supported
PointingDeviceWidget() = delete;

View File

@ -100,7 +100,7 @@ class PromptWidget : public Widget, public CommandSender
void resetFunctions();
private:
enum {
enum: uInt16 {
kBufferSize = 32768,
kLineBufferSize = 256,
kHistorySize = 1000

View File

@ -75,7 +75,7 @@ class RiotWidget : public Widget, public CommandSender
// ID's for the various widgets
// We need ID's, since there are more than one of several types of widgets
enum {
enum: uInt8 {
kTim1TID, kTim8TID, kTim64TID, kTim1024TID, kTimWriteID,
kSWCHABitsID, kSWACNTBitsID, kSWCHBBitsID, kSWBCNTBitsID,
kP0DiffChanged, kP1DiffChanged, kTVTypeChanged, kSelectID, kResetID,

View File

@ -102,7 +102,7 @@ class TiaWidget : public Widget, public CommandSender
// ID's for the various widgets
// We need ID's, since there are more than one of several types of widgets
enum {
enum: uInt8 {
kP0_PFID, kP0_BLID, kP0_M1ID, kP0_M0ID, kP0_P1ID,
kP1_PFID, kP1_BLID, kP1_M1ID, kP1_M0ID,
kM0_PFID, kM0_BLID, kM0_M1ID,
@ -146,7 +146,7 @@ class TiaWidget : public Widget, public CommandSender
};
// Color registers
enum {
enum: uInt8 {
kCOLUP0Addr,
kCOLUP1Addr,
kCOLUPFAddr,

View File

@ -25,7 +25,7 @@ TrakBallWidget::TrakBallWidget(GuiObject* boss, const GUI::Font& font,
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
uInt8 TrakBallWidget::getGrayCodeTable(const int index, const int direction) const
uInt8 TrakBallWidget::getGrayCodeTable(int index, int direction) const
{
return myGrayCodeTable[(index & 0b1) + direction * 2];
}

View File

@ -31,9 +31,11 @@ class TrakBallWidget : public PointingDeviceWidget
~TrakBallWidget() override = default;
private:
const std::array<uInt8, 4> myGrayCodeTable = { 0b00, 0b10, 0b01, 0b11 };
static constexpr std::array<uInt8, 4> myGrayCodeTable = {
0b00, 0b10, 0b01, 0b11
};
uInt8 getGrayCodeTable(const int index, const int direction) const override;
uInt8 getGrayCodeTable(int index, int direction) const override;
// Following constructors and assignment operators not supported
TrakBallWidget() = delete;

View File

@ -40,6 +40,6 @@ namespace YaccParser
CpuMethod getCpuSpecial(const char* ch);
RiotMethod getRiotSpecial(const char* ch);
TiaMethod getTiaSpecial(const char* ch);
}
} // namespace YaccParser
#endif

View File

@ -37,7 +37,7 @@ class Bankswitch
{
public:
// Currently supported bankswitch schemes
enum class Type {
enum class Type: uInt8 {
_AUTO, _03E0, _0840, _0FA0, _2IN1, _4IN1, _8IN1, _16IN1,
_32IN1, _64IN1, _128IN1, _2K, _3E, _3EX, _3EP, _3F,
_4A50, _4K, _4KSC, _AR, _BF, _BFSC, _BUS, _CDF,
@ -60,7 +60,7 @@ class Bankswitch
static constexpr size_t any_KB = 0;
static const std::array<SizesType,
static_cast<uInt32>(Type::NumSchemes)> Sizes;
static_cast<uInt8>(Type::NumSchemes)> Sizes;
// Info about the various bankswitch schemes, useful for displaying
// in GUI dropdown boxes, etc
@ -69,7 +69,7 @@ class Bankswitch
string_view desc;
};
static const std::array<Description,
static_cast<uInt32>(Type::NumSchemes)> BSList;
static_cast<uInt8>(Type::NumSchemes)> BSList;
public:
// Convert BSType enum to string
@ -96,14 +96,14 @@ class Bankswitch
/**
Convenience functions for different parameter types.
*/
static inline bool isValidRomName(const FSNode& name, string& ext) {
static bool isValidRomName(const FSNode& name, string& ext) {
return isValidRomName(name.getPath(), ext);
}
static inline bool isValidRomName(const FSNode& name) {
static bool isValidRomName(const FSNode& name) {
string ext; // extension not used
return isValidRomName(name.getPath(), ext);
}
static inline bool isValidRomName(string_view name) {
static bool isValidRomName(string_view name) {
string ext; // extension not used
return isValidRomName(name, ext);
}
@ -130,6 +130,7 @@ class Bankswitch
private:
// Following constructors and assignment operators not supported
Bankswitch() = delete;
~Bankswitch() = delete;
Bankswitch(const Bankswitch&) = delete;
Bankswitch(Bankswitch&&) = delete;
Bankswitch& operator=(const Bankswitch&) = delete;

View File

@ -32,7 +32,7 @@ class Settings;
#ifdef DEBUGGER_SUPPORT
namespace GUI {
class Font;
}
} // namespace GUI
#endif
/**
@ -167,8 +167,8 @@ class Cartridge : public Device
@return Address of illegal access if one occurred, else 0
*/
inline uInt16 getIllegalRAMReadAccess() const {
return myRamReadAccesses.size() > 0 ? myRamReadAccesses[0] : 0;
uInt16 getIllegalRAMReadAccess() const {
return !myRamReadAccesses.empty() ? myRamReadAccesses[0] : 0;
}
/**
@ -178,7 +178,9 @@ class Cartridge : public Device
@return Address of illegal access if one occurred, else 0
*/
inline uInt16 getIllegalRAMWriteAccess() const { return myRamWriteAccess; }
uInt16 getIllegalRAMWriteAccess() const {
return myRamWriteAccess;
}
/**
Query the access counters

View File

@ -176,43 +176,37 @@ class Cartridge4A50 : public Cartridge
/**
Methods to perform all the ways that banks can be switched
*/
inline void bankROMLower(uInt16 value)
{
void bankROMLower(uInt16 value) {
myIsRomLow = true;
mySliceLow = value << 11;
myBankChanged = true;
}
inline void bankRAMLower(uInt16 value)
{
void bankRAMLower(uInt16 value) {
myIsRomLow = false;
mySliceLow = value << 11;
myBankChanged = true;
}
inline void bankROMMiddle(uInt16 value)
{
void bankROMMiddle(uInt16 value) {
myIsRomMiddle = true;
mySliceMiddle = value << 11;
myBankChanged = true;
}
inline void bankRAMMiddle(uInt16 value)
{
void bankRAMMiddle(uInt16 value) {
myIsRomMiddle = false;
mySliceMiddle = value << 11;
myBankChanged = true;
}
inline void bankROMHigh(uInt16 value)
{
void bankROMHigh(uInt16 value) {
myIsRomHigh = true;
mySliceHigh = value << 8;
myBankChanged = true;
}
inline void bankRAMHigh(uInt16 value)
{
void bankRAMHigh(uInt16 value) {
myIsRomHigh = false;
mySliceHigh = value << 8;
myBankChanged = true;

View File

@ -42,7 +42,7 @@ class CartridgeBUS : public CartridgeARM
friend class CartridgeBUSInfoWidget;
friend class CartridgeRamBUSWidget;
enum class BUSSubtype {
enum class BUSSubtype: uInt8 {
BUS0, // very old demos when BUS was in flux, not supported in Stella
BUS1, // draconian_20161102.bin
BUS2, // 128bus_20170120.bin, 128chronocolour_20170101.bin, parrot_20161231_NTSC.bin

View File

@ -66,7 +66,7 @@ class CartridgeCDF : public CartridgeARM
public:
enum class CDFSubtype {
enum class CDFSubtype: uInt8 {
CDF0,
CDF1,
CDFJ,

View File

@ -86,6 +86,7 @@ class CartCreator
private:
// Following constructors and assignment operators not supported
CartCreator() = delete;
~CartCreator() = delete;
CartCreator(const CartCreator&) = delete;
CartCreator(CartCreator&&) = delete;
CartCreator& operator=(const CartCreator&) = delete;

View File

@ -259,6 +259,7 @@ class CartDetector
private:
// Following constructors and assignment operators not supported
CartDetector() = delete;
~CartDetector() = delete;
CartDetector(const CartDetector&) = delete;
CartDetector(CartDetector&&) = delete;
CartDetector& operator=(const CartDetector&) = delete;

View File

@ -542,7 +542,7 @@ void CartridgeELF::runArm()
)
return;
const uInt32 cyclesGoal = static_cast<uInt32>(
const auto cyclesGoal = static_cast<uInt32>(
(mySystem->cycles() + ARM_RUNAHED_MAX) * myArmCyclesPer6502Cycle - getArmCycles());
uInt32 cycles = 0;

View File

@ -52,6 +52,7 @@ class CompuMate
@param system The system using this controller
*/
CompuMate(const Console& console, const Event& event, const System& system);
~CompuMate() = default;
/**
Return the left and right CompuMate controllers

View File

@ -968,11 +968,12 @@ void Console::setControllers(string_view romMd5)
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void Console::changeLeftController(int direction)
{
int type = static_cast<int>(Controller::getType(myProperties.get(PropType::Controller_Left)));
auto type =
static_cast<uInt8>(Controller::getType(myProperties.get(PropType::Controller_Left)));
if(!type)
type = static_cast<int>(Controller::getType(leftController().name()));
type = static_cast<uInt8>(Controller::getType(leftController().name()));
type = BSPF::clampw(type + direction,
1, static_cast<int>(Controller::Type::LastType) - 1);
1, static_cast<uInt8>(Controller::Type::LastType) - 1);
myProperties.set(PropType::Controller_Left, Controller::getPropName(Controller::Type{type}));
setControllers(myProperties.get(PropType::Cart_MD5));
@ -985,11 +986,12 @@ void Console::changeLeftController(int direction)
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void Console::changeRightController(int direction)
{
int type = static_cast<int>(Controller::getType(myProperties.get(PropType::Controller_Right)));
auto type =
static_cast<uInt8>(Controller::getType(myProperties.get(PropType::Controller_Right)));
if(!type)
type = static_cast<int>(Controller::getType(rightController().name()));
type = static_cast<uInt8>(Controller::getType(rightController().name()));
type = BSPF::clampw(type + direction,
1, static_cast<int>(Controller::Type::LastType) - 1);
1, static_cast<uInt8>(Controller::Type::LastType) - 1);
myProperties.set(PropType::Controller_Right, Controller::getPropName(Controller::Type{type}));
setControllers(myProperties.get(PropType::Cart_MD5));
@ -1001,7 +1003,7 @@ void Console::changeRightController(int direction)
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
unique_ptr<Controller> Console::getControllerPort(
const Controller::Type type, const Controller::Jack port, string_view romMd5)
Controller::Type type, Controller::Jack port, string_view romMd5)
{
unique_ptr<Controller> controller;

View File

@ -428,8 +428,8 @@ class Console : public Serializable, public ConsoleIO
/**
Selects the left or right controller depending on ROM properties
*/
unique_ptr<Controller> getControllerPort(const Controller::Type type,
const Controller::Jack port,
unique_ptr<Controller> getControllerPort(Controller::Type type,
Controller::Jack port,
string_view romMd5);
void toggleTIABit(TIABit bit, string_view bitname,

View File

@ -21,7 +21,7 @@
/**
Contains timing information about the specified console.
*/
enum class ConsoleTiming
enum class ConsoleTiming: uInt8
{
ntsc, // console with CPU running at 1.193182 MHz, NTSC colours
pal, // console with CPU running at 1.182298 MHz, PAL colours

View File

@ -136,7 +136,7 @@ string Controller::getPropName(const Type type)
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Controller::Type Controller::getType(string_view propName)
{
for(int i = 0; i < static_cast<int>(Type::LastType); ++i)
for(uInt8 i = 0; i < static_cast<uInt8>(Type::LastType); ++i)
if (BSPF::equalsIgnoreCase(propName, getPropName(Type{i})))
return Type{i};

View File

@ -81,22 +81,22 @@ class Controller : public Serializable
/**
Enumeration of the controller jacks
*/
enum class Jack { Left = 0, Right = 1, Left2 = 2, Right2 = 3 };
enum class Jack: uInt8 { Left = 0, Right = 1, Left2 = 2, Right2 = 3 };
/**
Enumeration of the digital pins of a controller port
*/
enum class DigitalPin { One, Two, Three, Four, Six };
enum class DigitalPin: uInt8 { One, Two, Three, Four, Six };
/**
Enumeration of the analog pins of a controller port
*/
enum class AnalogPin { Five, Nine };
enum class AnalogPin: uInt8 { Five, Nine };
/**
Enumeration of the controller types
*/
enum class Type
enum class Type: uInt8
{
Unknown,
AmigaMouse, AtariMouse, AtariVox, BoosterGrip, CompuMate,
@ -269,12 +269,12 @@ class Controller : public Serializable
/**
Returns the display name of the given controller type
*/
static string getName(const Type type);
static string getName(Type type);
/**
Returns the property name of the given controller type
*/
static string getPropName(const Type type);
static string getPropName(Type type);
/**
Returns the controller type of the given property name
@ -305,9 +305,8 @@ class Controller : public Serializable
*/
static int analogDeadZoneValue(int deadZone);
inline static int digitalDeadZone() { return DIGITAL_DEAD_ZONE; }
inline static int analogDeadZone() { return ANALOG_DEAD_ZONE; }
static int digitalDeadZone() { return DIGITAL_DEAD_ZONE; }
static int analogDeadZone() { return ANALOG_DEAD_ZONE; }
/**
Sets the sensitivity for analog emulation movement
@ -338,28 +337,28 @@ class Controller : public Serializable
Derived classes *must* use these accessor/mutator methods.
The read/write methods above are meant to be used at a higher level.
*/
inline bool setPin(DigitalPin pin, bool value) {
bool setPin(DigitalPin pin, bool value) {
return myDigitalPinState[static_cast<int>(pin)] = value;
}
inline bool getPin(DigitalPin pin) const {
bool getPin(DigitalPin pin) const {
return myDigitalPinState[static_cast<int>(pin)];
}
inline void setPin(AnalogPin pin, AnalogReadout::Connection value) {
void setPin(AnalogPin pin, AnalogReadout::Connection value) {
myAnalogPinValue[static_cast<int>(pin)] = value;
if(myOnAnalogPinUpdateCallback)
myOnAnalogPinUpdateCallback(pin);
}
inline AnalogReadout::Connection getPin(AnalogPin pin) const {
AnalogReadout::Connection getPin(AnalogPin pin) const {
return myAnalogPinValue[static_cast<int>(pin)];
}
inline void resetDigitalPins() {
void resetDigitalPins() {
setPin(DigitalPin::One, true);
setPin(DigitalPin::Two, true);
setPin(DigitalPin::Three, true);
setPin(DigitalPin::Four, true);
setPin(DigitalPin::Six, true);
}
inline void resetAnalogPins() {
void resetAnalogPins() {
setPin(AnalogPin::Five, AnalogReadout::disconnect());
setPin(AnalogPin::Nine, AnalogReadout::disconnect());
}
@ -370,7 +369,7 @@ class Controller : public Serializable
@param pressed True if the fire button is currently pressed
@return The result of the auto fire event check
*/
inline bool getAutoFireState(bool pressed)
bool getAutoFireState(bool pressed)
{
if(AUTO_FIRE && AUTO_FIRE_RATE && pressed)
{
@ -389,7 +388,7 @@ class Controller : public Serializable
@param pressed True if the fire button is current pressed
@return The result of the auto fire event check
*/
inline bool getAutoFireStateP1(bool pressed)
bool getAutoFireStateP1(bool pressed)
{
if(AUTO_FIRE && AUTO_FIRE_RATE && pressed)
{

View File

@ -38,26 +38,26 @@ class ControllerLowLevel
: myController(controller) { }
virtual ~ControllerLowLevel() = default;
inline bool setPin(Controller::DigitalPin pin, bool value) {
bool setPin(Controller::DigitalPin pin, bool value) {
return myController.setPin(pin, value);
}
inline bool togglePin(Controller::DigitalPin pin) { return false; }
inline bool getPin(Controller::DigitalPin pin) const {
bool togglePin(Controller::DigitalPin pin) { return false; } // NOLINT (is this required?)
bool getPin(Controller::DigitalPin pin) const {
return myController.getPin(pin);
}
inline void setPin(Controller::AnalogPin pin, AnalogReadout::Connection value) {
void setPin(Controller::AnalogPin pin, AnalogReadout::Connection value) {
myController.setPin(pin, value);
}
inline AnalogReadout::Connection getPin(Controller::AnalogPin pin) const {
AnalogReadout::Connection getPin(Controller::AnalogPin pin) const {
return myController.getPin(pin);
}
inline void resetDigitalPins() {
void resetDigitalPins() {
myController.resetDigitalPins();
}
inline void resetAnalogPins() {
void resetAnalogPins() {
myController.resetAnalogPins();
}
inline Controller& controller() const { return myController; }
Controller& controller() const { return myController; }
protected:
Controller& myController;

View File

@ -23,7 +23,7 @@
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Controller::Type ControllerDetector::detectType(
const ByteBuffer& image, size_t size,
const Controller::Type type, const Controller::Jack port,
Controller::Type type, Controller::Jack port,
const Settings& settings, bool isQuadTari)
{
if(type == Controller::Type::Unknown || settings.getBool("rominfo"))
@ -46,7 +46,7 @@ Controller::Type ControllerDetector::detectType(
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
string ControllerDetector::detectName(const ByteBuffer& image, size_t size,
const Controller::Type type, const Controller::Jack port,
Controller::Type type, Controller::Jack port,
const Settings& settings, bool isQuadTari)
{
return Controller::getName(detectType(image, size, type, port, settings, isQuadTari));

View File

@ -43,7 +43,7 @@ class ControllerDetector
@return The detected controller type
*/
static Controller::Type detectType(const ByteBuffer& image, size_t size,
const Controller::Type type, const Controller::Jack port,
Controller::Type type, Controller::Jack port,
const Settings& settings, bool isQuadTari = false);
/**
@ -60,7 +60,7 @@ class ControllerDetector
@return The (detected) controller name
*/
static string detectName(const ByteBuffer& image, size_t size,
const Controller::Type type, const Controller::Jack port,
Controller::Type type, Controller::Jack port,
const Settings& settings, bool isQuadTari = false);
private:
@ -137,6 +137,7 @@ class ControllerDetector
private:
// Following constructors and assignment operators not supported
ControllerDetector() = delete;
~ControllerDetector() = delete;
ControllerDetector(const ControllerDetector&) = delete;
ControllerDetector(ControllerDetector&&) = delete;
ControllerDetector& operator=(const ControllerDetector&) = delete;

View File

@ -25,6 +25,8 @@
regenerated and the application recompiled.
*/
// NOLINTBEGIN: static analyzer can't tell the following is data
static constexpr uInt32 DEF_PROPS_SIZE = 3661;
/**
@ -3698,4 +3700,6 @@ static constexpr BSPF::array2D<const char*, DEF_PROPS_SIZE, 30> DefProps = {{
{ "ffebb0070689b9d322687edd9c0a2bae", "", "", "Spitfire Attack (1983) (Milton Bradley) [h1]", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "" }
}};
// NOLINTEND
#endif

View File

@ -33,7 +33,7 @@ class System;
class Device : public Serializable
{
public:
enum AccessType {
enum AccessType: uInt16 {
NONE = 0,
REFERENCED = 1 << 0, /* 0x01, code somewhere in the program references it,
i.e. LDA $F372 referenced $F372 */
@ -102,7 +102,7 @@ class Device : public Serializable
@param out The Serializer object to use
@return False on any errors, else true
*/
virtual bool save(Serializer& out) const override = 0;
bool save(Serializer& out) const override = 0;
/**
Load the current state of this device from the given Serializer.
@ -110,7 +110,7 @@ class Device : public Serializable
@param in The Serializer object to use
@return False on any errors, else true
*/
virtual bool load(Serializer& in) override = 0;
bool load(Serializer& in) override = 0;
public:
/**

View File

@ -23,7 +23,7 @@
class DispatchResult
{
public:
enum class Status { invalid, ok, debugger, fatal };
enum class Status: uInt8 { invalid, ok, debugger, fatal };
public:

View File

@ -25,8 +25,9 @@
class EmulationTiming {
public:
EmulationTiming(FrameLayout frameLayout = FrameLayout::ntsc,
ConsoleTiming consoleTiming = ConsoleTiming::ntsc);
explicit EmulationTiming(FrameLayout frameLayout = FrameLayout::ntsc,
ConsoleTiming consoleTiming = ConsoleTiming::ntsc);
~EmulationTiming() = default;
EmulationTiming& updateFrameLayout(FrameLayout frameLayout);

View File

@ -134,7 +134,7 @@ class EmulationWorker
/**
Thread state.
*/
enum class State {
enum class State: uInt8 {
// Initial state
initializing,
// Thread has initialized. From the point, myThreadIsRunningMutex is locked if and only if
@ -153,7 +153,7 @@ class EmulationWorker
/**
Thread behavior is controlled by signals that are raised prior to waking up the thread.
*/
enum class Signal {
enum class Signal: uInt8 {
// Resume emulation
resume,
// Stop emulation

View File

@ -34,7 +34,7 @@ class Event
console and controller event types as well as events that aren't
technically part of the emulation core.
*/
enum Type
enum Type: uInt16
{
NoType = 0,
ConsoleColor, ConsoleBlackWhite, ConsoleColorToggle, Console7800Pause,
@ -182,7 +182,7 @@ class Event
};
// Event categorizing groups
enum Group
enum Group: uInt8
{
Menu, Emulation,
Misc, AudioVideo, States, Console, Joystick, Paddles, Driving, Keyboard,
@ -201,13 +201,14 @@ class Event
Create a new event object.
*/
Event() { clear(); }
~Event() = default;
public:
/**
Get the value associated with the event of the specified type.
*/
Int32 get(Type type) const {
std::lock_guard<std::mutex> lock(myMutex);
const std::lock_guard<std::mutex> lock(myMutex);
return myValues[type];
}
@ -216,7 +217,7 @@ class Event
Set the value associated with the event of the specified type.
*/
void set(Type type, Int32 value) {
std::lock_guard<std::mutex> lock(myMutex);
const std::lock_guard<std::mutex> lock(myMutex);
myValues[type] = value;
}
@ -226,7 +227,7 @@ class Event
*/
void clear()
{
std::lock_guard<std::mutex> lock(myMutex);
const std::lock_guard<std::mutex> lock(myMutex);
myValues.fill(Event::NoType);
}

View File

@ -30,7 +30,7 @@ class GlobalKeyHandler;
namespace GUI {
class Font;
}
} // namespace GUI
#include "Event.hxx"
#include "EventHandlerConstants.hxx"
@ -59,7 +59,7 @@ class EventHandler
/**
Create a new event handler object
*/
EventHandler(OSystem& osystem);
explicit EventHandler(OSystem& osystem);
virtual ~EventHandler();
/**
@ -428,7 +428,7 @@ class EventHandler
virtual void pollEvent() = 0;
// Other events that can be received from the underlying event handler
enum class SystemEvent {
enum class SystemEvent: uInt8 {
WINDOW_SHOWN,
WINDOW_HIDDEN,
WINDOW_EXPOSED,

View File

@ -21,7 +21,7 @@
#include <string>
// Enumeration representing the different states of operation
enum class EventHandlerState {
enum class EventHandlerState: uInt8 {
EMULATION,
TIMEMACHINE,
PLAYBACK,
@ -36,7 +36,7 @@ enum class EventHandlerState {
NONE
};
enum class MouseButton {
enum class MouseButton: uInt8 {
LEFT,
RIGHT,
MIDDLE,
@ -47,7 +47,7 @@ enum class MouseButton {
static constexpr int JOY_CTRL_NONE = -1;
enum class JoyAxis {
enum class JoyAxis: Int8 {
X = 0, // make sure these are set correctly,
Y = 1, // since they'll be used as array indices
Z = 2,
@ -55,14 +55,14 @@ enum class JoyAxis {
NONE = JOY_CTRL_NONE
};
enum class JoyDir {
enum class JoyDir: Int8 {
NEG = -1,
POS = 1,
NONE = 0,
ANALOG = 2
};
enum class JoyHatDir {
enum class JoyHatDir: uInt8 {
UP = 0, // make sure these are set correctly,
DOWN = 1, // since they'll be used as array indices
LEFT = 2,
@ -70,7 +70,7 @@ enum class JoyHatDir {
CENTER = 4
};
enum JoyHatMask {
enum JoyHatMask: uInt8 {
EVENT_HATUP_M = 1<<0,
EVENT_HATDOWN_M = 1<<1,
EVENT_HATLEFT_M = 1<<2,
@ -78,7 +78,7 @@ enum JoyHatMask {
EVENT_HATCENTER_M = 1<<4
};
enum class EventMode {
enum class EventMode: uInt8 {
kEmulationMode, // active mapping used for emulation
kMenuMode, // mapping used for dialogs
kJoystickMode, // 5 extra modes for mapping controller keys separately for emulation mode
@ -92,8 +92,7 @@ enum class EventMode {
kNumModes
};
namespace GUI
{
namespace GUI {
#ifdef RETRON77
static const std::string SELECT = "Mode";
static const std::string LEFT_DIFFICULTY = "P1 skill";
@ -107,6 +106,6 @@ namespace GUI
static const std::string LEFT_DIFF = "Left Diff";
static const std::string RIGHT_DIFF = "Right Diff";
#endif
}
} // namespace GUI
#endif // EVENTHANDLER_CONSTANTS_HXX

View File

@ -450,7 +450,7 @@ int FBSurface::drawString(const GUI::Font& font, string_view s,
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
bool FBSurface::checkBounds(const uInt32 x, const uInt32 y) const
bool FBSurface::checkBounds(uInt32 x, uInt32 y) const
{
if (x <= width() && y <= height())
return true;

View File

@ -23,10 +23,10 @@ class TIASurface;
namespace GUI {
class Font;
}
} // namespace GUI
namespace Common {
struct Rect;
}
} // namespace Common
#include "FrameBufferConstants.hxx"
#include "FrameBuffer.hxx"
@ -55,8 +55,7 @@ class FBSurface
This method returns the surface pixel pointer and pitch, which are
used when one wishes to modify the surface pixels directly.
*/
inline void basePtr(uInt32*& pixels, uInt32& pitch) const
{
void basePtr(uInt32*& pixels, uInt32& pitch) const {
pixels = myPixels;
pitch = myPitch;
}
@ -403,14 +402,14 @@ class FBSurface
@param y The y coordinate to check
@return True if coordinates are in bounds
*/
bool checkBounds(const uInt32 x, const uInt32 y) const;
bool checkBounds(uInt32 x, uInt32 y) const;
/**
Check if the given character is a whitespace.
@param c Character to check
@return True if whitespace character
*/
static bool isWhiteSpace(const char c) {
static bool isWhiteSpace(char c) {
static constexpr string_view spaces{" ,.;:+-*/\\'([\n"};
return spaces.find(c) != string_view::npos;
}

View File

@ -59,7 +59,7 @@ class FSNode
/**
* Flag to tell listDir() which kind of files to list.
*/
enum class ListMode { FilesOnly, DirectoriesOnly, All };
enum class ListMode: uInt8 { FilesOnly, DirectoriesOnly, All };
/** Function used to filter the file listing. Returns true if the filename
should be included, else false.*/
@ -97,8 +97,7 @@ class FSNode
* Compare the name of this node to the name of another, testing for
* equality.
*/
inline bool operator==(const FSNode& node) const
{
bool operator==(const FSNode& node) const {
return BSPF::compareIgnoreCase(getName(), node.getName()) == 0;
}

View File

@ -56,7 +56,7 @@ class FrameBuffer
// Zoom level step interval
static constexpr double ZOOM_STEPS = 0.25;
enum UpdateMode {
enum UpdateMode: uInt8 {
NONE = 0,
REDRAW = 1,
RERENDER = 2

View File

@ -25,31 +25,31 @@
namespace FBMinimum {
static constexpr uInt32 Width = TIAConstants::viewableWidth * 2;
static constexpr uInt32 Height = TIAConstants::viewableHeight * 2;
}
} // namespace FBMinimum
// Return values for initialization of framebuffer window
enum class FBInitStatus {
enum class FBInitStatus: uInt8 {
Success,
FailComplete,
FailTooLarge,
FailNotSupported
};
enum class BufferType {
enum class BufferType: uInt8 {
None,
Launcher,
Emulator,
Debugger
};
enum class ScalingInterpolation {
enum class ScalingInterpolation: uInt8 {
none,
sharp,
blur
};
// Positions for onscreen/overlaid messages
enum class MessagePosition {
enum class MessagePosition: uInt8 {
TopLeft,
TopCenter,
TopRight,
@ -120,14 +120,14 @@ using UIPaletteArray = std::array<uInt32, kNumColors-kColor>;
using FullPaletteArray = std::array<uInt32, kNumColors>;
// Text alignment modes for drawString()
enum class TextAlign {
enum class TextAlign: uInt8 {
Left,
Center,
Right
};
// Line types for drawing rectangular frames
enum class FrameStyle {
enum class FrameStyle: uInt8 {
Solid,
Dashed
};

View File

@ -34,7 +34,7 @@ GlobalKeyHandler::GlobalKeyHandler(OSystem& osystem)
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
bool GlobalKeyHandler::handleEvent(const Event::Type event, bool pressed, bool repeated)
bool GlobalKeyHandler::handleEvent(Event::Type event, bool pressed, bool repeated)
{
// The global settings keys change settings or values as long as the setting
// message from the previous settings event is still displayed.
@ -136,7 +136,7 @@ bool GlobalKeyHandler::handleEvent(const Event::Type event, bool pressed, bool r
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void GlobalKeyHandler::setSetting(const Setting setting)
void GlobalKeyHandler::setSetting(Setting setting)
{
if(setting == Setting::ZOOM && myOSystem.frameBuffer().fullScreen())
mySetting = Setting::FS_ASPECT;
@ -146,7 +146,7 @@ void GlobalKeyHandler::setSetting(const Setting setting)
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void GlobalKeyHandler::setDirectSetting(const Setting setting)
void GlobalKeyHandler::setDirectSetting(Setting setting)
{
myDirectSetting = setting;
}
@ -331,7 +331,7 @@ GlobalKeyHandler::Function GlobalKeyHandler::cycleSetting(int direction)
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
GlobalKeyHandler::SettingData GlobalKeyHandler::getSettingData(const Setting setting) const
GlobalKeyHandler::SettingData GlobalKeyHandler::getSettingData(Setting setting) const
{
// Notes:
// - all setting methods MUST always display a message

View File

@ -29,9 +29,10 @@ class GlobalKeyHandler
{
public:
explicit GlobalKeyHandler(OSystem& osystem);
~GlobalKeyHandler() = default;
public:
enum class Setting
enum class Setting: Int8
{
NONE = -1,
// *** Audio & Video group ***
@ -138,14 +139,14 @@ class GlobalKeyHandler
};
public:
bool handleEvent(const Event::Type event, bool pressed, bool repeated);
void setSetting(const Setting setting);
void setDirectSetting(const Setting setting);
bool handleEvent(Event::Type event, bool pressed, bool repeated);
void setSetting(Setting setting);
void setDirectSetting(Setting setting);
private:
using Function = std::function<void(int)>;
enum class Group
enum class Group: uInt8
{
AV,
INPUT,
@ -171,7 +172,7 @@ class GlobalKeyHandler
// Cycle settings using given direction (can be 0)
Function cycleSetting(int direction);
// Get adjustment function and if it is repeated
SettingData getSettingData(const Setting setting) const;
SettingData getSettingData(Setting setting) const;
PhysicalJoystickHandler& joyHandler() const {
return myOSystem.eventHandler().joyHandler();

View File

@ -63,7 +63,7 @@ class Keyboard : public Controller
string name() const override { return "Keyboard"; }
private:
enum class ColumnState {
enum class ColumnState: uInt8 {
vcc, gnd, notConnected
};

View File

@ -102,7 +102,7 @@ class KidVid : public Controller
void setNextSong();
private:
enum class Game {
enum class Game: uInt8 {
Smurfs,
BBears
};

View File

@ -250,11 +250,14 @@ class M6532 : public Device
std::array<Device::AccessFlags, IO_SIZE> myIOAccessBase;
// The arrays containing information about every byte of RIOT
// indicating how often it is accessed.
std::array<Device::AccessCounter, RAM_SIZE * 2> myRAMAccessCounter;
std::array<Device::AccessCounter, STACK_SIZE * 2> myStackAccessCounter;
std::array<Device::AccessCounter, IO_SIZE * 2> myIOAccessCounter;
std::array<Device::AccessCounter,
static_cast<size_t>(RAM_SIZE * 2)> myRAMAccessCounter;
std::array<Device::AccessCounter,
static_cast<size_t>(STACK_SIZE * 2)> myStackAccessCounter;
std::array<Device::AccessCounter,
static_cast<size_t>(IO_SIZE * 2)> myIOAccessCounter;
// The array used to skip the first ZP access tracking
std::array<uInt8, RAM_SIZE> myZPAccessDelay;
std::array<uInt8, RAM_SIZE> myZPAccessDelay;
// Detect timer being accessed on wraparound
bool myTimWrappedOnRead{false};

View File

@ -60,7 +60,7 @@ void MD5::init()
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
// Decodes input (uInt8) into output (uInt32).
// Assumes len is a multiple of 4.
void MD5::decode(uInt32* output, const uInt8* const input, uInt32 len)
void MD5::decode(uInt32* output, const uInt8* input, uInt32 len)
{
for (uInt32 i = 0, j = 0; j < len; ++i, j += 4)
output[i] = (static_cast<uInt32>(input[j]))
@ -72,7 +72,7 @@ void MD5::decode(uInt32* output, const uInt8* const input, uInt32 len)
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
// Encodes input (uInt32) into output (uInt8).
// Assumes len is a multiple of 4.
void MD5::encode(uInt8* output, const uInt32* const input, uInt32 len)
void MD5::encode(uInt8* output, const uInt32* input, uInt32 len)
{
for (uInt32 i = 0, j = 0; j < len; ++i, j += 4) {
output[j] = static_cast<uInt8>(input[i] & 0xff);
@ -84,7 +84,7 @@ void MD5::encode(uInt8* output, const uInt32* const input, uInt32 len)
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
// Apply MD5 algo on a block.
void MD5::transform(const uInt8* const block)
void MD5::transform(const uInt8* block)
{
std::array<uInt32, 16> x;
decode(x.data(), block, BLOCKSIZE);
@ -175,7 +175,7 @@ void MD5::transform(const uInt8* const block)
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
// MD5 block update operation.
// Continues an MD5 message-digest operation, processing another message block.
void MD5::update(const uInt8* const input, uInt32 length)
void MD5::update(const uInt8* input, uInt32 length)
{
// Compute number of bytes mod 64
auto index = count[0] / 8 % BLOCKSIZE;

View File

@ -72,54 +72,55 @@ class MD5
public:
MD5() = default;
~MD5() = default;
private:
void init();
void update(const uInt8* const input, uInt32 length);
void update(const uInt8* input, uInt32 length);
void finalize();
string hexdigest() const;
void transform(const uInt8* block);
static void decode(uInt32* output, const uInt8* const input, uInt32 len);
static void encode(uInt8* output, const uInt32* const input, uInt32 len);
static void decode(uInt32* output, const uInt8* input, uInt32 len);
static void encode(uInt8* output, const uInt32* input, uInt32 len);
// F, G, H and I are basic MD5 functions.
FORCE_INLINE constexpr uInt32 F(uInt32 x, uInt32 y, uInt32 z) {
static constexpr uInt32 F(uInt32 x, uInt32 y, uInt32 z) {
return (x&y) | (~x&z);
}
FORCE_INLINE constexpr uInt32 G(uInt32 x, uInt32 y, uInt32 z) {
static constexpr uInt32 G(uInt32 x, uInt32 y, uInt32 z) {
return (x&z) | (y&~z);
}
FORCE_INLINE constexpr uInt32 H(uInt32 x, uInt32 y, uInt32 z) {
static constexpr uInt32 H(uInt32 x, uInt32 y, uInt32 z) {
return x^y^z;
}
FORCE_INLINE constexpr uInt32 I(uInt32 x, uInt32 y, uInt32 z) {
static constexpr uInt32 I(uInt32 x, uInt32 y, uInt32 z) {
return y ^ (x | ~z);
}
// rotate_left rotates x left n bits.
FORCE_INLINE constexpr uInt32 rotate_left(uInt32 x, int n) {
static constexpr uInt32 rotate_left(uInt32 x, int n) {
return (x << n) | (x >> (32-n));
}
// FF, GG, HH, and II transformations for rounds 1, 2, 3, and 4.
// Rotation is separate from addition to prevent recomputation.
FORCE_INLINE constexpr void FF(uInt32 &a, uInt32 b, uInt32 c,
uInt32 d, uInt32 x, uInt32 s, uInt32 ac) {
static constexpr void FF(uInt32 &a, uInt32 b, uInt32 c,
uInt32 d, uInt32 x, uInt32 s, uInt32 ac) {
a = rotate_left(a+ F(b,c,d) + x + ac, s) + b;
}
FORCE_INLINE constexpr void GG(uInt32 &a, uInt32 b, uInt32 c, uInt32 d,
uInt32 x, uInt32 s, uInt32 ac) {
static constexpr void GG(uInt32 &a, uInt32 b, uInt32 c, uInt32 d,
uInt32 x, uInt32 s, uInt32 ac) {
a = rotate_left(a + G(b,c,d) + x + ac, s) + b;
}
FORCE_INLINE constexpr void HH(uInt32 &a, uInt32 b, uInt32 c, uInt32 d,
uInt32 x, uInt32 s, uInt32 ac) {
static constexpr void HH(uInt32 &a, uInt32 b, uInt32 c, uInt32 d,
uInt32 x, uInt32 s, uInt32 ac) {
a = rotate_left(a + H(b,c,d) + x + ac, s) + b;
}
FORCE_INLINE constexpr void II(uInt32 &a, uInt32 b, uInt32 c, uInt32 d,
uInt32 x, uInt32 s, uInt32 ac) {
static constexpr void II(uInt32 &a, uInt32 b, uInt32 c, uInt32 d,
uInt32 x, uInt32 s, uInt32 ac) {
a = rotate_left(a + I(b,c,d) + x + ac, s) + b;
}
private:
static inline constexpr uInt32 BLOCKSIZE = 64;
static constexpr uInt32 BLOCKSIZE = 64;
bool finalized{false};
std::array<uInt8, BLOCKSIZE> buffer; // bytes that didn't fit in last chunk
std::array<uInt32, 2> count; // 64bit counter for number of bits (lo, hi)

View File

@ -80,7 +80,7 @@ class MT24LC256
void jpee_data_stop();
void jpee_clock_fall();
bool jpee_timercheck(int mode);
void jpee_logproc(string_view st) { cerr << " " << st << '\n'; }
static void jpee_logproc(string_view st) { cerr << " " << st << '\n'; }
void update();

View File

@ -105,7 +105,7 @@ class OSystem
@return The frame buffer
*/
FrameBuffer& frameBuffer() const { return *myFrameBuffer; }
bool hasFrameBuffer() const { return myFrameBuffer.get() != nullptr; }
bool hasFrameBuffer() const { return myFrameBuffer != nullptr; }
/**
Get the sound object of the system.

View File

@ -97,7 +97,7 @@ class Properties
@return The value of the property
*/
const string& get(PropType key) const {
const uInt8 pos = static_cast<uInt8>(key);
const auto pos = static_cast<uInt8>(key);
return pos < static_cast<uInt8>(PropType::NumTypes) ? myProperties[pos] : EmptyString;
}

View File

@ -40,8 +40,8 @@ class OSystem;
class PropertiesSet
{
public:
PropertiesSet();
~PropertiesSet() = default;
void setRepository(shared_ptr<CompositeKeyValueRepository> repository);

View File

@ -82,7 +82,7 @@ QuadTari::QuadTari(Jack jack, const OSystem& osystem, const System& system,
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
unique_ptr<Controller> QuadTari::addController(const Controller::Type type, bool second)
unique_ptr<Controller> QuadTari::addController(Controller::Type type, bool second)
{
FSNode nvramfile = myOSystem.nvramDir();
const Controller::onMessageCallback callback = [&os = myOSystem]

View File

@ -121,7 +121,7 @@ class QuadTari : public Controller
// determine which controller is active
bool isFirst() const;
unique_ptr<Controller> addController(const Controller::Type type, bool second);
unique_ptr<Controller> addController(Controller::Type type, bool second);
const OSystem& myOSystem;
const Properties& myProperties;

View File

@ -39,6 +39,7 @@ class Random : public Serializable
explicit Random() {
initSeed(static_cast<uInt32>(std::chrono::system_clock::now().time_since_epoch().count()));
}
~Random() override = default;
/**
Create a new random number generator with given seed.

View File

@ -110,7 +110,7 @@ void SaveKey::eraseCurrent()
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
bool SaveKey::isPageUsed(const uInt32 page) const
bool SaveKey::isPageUsed(uInt32 page) const
{
return myEEPROM->isPageUsed(page);
}

View File

@ -109,7 +109,7 @@ class SaveKey : public Controller
void eraseCurrent();
/** Returns true if the page is used by the current ROM */
bool isPageUsed(const uInt32 page) const;
bool isPageUsed(uInt32 page) const;
private:
// The EEPROM used in the SaveKey

View File

@ -35,7 +35,7 @@
class Serializer
{
public:
enum class Mode { ReadOnly, ReadWrite, ReadWriteTrunc };
enum class Mode: uInt8 { ReadOnly, ReadWrite, ReadWriteTrunc };
public:
/**

View File

@ -105,10 +105,10 @@ class Settings
const string& getString(string_view key) const {
return value(key).toString();
}
const Common::Size getSize(string_view key) const {
Common::Size getSize(string_view key) const {
return value(key).toSize();
}
const Common::Point getPoint(string_view key) const {
Common::Point getPoint(string_view key) const {
return value(key).toPoint();
}

View File

@ -38,7 +38,7 @@ class Sound
Create a new sound object. The open method must be invoked before
using the object.
*/
Sound(OSystem& osystem) : myOSystem{osystem} { }
explicit Sound(OSystem& osystem) : myOSystem{osystem} { }
virtual ~Sound() = default;
public:

View File

@ -101,14 +101,14 @@ class System : public Serializable
@return The attached 6532 microprocessor
*/
inline M6532& m6532() const { return myM6532; }
M6532& m6532() const { return myM6532; }
/**
Answer the TIA device attached to the system.
@return The attached TIA device
*/
inline TIA& tia() const { return myTIA; }
TIA& tia() const { return myTIA; }
/**
Answer the Cart attached to the system.
@ -140,14 +140,14 @@ class System : public Serializable
@return The number of system cycles which have passed
*/
inline uInt64 cycles() const { return myCycles; }
uInt64 cycles() const { return myCycles; }
/**
Increment the system cycles by the specified number of cycles.
@param amount The amount to add to the system cycles counter
*/
inline void incrementCycles(uInt32 amount) { myCycles += amount; }
void incrementCycles(uInt32 amount) { myCycles += amount; }
/**
Informs all attached devices that the console type has changed.
@ -171,7 +171,7 @@ class System : public Serializable
/**
* See peekImpl below.
*/
inline uInt8 peek(uInt16 address, Device::AccessFlags flags = Device::NONE)
uInt8 peek(uInt16 address, Device::AccessFlags flags = Device::NONE)
{
return peekImpl<false>(address, flags);
}
@ -179,7 +179,7 @@ class System : public Serializable
/**
* See peekImpl below.
*/
inline uInt8 peekOob(uInt16 address, Device::AccessFlags flags = Device::NONE)
uInt8 peekOob(uInt16 address, Device::AccessFlags flags = Device::NONE)
{
return peekImpl<true>(address, flags);
}
@ -187,7 +187,7 @@ class System : public Serializable
/**
* See pokeImpl below.
*/
inline void poke(uInt16 address, uInt8 value, Device::AccessFlags flags = Device::NONE)
void poke(uInt16 address, uInt8 value, Device::AccessFlags flags = Device::NONE)
{
pokeImpl<false>(address, value, flags);
}
@ -195,7 +195,7 @@ class System : public Serializable
/**
* See pokeImpl below.
*/
inline void pokeOob(uInt16 address, uInt8 value, Device::AccessFlags flags = Device::NONE)
void pokeOob(uInt16 address, uInt8 value, Device::AccessFlags flags = Device::NONE)
{
pokeImpl<true>(address, value, flags);
}

View File

@ -169,7 +169,7 @@ class TIASurface
Enable/disable/query NTSC filtering effects.
*/
void enableNTSC(bool enable);
bool ntscEnabled() const { return uInt8(myFilter) & 0x10; }
bool ntscEnabled() const { return static_cast<uInt8>(myFilter) & 0x10; }
string effectsInfo() const;
/**
@ -195,7 +195,7 @@ class TIASurface
void updateSurfaceSettings();
private:
enum class ScanlineMask {
enum class ScanlineMask: uInt8 {
Standard,
Thin,
Pixels,
@ -246,10 +246,12 @@ class TIASurface
// Phosphor blend
int myPBlend{0};
std::array<uInt32, AtariNTSC::outWidth(TIAConstants::frameBufferWidth) *
TIAConstants::frameBufferHeight> myRGBFramebuffer;
std::array<uInt32, AtariNTSC::outWidth(TIAConstants::frameBufferWidth) *
TIAConstants::frameBufferHeight> myPrevRGBFramebuffer;
std::array<uInt32, static_cast<std::size_t>
(AtariNTSC::outWidth(TIAConstants::frameBufferWidth) *
TIAConstants::frameBufferHeight)> myRGBFramebuffer;
std::array<uInt32, static_cast<std::size_t>
(AtariNTSC::outWidth(TIAConstants::frameBufferWidth) *
TIAConstants::frameBufferHeight)> myPrevRGBFramebuffer;
/////////////////////////////////////////////////////////////
// Use scanlines in TIA rendering mode

View File

@ -135,7 +135,7 @@ using Common::Base;
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Thumbulator::Thumbulator(const uInt16* rom_ptr, uInt16* ram_ptr, uInt32 rom_size,
const uInt32 c_base, const uInt32 c_start, const uInt32 c_stack,
uInt32 c_base, uInt32 c_start, uInt32 c_stack,
bool traponfatal, double cyclefactor,
Thumbulator::ConfigureFor configurefor,
Cartridge* cartridge)
@ -760,9 +760,9 @@ uInt32 Thumbulator::read32(uInt32 addr)
data = systick_count;
return data;
#ifdef THUMB_CYCLE_COUNT
case 0xE01FC100: // APBDIV
case 0xE01FC100: // APBDIV
_countCycles = true; // enabe cycle counting
return 1; // random value
return 1; // random value
#endif
#ifndef UNSAFE_OPTIMIZATIONS

View File

@ -50,7 +50,7 @@ class Thumbulator
public:
// control cartridge specific features of the Thumbulator class,
// such as the start location for calling custom code
enum class ConfigureFor {
enum class ConfigureFor: uInt8 {
BUS, // cartridges of type BUS
CDF, // cartridges of type CDF
CDF1, // cartridges of type CDF version 1
@ -58,7 +58,7 @@ class Thumbulator
CDFJplus, // cartridges of type CDFJ+
DPCplus // cartridges of type DPC+
};
enum class ChipType {
enum class ChipType: Int8 {
AUTO = -1,
LPC2101, // Harmony (includes LPC2103)
LPC2104_OC, // Dev cart overclocked (includes LPC2105)
@ -66,7 +66,7 @@ class Thumbulator
LPC213x, // future use (includes LPC2132)
numTypes
};
enum class MamModeType {
enum class MamModeType: uInt8 {
mode0, mode1, mode2, modeX
};
struct ChipPropsType {
@ -88,10 +88,11 @@ class Thumbulator
};
Thumbulator(const uInt16* rom_ptr, uInt16* ram_ptr, uInt32 rom_size,
const uInt32 c_base, const uInt32 c_start, const uInt32 c_stack,
uInt32 c_base, uInt32 c_start, uInt32 c_stack,
bool traponfatal, double cyclefactor,
Thumbulator::ConfigureFor configurefor,
Cartridge* cartridge);
~Thumbulator() = default;
/**
Run the ARM code, and return when finished. A runtime_error exception is
@ -198,14 +199,15 @@ class Thumbulator
numOps
};
#ifdef THUMB_CYCLE_COUNT
enum class CycleType {
enum class CycleType: uInt8 {
S, N, I // Sequential, Non-sequential, Internal
};
enum class AccessType {
enum class AccessType: uInt8 {
prefetch, branch, data
};
#endif
const std::array<ChipPropsType, uInt32(ChipType::numTypes)> ChipProps =
const std::array<ChipPropsType,
static_cast<uInt32>(ChipType::numTypes)> ChipProps =
{{
{ "LPC2101..3", 70.0, 4, 1 }, // LPC2101_02_03
{ "LPC2104..6 OC", 70.0, 4, 2 }, // LPC2104_05_06 Overclocked
@ -335,10 +337,10 @@ class Thumbulator
ROMSIZE = ROMADDMASK + 1, // 512KB
RAMSIZE = RAMADDMASK + 1, // 32KB
CPSR_N = 1u << 31,
CPSR_Z = 1u << 30,
CPSR_C = 1u << 29,
CPSR_V = 1u << 28;
CPSR_N = 1U << 31,
CPSR_Z = 1U << 30,
CPSR_C = 1U << 29,
CPSR_V = 1U << 28;
private:
// Following constructors and assignment operators not supported

View File

@ -32,7 +32,7 @@ class EmulationWarning : public std::exception
}
private:
const string myMessage;
string myMessage;
};
#endif // EMULATION_WARNING_HXX

View File

@ -32,7 +32,7 @@ class FatalEmulationError : public std::exception
}
private:
const string myMessage;
string myMessage;
};
#endif // FATAL_EMULATION_ERROR_HXX

View File

@ -43,6 +43,7 @@ class AnalogReadout : public Serializable
public:
AnalogReadout();
~AnalogReadout() override = default;
void reset(uInt64 timestamp);

View File

@ -28,6 +28,7 @@ class Audio : public Serializable
{
public:
Audio();
~Audio() override = default;
void reset();
@ -46,9 +47,9 @@ class Audio : public Serializable
FORCE_INLINE void tick();
inline AudioChannel& channel0() { return myChannel0; }
AudioChannel& channel0() { return myChannel0; }
inline AudioChannel& channel1() { return myChannel1; }
AudioChannel& channel1() { return myChannel1; }
/**
Serializable methods (see that class for more information).

View File

@ -25,6 +25,7 @@ class AudioChannel : public Serializable
{
public:
AudioChannel() = default;
~AudioChannel() override = default;
void reset();

View File

@ -27,6 +27,7 @@ class Background : public Serializable
{
public:
Background() = default;
~Background() override = default;
public:
void setTIA(TIA* tia) { myTIA = tia; }
@ -39,7 +40,7 @@ class Background : public Serializable
void applyColorLoss();
inline uInt8 getColor() const { return myColor; }
uInt8 getColor() const { return myColor; }
/**
Serializable methods (see that class for more information).

View File

@ -27,11 +27,11 @@ class TIA;
class Ball : public Serializable
{
public:
/**
The collision mask is injected at construction
*/
explicit Ball(uInt32 collisionMask);
~Ball() override = default;
public:
@ -123,12 +123,12 @@ class Ball : public Serializable
Is the ball visible? This is determined by looking at bit 15
of the collision mask.
*/
inline bool isOn() const { return (collision & 0x8000); }
bool isOn() const { return (collision & 0x8000); }
/**
Get the current color.
*/
inline uInt8 getColor() const { return myColor; }
uInt8 getColor() const { return myColor; }
/**
Shuffle the enabled flag. This is called in VDELBL mode when GRP1 is

View File

@ -34,6 +34,7 @@ class DelayQueue : public Serializable
public:
DelayQueue();
~DelayQueue() override = default;
public:

View File

@ -44,7 +44,7 @@ class DelayQueueIteratorImpl : public DelayQueueIterator
uInt8 currentIndex() const;
private:
const DelayQueue<length, capacity>& myDelayQueue;
const DelayQueue<length, capacity>& myDelayQueue; // NOLINT: we want a reference here
uInt8 myDelayCycle{0};
uInt8 myIndex{0};
};

View File

@ -32,6 +32,7 @@ class DelayQueueMember : public Serializable {
public:
DelayQueueMember();
~DelayQueueMember() override = default;
public:
void push(uInt8 address, uInt8 value);
@ -64,9 +65,7 @@ class DelayQueueMember : public Serializable {
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
template<unsigned capacity>
DelayQueueMember<capacity>::DelayQueueMember()
{
}
DelayQueueMember<capacity>::DelayQueueMember() = default;
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
template<unsigned capacity>
@ -82,7 +81,7 @@ void DelayQueueMember<capacity>::push(uInt8 address, uInt8 value)
template<unsigned capacity>
void DelayQueueMember<capacity>::remove(uInt8 address)
{
uInt8 index;
uInt8 index = 0;
for (index = 0; index < mySize; ++index) {
if (myEntries[index].address == address) break;

View File

@ -33,6 +33,7 @@ class DrawCounterDecodes
protected:
DrawCounterDecodes();
~DrawCounterDecodes() = default;
private:

View File

@ -18,7 +18,7 @@
#ifndef FRAME_LAYOUT
#define FRAME_LAYOUT
enum class FrameLayout {
enum class FrameLayout: uInt8 {
ntsc, // ROM display has NTSC timings (~60Hz, ~262 scanlines, etc)
pal, // ROM display has PAL timings (~50Hz, ~312 scanlines, etc)
pal60, // ROM display has NTSC timings (~60Hz, ~262 scanlines, etc), but uses PAL colors

View File

@ -25,6 +25,7 @@ class LatchedInput : public Serializable
{
public:
LatchedInput() = default;
~LatchedInput() override = default;
public:

View File

@ -30,6 +30,7 @@ class Missile : public Serializable
public:
explicit Missile(uInt32 collisionMask);
~Missile() override = default;
public:
@ -64,7 +65,7 @@ class Missile : public Serializable
void toggleEnabled(bool enabled);
inline bool isOn() const { return (collision & 0x8000); }
bool isOn() const { return (collision & 0x8000); }
uInt8 getColor() const;
uInt8 getPosition() const;

Some files were not shown because too many files have changed in this diff Show More