Start using some C++ 14 features.

This commit is contained in:
Markus F.X.J. Oberhumer
2020-12-08 05:40:17 +01:00
parent 361a3056cb
commit f7e2266c3f
62 changed files with 971 additions and 960 deletions
+7 -7
View File
@@ -36,7 +36,7 @@
unsigned long Throwable::counter = 0;
Throwable::Throwable(const char *m, int e, bool w) noexcept
: super(), msg(NULL), err(e), is_warning(w)
: super(), msg(nullptr), err(e), is_warning(w)
{
if (m)
msg = strdup(m);
@@ -48,7 +48,7 @@ Throwable::Throwable(const char *m, int e, bool w) noexcept
Throwable::Throwable(const Throwable &other) noexcept
: super(other), msg(NULL), err(other.err), is_warning(other.is_warning)
: super(other), msg(nullptr), err(other.err), is_warning(other.is_warning)
{
if (other.msg)
msg = strdup(other.msg);
@@ -112,7 +112,7 @@ void throwAlreadyPacked(const char *msg)
void throwAlreadyPackedByUPX(const char *msg)
{
if (msg == NULL)
if (msg == nullptr)
msg = "already packed by UPX";
throwAlreadyPacked(msg);
}
@@ -130,7 +130,7 @@ void throwCantUnpack(const char *msg)
void throwNotPacked(const char *msg)
{
if (msg == NULL)
if (msg == nullptr)
msg = "not packed by UPX";
throw NotPackedException(msg);
}
@@ -163,7 +163,7 @@ void throwBadLoader()
void throwOutOfMemoryException(const char *msg)
{
if (msg == NULL)
if (msg == nullptr)
msg = "out of memory";
throw OutOfMemoryException(msg);
}
@@ -177,7 +177,7 @@ void throwIOException(const char *msg, int e)
void throwEOFException(const char *msg, int e)
{
if (msg == NULL && e == 0)
if (msg == nullptr && e == 0)
msg = "premature end of file";
throw EOFException(msg, e);
}
@@ -189,7 +189,7 @@ void throwEOFException(const char *msg, int e)
const char *prettyName(const char *n) noexcept
{
if (n == NULL)
if (n == nullptr)
return "(null)";
while (*n)
{