Skip to content

Commit

Permalink
Merge master into feature/win32-msvc
Browse files Browse the repository at this point in the history
  • Loading branch information
kazssym committed Dec 27, 2020
2 parents c72c424 + 713757f commit 971db52
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 32 deletions.
34 changes: 9 additions & 25 deletions libvm68kapi/bits/vm68k/memory_exception.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,11 @@ namespace vm68k
function_code _fc;

private:
memory_map::address_type _fault_address;
memory_map::address_type _address;

public:
memory_exception(function_code fc,
memory_map::address_type fault_address) noexcept;
memory_exception(function_code fc, memory_map::address_type address)
noexcept;

memory_exception(const memory_exception &other) noexcept;

Expand All @@ -54,9 +54,9 @@ namespace vm68k
}

public:
memory_map::address_type fault_address() const noexcept
memory_map::address_type address() const noexcept
{
return _fault_address;
return _address;
}

public:
Expand All @@ -69,16 +69,8 @@ namespace vm68k
class _VM68KAPI_PUBLIC bus_error: public memory_exception
{
public:
bus_error(function_code fc,
memory_map::address_type fault_address) noexcept
:
memory_exception(fc, fault_address)
{
// Nothing to do.
}

public:
virtual ~bus_error();
bus_error(function_code fc, memory_map::address_type address)
noexcept;

public:
virtual const char *what() const noexcept override;
Expand All @@ -90,16 +82,8 @@ namespace vm68k
class _VM68KAPI_PUBLIC address_error: public memory_exception
{
public:
address_error(function_code fc,
memory_map::address_type fault_address) noexcept
:
memory_exception(fc, fault_address)
{
// Nothing to do.
}

public:
virtual ~address_error();
address_error(function_code fc, memory_map::address_type address)
noexcept;

public:
virtual const char *what() const noexcept override;
Expand Down
21 changes: 14 additions & 7 deletions libvm68kapi/memory_exception.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@ using namespace vm68k;
// Implementation of class memory_exception.

memory_exception::memory_exception(const function_code fc,
const memory_map::address_type fault_address) noexcept
const memory_map::address_type address) noexcept
:
_fc {fc},
_fault_address {fault_address}
_address {address}
{
// Nothing to do.
}
Expand All @@ -40,7 +40,7 @@ memory_exception::memory_exception(const memory_exception &other) noexcept
:
exception(other),
_fc {other._fc},
_fault_address {other._fault_address}
_address {other._address}
{
// Nothing to do.
}
Expand All @@ -50,11 +50,12 @@ memory_exception::~memory_exception()
// Nothing to do.
}

memory_exception &memory_exception::operator =(const memory_exception &other) noexcept
memory_exception &memory_exception::operator =(const memory_exception &other)
noexcept
{
if (this != &other) {
exception::operator =(other);
_fault_address = other._fault_address;
_address = other._address;
}
return *this;
}
Expand All @@ -67,7 +68,10 @@ const char *memory_exception::what() const noexcept

// Implementation of class bus_error.

bus_error::~bus_error()
bus_error::bus_error(const function_code fc,
const memory_map::address_type address) noexcept
:
memory_exception(fc, address)
{
// Nothing to do.
}
Expand All @@ -80,7 +84,10 @@ const char *bus_error::what() const noexcept

// Implementation of class address_error.

address_error::~address_error()
address_error::address_error(const function_code fc,
const memory_map::address_type address) noexcept
:
memory_exception(fc, address)
{
// Nothing to do.
}
Expand Down

0 comments on commit 971db52

Please sign in to comment.