From ba53ea9f51453154bca13c57988a17e009e80476 Mon Sep 17 00:00:00 2001 From: Tim Moore Date: Wed, 11 Jun 2008 14:46:34 +0200 Subject: Fix some logic inversions with dwfl_assert. --- dwarf_wrappers.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'dwarf_wrappers.h') diff --git a/dwarf_wrappers.h b/dwarf_wrappers.h index 043c2957..c498de05 100644 --- a/dwarf_wrappers.h +++ b/dwarf_wrappers.h @@ -15,6 +15,7 @@ // NB: "rc == 0" means OK in this case void dwfl_assert(const std::string& desc, int rc); +// Throw error if pointer is NULL. template void dwfl_assert(const std::string& desc, T* ptr) { @@ -22,6 +23,7 @@ void dwfl_assert(const std::string& desc, T* ptr) dwfl_assert(desc, -1); } +// Throw error if pointer is NULL template void dwfl_assert(const std::string& desc, const T* ptr) { @@ -29,9 +31,13 @@ void dwfl_assert(const std::string& desc, const T* ptr) dwfl_assert(desc, -1); } +// Throw error if condition is false +void dwfl_assert(const std::string& desc, bool condition); + // NB: "rc == 0" means OK in this case void dwarf_assert(const std::string& desc, int rc); +// Throw error if pointer is NULL template void dwarf_assert(const std::string& desc, T* ptr) { -- cgit