Make variables initialized in c'tor initialization list use brace-syntax.

- This is on the advice of one of the static analyzers we use.
 - More classes have to be converted; this is only the first pass.
This commit is contained in:
Stephen Anthony 2020-12-20 12:06:10 -03:30
parent 1ae5a73afe
commit b36729a825
79 changed files with 183 additions and 170 deletions

View File

@ -28,7 +28,7 @@
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
CheatManager::CheatManager(OSystem& osystem)
: myOSystem(osystem)
: myOSystem{osystem}
{
}

View File

@ -23,9 +23,9 @@
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
CheetahCheat::CheetahCheat(OSystem& os, const string& name, const string& code)
: Cheat(os, name, code),
address(0xf000 + unhex(code.substr(0, 3))),
value(uInt8(unhex(code.substr(3, 2)))),
count(uInt8(unhex(code.substr(5, 1)) + 1))
address{uInt16(0xf000 + unhex(code.substr(0, 3)))},
value{uInt8(unhex(code.substr(3, 2)))},
count{uInt8(unhex(code.substr(5, 1)) + 1)}
{
// Back up original data; we need this if the cheat is ever disabled
for(int i = 0; i < count; ++i)

View File

@ -25,8 +25,8 @@
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
RamCheat::RamCheat(OSystem& os, const string& name, const string& code)
: Cheat(os, name, code),
address(uInt16(unhex(myCode.substr(0, 2)))),
value(uInt8(unhex(myCode.substr(2, 2))))
address{uInt16(unhex(myCode.substr(0, 2)))},
value{uInt8(unhex(myCode.substr(2, 2)))}
{
}

View File

@ -22,10 +22,10 @@ using std::lock_guard;
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
AudioQueue::AudioQueue(uInt32 fragmentSize, uInt32 capacity, bool isStereo)
: myFragmentSize(fragmentSize),
myIsStereo(isStereo),
myFragmentQueue(capacity),
myAllFragments(capacity + 2)
: myFragmentSize{fragmentSize},
myIsStereo{isStereo},
myFragmentQueue{capacity},
myAllFragments{capacity + 2}
{
const uInt8 sampleSize = myIsStereo ? 2 : 1;
@ -48,7 +48,7 @@ uInt32 AudioQueue::capacity() const
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
uInt32 AudioQueue::size()
uInt32 AudioQueue::size() const
{
lock_guard<mutex> guard(myMutex);

View File

@ -55,7 +55,7 @@ class AudioQueue
/**
Size getter.
*/
uInt32 size();
uInt32 size() const;
/**
Stereo / mono getter.
@ -120,7 +120,7 @@ class AudioQueue
uInt32 myNextFragment{0};
// We need a mutex for thread safety.
std::mutex myMutex;
mutable std::mutex myMutex;
// The first (empty) enqueue call returns this fragment.
Int16* myFirstFragmentForEnqueue{nullptr};

View File

@ -43,7 +43,7 @@ namespace {
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
AudioSettings::AudioSettings(Settings& settings)
: mySettings(settings)
: mySettings{settings}
{
setPreset(normalizedPreset(mySettings.getInt(SETTING_PRESET)));
}

View File

@ -129,13 +129,13 @@ class AudioSettings
Settings& mySettings;
Preset myPreset;
Preset myPreset{Preset::custom};
uInt32 myPresetSampleRate{0};
uInt32 myPresetFragmentSize{0};
uInt32 myPresetBufferSize{0};
uInt32 myPresetHeadroom{0};
ResamplingQuality myPresetResamplingQuality;
ResamplingQuality myPresetResamplingQuality{ResamplingQuality::nearestNeightbour};
bool myIsPersistent{true};
};

View File

@ -23,7 +23,7 @@
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
EventHandlerSDL2::EventHandlerSDL2(OSystem& osystem)
: EventHandler(osystem)
: EventHandler{osystem}
{
ASSERT_MAIN_THREAD;

View File

@ -31,7 +31,7 @@
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FBBackendSDL2::FBBackendSDL2(OSystem& osystem)
: myOSystem(osystem)
: myOSystem{osystem}
{
ASSERT_MAIN_THREAD;

View File

@ -45,8 +45,8 @@ FBSurfaceSDL2::FBSurfaceSDL2(FBBackendSDL2& backend,
uInt32 width, uInt32 height,
ScalingInterpolation inter,
const uInt32* staticData)
: myBackend(backend),
myInterpolationMode(inter)
: myBackend{backend},
myInterpolationMode{inter}
{
createSurface(width, height, staticData);
}

View File

@ -94,8 +94,8 @@ FilesystemNodeZIP::FilesystemNodeZIP(const string& p)
FilesystemNodeZIP::FilesystemNodeZIP(
const string& zipfile, const string& virtualpath,
const AbstractFSNodePtr& realnode, bool isdir)
: _isDirectory(isdir),
_isFile(!isdir)
: _isDirectory{isdir},
_isFile{!isdir}
{
setFlags(zipfile, virtualpath, realnode);
}

View File

@ -21,7 +21,7 @@ using namespace std::chrono;
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FpsMeter::FpsMeter(uInt32 queueSize)
: myQueue(queueSize)
: myQueue{queueSize}
{
reset();
}

View File

@ -60,7 +60,7 @@ using Common::Base;
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
HighScoresManager::HighScoresManager(OSystem& osystem)
: myOSystem(osystem)
: myOSystem{osystem}
{
}

View File

@ -44,19 +44,19 @@ class JoyMap
explicit JoyMapping(EventMode c_mode, int c_button,
JoyAxis c_axis, JoyDir c_adir,
int c_hat, JoyHatDir c_hdir)
: mode(c_mode), button(c_button),
axis(c_axis), adir(c_adir),
hat(c_hat), hdir(c_hdir) { }
: mode{c_mode}, button{c_button},
axis{c_axis}, adir{c_adir},
hat{c_hat}, hdir{c_hdir} { }
explicit JoyMapping(EventMode c_mode, int c_button,
JoyAxis c_axis, JoyDir c_adir)
: mode(c_mode), button(c_button),
axis(c_axis), adir(c_adir),
hat(JOY_CTRL_NONE), hdir(JoyHatDir::CENTER) { }
: mode{c_mode}, button{c_button},
axis{c_axis}, adir{c_adir},
hat{JOY_CTRL_NONE}, hdir{JoyHatDir::CENTER} { }
explicit JoyMapping(EventMode c_mode, int c_button,
int c_hat, JoyHatDir c_hdir)
: mode(c_mode), button(c_button),
axis(JoyAxis::NONE), adir(JoyDir::NONE),
hat(c_hat), hdir(c_hdir) { }
: mode{c_mode}, button{c_button},
axis{JoyAxis::NONE}, adir{JoyDir::NONE},
hat{c_hat}, hdir{c_hdir} { }
JoyMapping(const JoyMapping&) = default;
JoyMapping& operator=(const JoyMapping&) = default;

View File

@ -39,9 +39,9 @@ class KeyMap
StellaMod mod{StellaMod(0)};
explicit Mapping(EventMode c_mode, StellaKey c_key, StellaMod c_mod)
: mode(c_mode), key(c_key), mod(c_mod) { }
: mode{c_mode}, key{c_key}, mod{c_mod} { }
explicit Mapping(EventMode c_mode, int c_key, int c_mod)
: mode(c_mode), key(StellaKey(c_key)), mod(StellaMod(c_mod)) { }
: mode{c_mode}, key{StellaKey(c_key)}, mod{StellaMod(c_mod)} { }
Mapping(const Mapping&) = default;
Mapping& operator=(const Mapping&) = default;
Mapping(Mapping&&) = default;

View File

@ -24,9 +24,9 @@
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
MouseControl::MouseControl(Console& console, const string& mode)
: myProps(console.properties()),
myLeftController(console.leftController()),
myRightController(console.rightController())
: myProps{console.properties()},
myLeftController{console.leftController()},
myRightController{console.rightController()}
{
istringstream m_axis(mode);
string m_mode;

View File

@ -36,8 +36,8 @@ using json = nlohmann::json;
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
PhysicalJoystickHandler::PhysicalJoystickHandler(
OSystem& system, EventHandler& handler)
: myOSystem(system),
myHandler(handler)
: myOSystem{system},
myHandler{handler}
{
if(myOSystem.settings().getInt("event_ver") != Event::VERSION) {
Logger::info("event version mismatch; dropping previous joystick mappings");

View File

@ -50,7 +50,7 @@ class PhysicalJoystickHandler
struct StickInfo
{
StickInfo(const nlohmann::json& map = nullptr, PhysicalJoystickPtr stick = nullptr)
: mapping(map), joy(std::move(stick)) {}
: mapping{map}, joy{std::move(stick)} { }
nlohmann::json mapping;
PhysicalJoystickPtr joy;

View File

@ -1,5 +1,4 @@
//============================================================================
//============================================================================
//
// SSSS tt lll lll
// SS SS tt ll ll
@ -41,8 +40,8 @@ static constexpr int MOD3 = KBDM_ALT;
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
PhysicalKeyboardHandler::PhysicalKeyboardHandler(OSystem& system, EventHandler& handler)
: myOSystem(system),
myHandler(handler)
: myOSystem{system},
myHandler{handler}
{
Int32 version = myOSystem.settings().getInt("event_ver");
bool updateDefaults = false;

View File

@ -33,7 +33,7 @@
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
PNGLibrary::PNGLibrary(OSystem& osystem)
: myOSystem(osystem)
: myOSystem{osystem}
{
}

View File

@ -24,7 +24,7 @@
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
PaletteHandler::PaletteHandler(OSystem& system)
: myOSystem(system)
: myOSystem{system}
{
// Load user-defined palette for this ROM
loadUserPalette();

View File

@ -139,7 +139,7 @@ class PaletteHandler
float y{0.F};
explicit vector2d(float _x = 0.F, float _y = 0.F)
: x(_x), y(_y) { }
: x{_x}, y{_y} { }
};
/**

View File

@ -32,6 +32,7 @@ namespace Common {
*/
struct Point
{
// FIXME : make this uInt32
Int32 x{0}; //!< The horizontal part of the point
Int32 y{0}; //!< The vertical part of the point

View File

@ -28,8 +28,8 @@
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
RewindManager::RewindManager(OSystem& system, StateManager& statemgr)
: myOSystem(system),
myStateManager(statemgr)
: myOSystem{system},
myStateManager{statemgr}
{
setup();
}

View File

@ -40,8 +40,8 @@
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
SoundSDL2::SoundSDL2(OSystem& osystem, AudioSettings& audioSettings)
: Sound(osystem),
myAudioSettings(audioSettings)
: Sound{osystem},
myAudioSettings{audioSettings}
{
ASSERT_MAIN_THREAD;

View File

@ -37,8 +37,8 @@ namespace {
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
StaggeredLogger::StaggeredLogger(const string& message, Logger::Level level)
: myMessage(message),
myLevel(level)
: myMessage{message},
myLevel{level}
{
}

View File

@ -31,7 +31,7 @@
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
StateManager::StateManager(OSystem& osystem)
: myOSystem(osystem)
: myOSystem{osystem}
{
myRewindManager = make_unique<RewindManager>(myOSystem, *this);
reset();

View File

@ -20,7 +20,7 @@
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
TimerManager::TimerManager()
: nextId(no_timer + 1),
: nextId{no_timer + 1},
queue()
{
}

View File

@ -44,8 +44,8 @@ class Variant
public:
Variant() { } // NOLINT
Variant(const string& s) : data(s) { }
Variant(const char* s) : data(s) { }
Variant(const string& s) : data{s} { }
Variant(const char* s) : data{s} { }
Variant(Int32 i) { buf().str(""); buf() << i; data = buf().str(); }
Variant(uInt32 i) { buf().str(""); buf() << i; data = buf().str(); }

View File

@ -19,9 +19,9 @@
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
ConvolutionBuffer::ConvolutionBuffer(uInt32 size)
: mySize(size)
: myData{make_unique<float[]>(size)},
mySize{size}
{
myData = make_unique<float[]>(mySize);
std::fill_n(myData.get(), mySize, 0.F);
}

View File

@ -20,7 +20,7 @@
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
HighPass::HighPass(float cutOffFrequency, float frequency)
: myAlpha(1.F / (1.F + 2.F*BSPF::PI_f*cutOffFrequency/frequency))
: myAlpha{1.F / (1.F + 2.F*BSPF::PI_f*cutOffFrequency/frequency)}
{
}

View File

@ -69,12 +69,12 @@ LanczosResampler::LanczosResampler(
// formatFrom.sampleRate / formatTo.sampleRate = M / N
//
// -> we find N from fully reducing the fraction.
myPrecomputedKernelCount(reducedDenominator(formatFrom.sampleRate, formatTo.sampleRate)),
myKernelSize(2 * kernelParameter),
myKernelParameter(kernelParameter),
myHighPassL(HIGH_PASS_CUT_OFF, float(formatFrom.sampleRate)),
myHighPassR(HIGH_PASS_CUT_OFF, float(formatFrom.sampleRate)),
myHighPass(HIGH_PASS_CUT_OFF, float(formatFrom.sampleRate))
myPrecomputedKernelCount{reducedDenominator(formatFrom.sampleRate, formatTo.sampleRate)},
myKernelSize{2 * kernelParameter},
myKernelParameter{kernelParameter},
myHighPassL{HIGH_PASS_CUT_OFF, float(formatFrom.sampleRate)},
myHighPassR{HIGH_PASS_CUT_OFF, float(formatFrom.sampleRate)},
myHighPass{HIGH_PASS_CUT_OFF, float(formatFrom.sampleRate)}
{
myPrecomputedKernels = make_unique<float[]>(myPrecomputedKernelCount * myKernelSize);

View File

@ -51,12 +51,11 @@ class Resampler {
public:
Resampler(Format formatFrom, Format formatTo,
const NextFragmentCallback& nextFragmentCallback) :
myFormatFrom(formatFrom),
myFormatTo(formatTo),
myNextFragmentCallback(nextFragmentCallback),
myUnderrunLogger("audio buffer underrun", Logger::Level::INFO)
{}
const NextFragmentCallback& nextFragmentCallback)
: myFormatFrom{formatFrom},
myFormatTo{formatTo},
myNextFragmentCallback{nextFragmentCallback},
myUnderrunLogger{"audio buffer underrun", Logger::Level::INFO} { }
virtual void fillFragment(float* fragment, uInt32 length) = 0;

View File

@ -39,13 +39,11 @@ class SimpleResampler : public Resampler
bool myIsUnderrun{true};
private:
SimpleResampler() = delete;
SimpleResampler(const SimpleResampler&) = delete;
SimpleResampler(SimpleResampler&&) = delete;
SimpleResampler& operator=(const SimpleResampler&) = delete;
SimpleResampler& operator=(const SimpleResampler&&) = delete;
};
#endif // SIMPLE_RESAMPLER_HXX

View File

@ -1,3 +1,20 @@
//============================================================================
//
// SSSS tt lll lll
// SS SS tt ll ll
// SS tttttt eeee ll ll aaaa
// SSSS tt ee ee ll ll aa
// SS tt eeeeee ll ll aaaaa -- "An Atari 2600 VCS Emulator"
// SS SS tt ee ll ll aa aa
// SSSS ttt eeeee llll llll aaaaa
//
// Copyright (c) 1995-2020 by Bradford W. Mott, Stephen Anthony
// and the Stella Team
//
// See the file "License.txt" for information on usage and redistribution of
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
//============================================================================
#ifndef JSON_DEFINITIONS_HXX
#define JSON_DEFINITIONS_HXX

View File

@ -29,7 +29,7 @@ namespace {
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
KeyValueRepositoryConfigfile::KeyValueRepositoryConfigfile(const FilesystemNode& file)
: myFile(file)
: myFile{file}
{
}

View File

@ -22,10 +22,9 @@
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
KeyValueRepositorySqlite::KeyValueRepositorySqlite(
SqliteDatabase& db,
const string& tableName
) : myTableName(tableName),
myDb(db)
SqliteDatabase& db, const string& tableName)
: myTableName{tableName},
myDb{db}
{
}

View File

@ -20,12 +20,11 @@
#include "SqliteError.hxx"
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
SettingsDb::SettingsDb(
const string& databaseDirectory,
const string& databaseName
) : myDatabaseDirectory(databaseDirectory),
myDatabaseName(databaseName)
{}
SettingsDb::SettingsDb(const string& databaseDirectory, const string& databaseName)
: myDatabaseDirectory{databaseDirectory},
myDatabaseName{databaseName}
{
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
bool SettingsDb::initialize()

View File

@ -30,7 +30,7 @@
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
SqliteDatabase::SqliteDatabase(const string& databaseDirectory,
const string& databaseName)
: myDatabaseFile(databaseDirectory + SEPARATOR + databaseName + ".sqlite3")
: myDatabaseFile{databaseDirectory + SEPARATOR + databaseName + ".sqlite3"}
{
}

View File

@ -19,7 +19,7 @@
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
SqliteStatement::SqliteStatement(sqlite3* handle, string sql)
: myHandle(handle)
: myHandle{handle}
{
if (sqlite3_prepare_v2(handle, sql.c_str(), -1, &myStmt, nullptr) != SQLITE_OK)
throw SqliteError(handle);

View File

@ -20,7 +20,7 @@
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
SqliteTransaction::SqliteTransaction(SqliteDatabase& db)
: myDb(db)
: myDb{db}
{
myDb.exec("BEGIN TRANSACTION");
}

View File

@ -21,8 +21,8 @@
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
BilinearBlitter::BilinearBlitter(FBBackendSDL2& fb, bool interpolate)
: myFB(fb),
myInterpolate(interpolate)
: myFB{fb},
myInterpolate{interpolate}
{
}

View File

@ -21,7 +21,8 @@
#include "BilinearBlitter.hxx"
#include "QisBlitter.hxx"
unique_ptr<Blitter> BlitterFactory::createBlitter(FBBackendSDL2& fb, ScalingAlgorithm scaling)
unique_ptr<Blitter>
BlitterFactory::createBlitter(FBBackendSDL2& fb, ScalingAlgorithm scaling)
{
if (!fb.isInitialized()) {
throw runtime_error("BlitterFactory requires an initialized framebuffer!");

View File

@ -21,7 +21,7 @@
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
QisBlitter::QisBlitter(FBBackendSDL2& fb)
: myFB(fb)
: myFB{fb}
{
}

View File

@ -48,7 +48,7 @@ using std::right;
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
CartDebug::CartDebug(Debugger& dbg, Console& console, const OSystem& osystem)
: DebuggerSystem(dbg, console),
myOSystem(osystem)
myOSystem{osystem}
{
// Add case sensitive compare for user labels
// TODO - should user labels be case insensitive too?

View File

@ -27,7 +27,7 @@
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
CpuDebug::CpuDebug(Debugger& dbg, Console& console)
: DebuggerSystem(dbg, console),
my6502(mySystem.m6502())
my6502{mySystem.m6502()}
{
}

View File

@ -62,8 +62,8 @@ Debugger* Debugger::myStaticDebugger = nullptr;
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Debugger::Debugger(OSystem& osystem, Console& console)
: DialogContainer(osystem),
myConsole(console),
mySystem(console.system())
myConsole{console},
mySystem{console.system()}
{
// Init parser
myParser = make_unique<DebuggerParser>(*this, osystem.settings());

View File

@ -91,7 +91,7 @@ class ByteDerefOffsetExpression : public Expression
class ConstExpression : public Expression
{
public:
ConstExpression(const int value) : Expression(), myValue(value) { }
ConstExpression(const int value) : Expression(), myValue{value} { }
Int32 evaluate() const override
{ return myValue; }
@ -103,7 +103,7 @@ class ConstExpression : public Expression
class CpuMethodExpression : public Expression
{
public:
CpuMethodExpression(CpuMethod method) : Expression(), myMethod(std::mem_fn(method)) { }
CpuMethodExpression(CpuMethod method) : Expression(), myMethod{std::mem_fn(method)} { }
Int32 evaluate() const override
{ return myMethod(Debugger::debugger().cpuDebug()); }
@ -134,7 +134,7 @@ class EqualsExpression : public Expression
class EquateExpression : public Expression
{
public:
EquateExpression(const string& label) : Expression(), myLabel(label) { }
EquateExpression(const string& label) : Expression(), myLabel{label} { }
Int32 evaluate() const override
{ return Debugger::debugger().cartDebug().getAddress(myLabel); }
@ -146,7 +146,7 @@ class EquateExpression : public Expression
class FunctionExpression : public Expression
{
public:
FunctionExpression(const string& label) : Expression(), myLabel(label) { }
FunctionExpression(const string& label) : Expression(), myLabel{label} { }
Int32 evaluate() const override
{ return Debugger::debugger().getFunction(myLabel).evaluate(); }
@ -285,7 +285,7 @@ class PlusExpression : public Expression
class CartMethodExpression : public Expression
{
public:
CartMethodExpression(CartMethod method) : Expression(), myMethod(std::mem_fn(method)) { }
CartMethodExpression(CartMethod method) : Expression(), myMethod{std::mem_fn(method)} { }
Int32 evaluate() const override
{ return myMethod(Debugger::debugger().cartDebug()); }
@ -315,7 +315,7 @@ class ShiftRightExpression : public Expression
class RiotMethodExpression : public Expression
{
public:
RiotMethodExpression(RiotMethod method) : Expression(), myMethod(std::mem_fn(method)) { }
RiotMethodExpression(RiotMethod method) : Expression(), myMethod{std::mem_fn(method)} { }
Int32 evaluate() const override
{ return myMethod(Debugger::debugger().riotDebug()); }
@ -327,7 +327,7 @@ class RiotMethodExpression : public Expression
class TiaMethodExpression : public Expression
{
public:
TiaMethodExpression(TiaMethod method) : Expression(), myMethod(std::mem_fn(method)) { }
TiaMethodExpression(TiaMethod method) : Expression(), myMethod{std::mem_fn(method)} { }
Int32 evaluate() const override
{ return myMethod(Debugger::debugger().tiaDebug()); }

View File

@ -57,8 +57,8 @@ using std::right;
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
DebuggerParser::DebuggerParser(Debugger& d, Settings& s)
: debugger(d),
settings(s)
: debugger{d},
settings{s}
{
}

View File

@ -27,12 +27,12 @@ DiStella::DiStella(const CartDebug& dbg, CartDebug::DisassemblyList& list,
CartDebug::AddrTypeArray& labels,
CartDebug::AddrTypeArray& directives,
CartDebug::ReservedEquates& reserved)
: myDbg(dbg),
myList(list),
mySettings(s),
myReserved(reserved),
myLabels(labels),
myDirectives(directives)
: myDbg{dbg},
myList{list},
mySettings{s},
myReserved{reserved},
myLabels{labels},
myDirectives{directives}
{
bool resolve_code = mySettings.resolveCode;
CartDebug::AddressList& debuggerAddresses = info.addressList;

View File

@ -32,7 +32,7 @@ class Expression
{
public:
Expression(Expression* lhs = nullptr, Expression* rhs = nullptr)
: myLHS(lhs), myRHS(rhs) { }
: myLHS{lhs}, myRHS{rhs} { }
virtual ~Expression() = default;
virtual Int32 evaluate() const { return 0; }

View File

@ -26,7 +26,7 @@
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
TIADebug::TIADebug(Debugger& dbg, Console& console)
: DebuggerSystem(dbg, console),
myTIA(console.tia())
myTIA{console.tia()}
{
}

View File

@ -25,7 +25,7 @@ Cartridge3EPlusWidget::Cartridge3EPlusWidget(
GuiObject* boss, const GUI::Font& lfont, const GUI::Font& nfont,
int x, int y, int w, int h, Cartridge3EPlus& cart)
: CartridgeEnhancedWidget(boss, lfont, nfont, x, y, w, h, cart),
myCart3EP(cart)
myCart3EP{cart}
{
initialize();
}

View File

@ -24,7 +24,7 @@ Cartridge4A50Widget::Cartridge4A50Widget(
GuiObject* boss, const GUI::Font& lfont, const GUI::Font& nfont,
int x, int y, int w, int h, Cartridge4A50& cart)
: CartDebugWidget(boss, lfont, nfont, x, y, w, h),
myCart(cart)
myCart{cart}
{
string info =
"4A50 cartridge - 128K ROM and 32K RAM, split in various bank configurations\n"

View File

@ -27,7 +27,7 @@ CartridgeARWidget::CartridgeARWidget(
GuiObject* boss, const GUI::Font& lfont, const GUI::Font& nfont,
int x, int y, int w, int h, CartridgeAR& cart)
: CartDebugWidget(boss, lfont, nfont, x, y, w, h),
myCart(cart)
myCart{cart}
{
size_t size = myCart.mySize;

View File

@ -25,7 +25,7 @@ CartridgeBUSWidget::CartridgeBUSWidget(
GuiObject* boss, const GUI::Font& lfont, const GUI::Font& nfont,
int x, int y, int w, int h, CartridgeBUS& cart)
: CartDebugWidget(boss, lfont, nfont, x, y, w, h),
myCart(cart)
myCart{cart}
{
uInt16 size = 8 * 4096;

View File

@ -24,7 +24,7 @@ CartridgeCDFWidget::CartridgeCDFWidget(
GuiObject* boss, const GUI::Font& lfont, const GUI::Font& nfont,
int x, int y, int w, int h, CartridgeCDF& cart)
: CartDebugWidget(boss, lfont, nfont, x, y, w, h),
myCart(cart)
myCart{cart}
{
const int VBORDER = 8;
const int HBORDER = 2;

View File

@ -31,7 +31,7 @@ CartridgeCMWidget::CartridgeCMWidget(
GuiObject* boss, const GUI::Font& lfont, const GUI::Font& nfont,
int x, int y, int w, int h, CartridgeCM& cart)
: CartDebugWidget(boss, lfont, nfont, x, y, w, h),
myCart(cart)
myCart{cart}
{
uInt16 size = 4 * 4096;

View File

@ -27,7 +27,7 @@ CartridgeCTYWidget::CartridgeCTYWidget(
GuiObject* boss, const GUI::Font& lfont, const GUI::Font& nfont,
int x, int y, int w, int h, CartridgeCTY& cart)
: CartDebugWidget(boss, lfont, nfont, x, y, w, h),
myCart(cart)
myCart{cart}
{
uInt16 size = 8 * 4096;

View File

@ -25,7 +25,7 @@ CartridgeDPCPlusWidget::CartridgeDPCPlusWidget(
GuiObject* boss, const GUI::Font& lfont, const GUI::Font& nfont,
int x, int y, int w, int h, CartridgeDPCPlus& cart)
: CartDebugWidget(boss, lfont, nfont, x, y, w, h),
myCart(cart)
myCart{cart}
{
size_t size = cart.mySize;

View File

@ -25,7 +25,7 @@ CartridgeDPCWidget::CartridgeDPCWidget(
GuiObject* boss, const GUI::Font& lfont, const GUI::Font& nfont,
int x, int y, int w, int h, CartridgeDPC& cart)
: CartDebugWidget(boss, lfont, nfont, x, y, w, h),
myCart(cart)
myCart{cart}
{
const int V_GAP = 4;
size_t size = cart.mySize;

View File

@ -29,11 +29,11 @@ CartDebugWidget::CartDebugWidget(GuiObject* boss, const GUI::Font& lfont,
int x, int y, int w, int h)
: Widget(boss, lfont, x, y, w, h),
CommandSender(boss),
_nfont(nfont),
myFontWidth(lfont.getMaxCharWidth()),
myFontHeight(lfont.getFontHeight()),
myLineHeight(lfont.getLineHeight()),
myButtonHeight(myLineHeight + 4)
_nfont{nfont},
myFontWidth{lfont.getMaxCharWidth()},
myFontHeight{lfont.getFontHeight()},
myLineHeight{lfont.getLineHeight()},
myButtonHeight{myLineHeight + 4}
{
}

View File

@ -21,9 +21,9 @@
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
CartridgeE78KWidget::CartridgeE78KWidget(
GuiObject* boss, const GUI::Font& lfont, const GUI::Font& nfont,
int x, int y, int w, int h,
CartridgeMNetwork& cart)
GuiObject* boss, const GUI::Font& lfont, const GUI::Font& nfont,
int x, int y, int w, int h,
CartridgeMNetwork& cart)
: CartridgeMNetworkWidget(boss, lfont, nfont, x, y, w, h, cart)
{
ostringstream info;

View File

@ -28,7 +28,7 @@ CartridgeEnhancedWidget::CartridgeEnhancedWidget(GuiObject* boss, const GUI::Fon
int x, int y, int w, int h,
CartridgeEnhanced& cart)
: CartDebugWidget(boss, lfont, nfont, x, y, w, h),
myCart(cart)
myCart{cart}
{
}

View File

@ -23,7 +23,7 @@ CartridgeFA2Widget::CartridgeFA2Widget(
GuiObject* boss, const GUI::Font& lfont, const GUI::Font& nfont,
int x, int y, int w, int h, CartridgeFA2& cart)
: CartridgeEnhancedWidget(boss, lfont, nfont, x, y, w, h, cart),
myCartFA2(cart)
myCartFA2{cart}
{
int xpos = 2,
ypos = initialize();

View File

@ -20,8 +20,8 @@
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
CartridgeFCWidget::CartridgeFCWidget(
GuiObject* boss, const GUI::Font& lfont, const GUI::Font& nfont,
int x, int y, int w, int h, CartridgeFC& cart)
GuiObject* boss, const GUI::Font& lfont, const GUI::Font& nfont,
int x, int y, int w, int h, CartridgeFC& cart)
: CartridgeEnhancedWidget(boss, lfont, nfont, x, y, w, h, cart)
{
initialize();

View File

@ -24,7 +24,7 @@ CartridgeMDMWidget::CartridgeMDMWidget(
GuiObject* boss, const GUI::Font& lfont, const GUI::Font& nfont,
int x, int y, int w, int h, CartridgeMDM& cart)
: CartridgeEnhancedWidget(boss, lfont, nfont, x, y, w, h, cart),
myCartMDM(cart)
myCartMDM{cart}
{
initialize();
}

View File

@ -26,7 +26,7 @@ CartridgeMNetworkWidget::CartridgeMNetworkWidget(
int x, int y, int w, int h,
CartridgeMNetwork& cart)
: CartDebugWidget(boss, lfont, nfont, x, y, w, h),
myCart(cart)
myCart{cart}
{
}

View File

@ -33,11 +33,11 @@ CartRamWidget::CartRamWidget(
int x, int y, int w, int h, CartDebugWidget& cartDebug)
: Widget(boss, lfont, x, y, w, h),
CommandSender(boss),
_nfont(nfont),
myFontWidth(lfont.getMaxCharWidth()),
myFontHeight(lfont.getFontHeight()),
myLineHeight(lfont.getLineHeight()),
myButtonHeight(myLineHeight + 4)
_nfont{nfont},
myFontWidth{lfont.getMaxCharWidth()},
myFontHeight{lfont.getFontHeight()},
myLineHeight{lfont.getLineHeight()},
myButtonHeight{myLineHeight + 4}
{
int lwidth = lfont.getStringWidth("Description "),
fwidth = w - lwidth - 20;

View File

@ -24,7 +24,7 @@ CartridgeTVBoyWidget::CartridgeTVBoyWidget(
GuiObject* boss, const GUI::Font& lfont, const GUI::Font& nfont,
int x, int y, int w, int h, CartridgeTVBoy& cart)
: CartridgeEnhancedWidget(boss, lfont, nfont, x, y, w, h, cart),
myCartTVBoy(cart)
myCartTVBoy{cart}
{
initialize();
}

View File

@ -23,7 +23,7 @@ CartridgeUAWidget::CartridgeUAWidget(
GuiObject* boss, const GUI::Font& lfont, const GUI::Font& nfont,
int x, int y, int w, int h, CartridgeUA& cart, bool swapHotspots)
: CartridgeEnhancedWidget(boss, lfont, nfont, x, y, w, h, cart),
mySwappedHotspots(swapHotspots)
mySwappedHotspots{swapHotspots}
{
myHotspotDelta = 0x20;
initialize();

View File

@ -23,7 +23,7 @@ CartridgeWDWidget::CartridgeWDWidget(
GuiObject* boss, const GUI::Font& lfont, const GUI::Font& nfont,
int x, int y, int w, int h, CartridgeWD& cart)
: CartridgeEnhancedWidget(boss, lfont, nfont, x, y, w, h, cart),
myCartWD(cart)
myCartWD{cart}
{
initialize();
}

View File

@ -27,7 +27,7 @@ DataGridRamWidget::DataGridRamWidget(GuiObject* boss, const RamWidget& ram,
bool useScrollbar)
: DataGridWidget(boss, font, x, y, cols, rows, colchars,
bits, base, useScrollbar),
_ram(ram)
_ram{ram}
{
}

View File

@ -38,12 +38,12 @@ DataGridWidget::DataGridWidget(GuiObject* boss, const GUI::Font& font,
: EditableWidget(boss, font, x, y,
cols*(colchars * font.getMaxCharWidth() + 8) + 1,
font.getLineHeight()*rows + 1),
_rows(rows),
_cols(cols),
_rowHeight(font.getLineHeight()),
_colWidth(colchars * font.getMaxCharWidth() + 8),
_bits(bits),
_base(base)
_rows{rows},
_cols{cols},
_rowHeight{font.getLineHeight()},
_colWidth{colchars * font.getMaxCharWidth() + 8},
_bits{bits},
_base{base}
{
_flags = Widget::FLAG_ENABLED | Widget::FLAG_RETAIN_FOCUS | Widget::FLAG_WANTS_RAWDATA;
_editMode = false;

View File

@ -41,12 +41,12 @@ PromptWidget::PromptWidget(GuiObject* boss, const GUI::Font& font,
int x, int y, int w, int h)
: Widget(boss, font, x, y, w - ScrollBarWidget::scrollBarWidth(font), h),
CommandSender(boss),
_historySize(0),
_historyIndex(0),
_historyLine(0),
_makeDirty(false),
_firstTime(true),
_exitedEarly(false)
_historySize{0},
_historyIndex{0},
_historyLine{0},
_makeDirty{false},
_firstTime{true},
_exitedEarly{false}
{
_flags = Widget::FLAG_ENABLED | Widget::FLAG_CLEARBG | Widget::FLAG_RETAIN_FOCUS |
Widget::FLAG_WANTS_TAB | Widget::FLAG_WANTS_RAWDATA;

View File

@ -33,14 +33,14 @@ RamWidget::RamWidget(GuiObject* boss, const GUI::Font& lfont, const GUI::Font& n
uInt32 ramsize, uInt32 numrows, uInt32 pagesize)
: Widget(boss, lfont, x, y, w, h),
CommandSender(boss),
_nfont(nfont),
myFontWidth(lfont.getMaxCharWidth()),
myFontHeight(lfont.getFontHeight()),
myLineHeight(lfont.getLineHeight()),
myButtonHeight(myLineHeight * 1.25),
myRamSize(ramsize),
myNumRows(numrows),
myPageSize(pagesize)
_nfont{nfont},
myFontWidth{lfont.getMaxCharWidth()},
myFontHeight{lfont.getFontHeight()},
myLineHeight{lfont.getLineHeight()},
myButtonHeight{static_cast<int>(myLineHeight * 1.25)},
myRamSize{ramsize},
myNumRows{numrows},
myPageSize{pagesize}
{
const int bwidth = lfont.getStringWidth("Compare " + ELLIPSIS),
bheight = myLineHeight + 2;

View File

@ -25,7 +25,7 @@
RiotRamWidget::RiotRamWidget(GuiObject* boss, const GUI::Font& lfont,
const GUI::Font& nfont, int x, int y, int w)
: RamWidget(boss, lfont, nfont, x, y, w, 0, 128, 8, 128),
myDbg(instance().debugger().cartDebug())
myDbg{instance().debugger().cartDebug()}
{
}

View File

@ -28,7 +28,7 @@ ToggleBitWidget::ToggleBitWidget(GuiObject* boss, const GUI::Font& font,
int x, int y, int cols, int rows, int colchars,
const StringList& labels)
: ToggleWidget(boss, font, x, y, cols, rows),
_labelList(labels)
_labelList{labels}
{
_rowHeight = font.getLineHeight();
_colWidth = colchars * font.getMaxCharWidth() + 8;

View File

@ -28,9 +28,9 @@ ToggleWidget::ToggleWidget(GuiObject* boss, const GUI::Font& font,
int x, int y, int cols, int rows, int shiftBits)
: Widget(boss, font, x, y, 16, 16),
CommandSender(boss),
_rows(rows),
_cols(cols),
_shiftBits(shiftBits)
_rows{rows},
_cols{cols},
_shiftBits{shiftBits}
{
_flags = Widget::FLAG_ENABLED | Widget::FLAG_CLEARBG | Widget::FLAG_RETAIN_FOCUS |
Widget::FLAG_WANTS_RAWDATA;