From 587295186d8c905df897546058b743325fd871e6 Mon Sep 17 00:00:00 2001 From: Josh Blum Date: Thu, 24 Feb 2011 17:48:23 -0800 Subject: uhd: exception code gen simplification --- host/lib/exception.cpp | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'host/lib/exception.cpp') diff --git a/host/lib/exception.cpp b/host/lib/exception.cpp index e0d33bf48..ecb1fe768 100644 --- a/host/lib/exception.cpp +++ b/host/lib/exception.cpp @@ -21,18 +21,13 @@ using namespace uhd; -static unsigned make_code(const std::string &name){ - boost::hash string_hash; - return unsigned(string_hash(name) & 0xfff); -}; - exception::exception(const std::string &what): std::runtime_error(what){/* NOP */} #define make_exception_impl(name, class, base) \ class::class(const std::string &what): \ base(str(boost::format("%s: %s") % name % what)){} \ - unsigned class::code(void) const{return make_code(#class);} + unsigned class::code(void) const{return boost::hash()(#class) & 0xfff;} make_exception_impl("AssertionError", assertion_error, exception) make_exception_impl("LookupError", lookup_error, exception) -- cgit v1.2.3