summaryrefslogtreecommitdiffstatshomepage
path: root/src
diff options
context:
space:
mode:
author balr0g <balrog032@gmail.com>2015-05-15 21:59:56 -0400
committer balr0g <balrog032@gmail.com>2015-05-16 15:48:02 -0400
commit53635d12d7760da4713a5b26705ec0b0d0335ce7 (patch)
tree910d278b5833cb06b53c6466d8455ed623077438 /src
parent9aa1670e6f826f4eb69eaa19eb1f4445207219bd (diff)
Remove unnecessary null checks (nw)
Diffstat (limited to 'src')
-rw-r--r--src/emu/device.c20
-rw-r--r--src/emu/device.h8
-rw-r--r--src/emu/memory.h2
3 files changed, 1 insertions, 29 deletions
diff --git a/src/emu/device.c b/src/emu/device.c
index 5eeee60c9a3..d1f0e389cb4 100644
--- a/src/emu/device.c
+++ b/src/emu/device.c
@@ -124,10 +124,6 @@ device_t::~device_t()
memory_region *device_t::memregion(const char *_tag) const
{
- // safety first
- if (this == NULL)
- return NULL;
-
// build a fully-qualified name and look it up
return machine().memory().region(subtag(_tag).c_str());
}
@@ -140,10 +136,6 @@ memory_region *device_t::memregion(const char *_tag) const
memory_share *device_t::memshare(const char *_tag) const
{
- // safety first
- if (this == NULL)
- return NULL;
-
// build a fully-qualified name and look it up
return machine().memory().shared(subtag(_tag).c_str());
}
@@ -156,10 +148,6 @@ memory_share *device_t::memshare(const char *_tag) const
memory_bank *device_t::membank(const char *_tag) const
{
- // safety first
- if (this == NULL)
- return NULL;
-
// build a fully-qualified name and look it up
return machine().memory().bank(subtag(_tag).c_str());
}
@@ -172,10 +160,6 @@ memory_bank *device_t::membank(const char *_tag) const
ioport_port *device_t::ioport(const char *tag) const
{
- // safety first
- if (this == NULL)
- return NULL;
-
// build a fully-qualified name and look it up
return machine().ioport().port(subtag(tag).c_str());
}
@@ -188,10 +172,6 @@ ioport_port *device_t::ioport(const char *tag) const
std::string device_t::parameter(const char *tag) const
{
- // safety first
- if (this == NULL)
- return NULL;
-
// build a fully-qualified name and look it up
return machine().parameters().lookup(subtag(tag));
}
diff --git a/src/emu/device.h b/src/emu/device.h
index b6b245c8490..438e590afc6 100644
--- a/src/emu/device.h
+++ b/src/emu/device.h
@@ -584,10 +584,6 @@ private:
inline device_t *device_t::subdevice(const char *tag) const
{
- // safety first
- if (this == NULL)
- return NULL;
-
// empty string or NULL means this device
if (tag == NULL || *tag == 0)
return const_cast<device_t *>(this);
@@ -605,10 +601,6 @@ inline device_t *device_t::subdevice(const char *tag) const
inline device_t *device_t::siblingdevice(const char *tag) const
{
- // safety first
- if (this == NULL)
- return NULL;
-
// empty string or NULL means this device
if (tag == NULL || *tag == 0)
return const_cast<device_t *>(this);
diff --git a/src/emu/memory.h b/src/emu/memory.h
index 7503301453e..8bb32d636d3 100644
--- a/src/emu/memory.h
+++ b/src/emu/memory.h
@@ -653,7 +653,7 @@ public:
// getters
memory_share *next() const { return m_next; }
- void *ptr() const { if (this == NULL) return NULL; return m_ptr; }
+ void *ptr() const { return m_ptr; }
size_t bytes() const { return m_bytes; }
endianness_t endianness() const { return m_endianness; }
UINT8 bitwidth() const { return m_bitwidth; }