Fixed some warnings from clang.

Just checking on the progress; looking good so far.
This commit is contained in:
Stephen Anthony 2020-04-12 19:15:07 -02:30
parent eae35042fa
commit 3e6780d6bb
9 changed files with 10 additions and 17 deletions

View File

@ -73,7 +73,7 @@ class Cartridge2K : public CartridgeEnhanced
#endif
private:
bool checkSwitchBank(uInt16 address, uInt8 value = 0) override { return false; };
bool checkSwitchBank(uInt16 address, uInt8 value = 0) override { return false; }
private:
// Following constructors and assignment operators not supported

View File

@ -70,7 +70,7 @@ class Cartridge4K : public CartridgeEnhanced
#endif
private:
bool checkSwitchBank(uInt16 address, uInt8 value = 0) override { return false; };
bool checkSwitchBank(uInt16 address, uInt8 value = 0) override { return false; }
private:
// Following constructors and assignment operators not supported

View File

@ -27,7 +27,6 @@ CartridgeCV::CartridgeCV(const ByteBuffer& image, size_t size,
myRamSize = RAM_SIZE;
myRamWpHigh = RAM_HIGH_WP;
if(mySize == 4_KB)
{
// The game has something saved in the RAM
@ -40,7 +39,6 @@ CartridgeCV::CartridgeCV(const ByteBuffer& image, size_t size,
// Copy the ROM image into my buffer
std::copy_n(image.get() + mySize, mySize, myImage.get());
myInitialRAM = make_unique<uInt8[]>(1_KB);
// Copy the RAM image into a buffer for use in reset()
std::copy_n(image.get(), 1_KB, myInitialRAM.get());

View File

@ -78,7 +78,7 @@ class CartridgeCV : public CartridgeEnhanced
#endif
private:
bool checkSwitchBank(uInt16, uInt8 = 0) override { return false; };
bool checkSwitchBank(uInt16, uInt8 = 0) override { return false; }
protected:
// Initial RAM data from the cart (doesn't always exist)

View File

@ -951,14 +951,13 @@ bool CartDetector::isProbablyFC(const ByteBuffer& image, size_t size)
{ 0x8d, 0xf8, 0xff, 0x8d, 0xfc, 0xff }, // STA $FFF8, STA $FFFC Surf's Up (4K)
{ 0x8c, 0xf9, 0xff, 0xad, 0xfc, 0xff } // STY $FFF9, LDA $FFFC 3-D Havoc
};
for (uInt32 i = 0; i < 3; ++i)
if (searchForBytes(image.get(), size, signature[i], 6, 1))
for(uInt32 i = 0; i < 3; ++i)
if(searchForBytes(image.get(), size, signature[i], 6, 1))
return true;
return false;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
bool CartDetector::isProbablyFE(const ByteBuffer& image, size_t size)
{
@ -1032,7 +1031,6 @@ bool CartDetector::isProbablyWD(const ByteBuffer& image, size_t size)
return searchForBytes(image.get(), size, signature[0], 3, 1);
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
bool CartDetector::isProbablyX07(const ByteBuffer& image, size_t size)
{

View File

@ -110,7 +110,7 @@ uInt8 CartridgeEnhanced::peek(uInt16 address)
// Write port is e.g. at 0xF000 - 0xF07F (128 bytes)
if(address < myReadOffset + myRamSize && address >= myReadOffset)
// This is a read accees to a write port!
// This is a read access to a write port!
return peekRAM(myRAM[address], peekAddress);
else
return myImage[myCurrentSegOffset[(peekAddress & 0xFFF) >> myBankShift] + address];
@ -233,7 +233,6 @@ bool CartridgeEnhanced::save(Serializer& out) const
out.putIntArray(myCurrentSegOffset.get(), myBankSegs);
if(myRamSize)
out.putByteArray(myRAM.get(), myRamSize);
}
catch(...)
{

View File

@ -57,7 +57,6 @@ class CartridgeEnhanced : public Cartridge
*/
void reset() override;
/**
Install pages for the specified bank in the system.

View File

@ -49,11 +49,10 @@ bool CartridgeFA2::checkSwitchBank(uInt16 address, uInt8)
}
return false;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
uInt8 CartridgeFA2::peek(uInt16 address)
{
if((address & 0x0FFF) == 0x0FF4)
{
// Load/save RAM to/from Harmony cart flash

View File

@ -59,13 +59,14 @@ class CartridgeUA : public CartridgeEnhanced
*/
void install(System& system) override;
/**
Get a descriptor for the device name (used in error checking).
@return The name of the object
*/
string name() const override { return mySwappedHotspots ? "CartridgeUASW" : "CartridgeUA"; }
string name() const override {
return mySwappedHotspots ? "CartridgeUASW" : "CartridgeUA";
}
#ifdef DEBUGGER_SUPPORT
/**
@ -96,7 +97,6 @@ class CartridgeUA : public CartridgeEnhanced
*/
bool poke(uInt16 address, uInt8 value) override;
private:
bool checkSwitchBank(uInt16 address, uInt8 value = 0) override;