From: Martin Quinson Date: Fri, 24 Aug 2018 16:57:27 +0000 (+0200) Subject: rename fields to end with _ X-Git-Tag: v3_21~183 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/48f46e76198d52242d85b84dae45a70597931088?ds=sidebyside rename fields to end with _ --- diff --git a/include/xbt/exception.hpp b/include/xbt/exception.hpp index edc0221d11..65b0990aaf 100644 --- a/include/xbt/exception.hpp +++ b/include/xbt/exception.hpp @@ -33,7 +33,7 @@ namespace xbt { */ typedef std::vector Backtrace; -/** The location of where an exception has been throwed +/** The location of where an exception has been thrown * * This is a tuple (__FILE__, __LINE__, __func__) and can be created with * @ref XBT_THROW_POINT. @@ -43,10 +43,12 @@ typedef std::vector Backtrace; class ThrowPoint { public: ThrowPoint() = default; - explicit ThrowPoint(const char* file, int line, const char* function) : file(file), line(line), function(function) {} - const char* file = nullptr; - int line = 0; - const char* function = nullptr; + explicit ThrowPoint(const char* file, int line, const char* function) : file_(file), line_(line), function_(function) + { + } + const char* file_ = nullptr; + int line_ = 0; + const char* function_ = nullptr; }; /** Create a ThrowPoint with (__FILE__, __LINE__, __func__) */ @@ -56,13 +58,6 @@ class ThrowPoint { * * This is a base class for exceptions which store additional contextual * information: backtrace, throw point, simulated process name, PID, etc. - * - * You are not expected to inherit from it. Instead of you use should - * @ref XBT_THROW an exception which will throw a subclass of your original - * exception with those additional features. - * - * However, you can try `dynamic_cast` an exception to this type in order to - * get contextual information about the exception. */ class XBT_PUBLIC WithContextException { public: diff --git a/src/xbt/cunit.cpp b/src/xbt/cunit.cpp index 586173e634..4a4fd78776 100644 --- a/src/xbt/cunit.cpp +++ b/src/xbt/cunit.cpp @@ -581,7 +581,7 @@ void _xbt_test_fail(const char *file, int line, const char *fmt, ...) void xbt_test_exception(xbt_ex_t e) { - _xbt_test_fail(e.throw_point().file, e.throw_point().line, "Exception %s raised: %s", xbt_ex_catname(e.category), + _xbt_test_fail(e.throw_point().file_, e.throw_point().line_, "Exception %s raised: %s", xbt_ex_catname(e.category), e.what()); }