Call to virtual method ... during construction bypasses virtual dispatch (scan-build / clang analyzer)
This commit is contained in:
parent
6d7f3d9512
commit
e07d0589ee
2 changed files with 11 additions and 4 deletions
12
tm-11.cpp
12
tm-11.cpp
|
@ -10,11 +10,8 @@
|
|||
#include "memory.h"
|
||||
#include "utils.h"
|
||||
|
||||
tm_11::tm_11(const std::string & file, memory *const m) : m(m)
|
||||
tm_11::tm_11(const std::string & file, memory *const m): file(file), m(m)
|
||||
{
|
||||
fh = fopen(file.c_str(), "rb");
|
||||
|
||||
reset();
|
||||
}
|
||||
|
||||
tm_11::~tm_11()
|
||||
|
@ -22,6 +19,13 @@ tm_11::~tm_11()
|
|||
fclose(fh);
|
||||
}
|
||||
|
||||
void tm_11::begin()
|
||||
{
|
||||
fh = fopen(file.c_str(), "rb");
|
||||
|
||||
reset();
|
||||
}
|
||||
|
||||
void tm_11::reset()
|
||||
{
|
||||
memset(registers, 0x00, sizeof registers );
|
||||
|
|
3
tm-11.h
3
tm-11.h
|
@ -24,6 +24,7 @@ class memory;
|
|||
class tm_11 : public device
|
||||
{
|
||||
private:
|
||||
std::string file;
|
||||
memory *const m { nullptr };
|
||||
uint16_t registers[6] { 0 };
|
||||
uint8_t xfer_buffer[65536];
|
||||
|
@ -34,6 +35,8 @@ public:
|
|||
tm_11(const std::string & file, memory *const m);
|
||||
virtual ~tm_11();
|
||||
|
||||
void begin();
|
||||
|
||||
void reset() override;
|
||||
|
||||
uint8_t readByte(const uint16_t addr) override;
|
||||
|
|
Loading…
Add table
Reference in a new issue