diff options
author | Josh Blum <josh@joshknows.com> | 2011-02-24 17:48:23 -0800 |
---|---|---|
committer | Josh Blum <josh@joshknows.com> | 2011-02-24 17:48:23 -0800 |
commit | 587295186d8c905df897546058b743325fd871e6 (patch) | |
tree | a0829b5c5e3447271e29f7603a3371ee9c6afaf3 /host/lib/exception.cpp | |
parent | 1526889803f2fc909d97c16b59323107db184381 (diff) | |
download | uhd-587295186d8c905df897546058b743325fd871e6.tar.gz uhd-587295186d8c905df897546058b743325fd871e6.tar.bz2 uhd-587295186d8c905df897546058b743325fd871e6.zip |
uhd: exception code gen simplification
Diffstat (limited to 'host/lib/exception.cpp')
-rw-r--r-- | host/lib/exception.cpp | 7 |
1 files changed, 1 insertions, 6 deletions
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<std::string> 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<std::string>()(#class) & 0xfff;} make_exception_impl("AssertionError", assertion_error, exception) make_exception_impl("LookupError", lookup_error, exception) |