From 137e4d264c73b3087a5d0968362c5b9ca3108f2d Mon Sep 17 00:00:00 2001 From: Francesco Abbate Date: 2012年10月15日 13:11:54 +0200 Subject: Using AStyle of all the C and C++ source and header files Using default AStyle formatting, "allman" style. --- agg-plot/lua-cpp-utils.h | 42 ++++++++++++++++++++++++------------------ 1 file changed, 24 insertions(+), 18 deletions(-) (limited to 'agg-plot/lua-cpp-utils.h') diff --git a/agg-plot/lua-cpp-utils.h b/agg-plot/lua-cpp-utils.h index 5b7f754f..8f18d5a9 100644 --- a/agg-plot/lua-cpp-utils.h +++ b/agg-plot/lua-cpp-utils.h @@ -13,58 +13,64 @@ __END_DECLS namespace gslshell { - class ret_status { +class ret_status { bool m_success; const char *m_error_msg; const char *m_context; - public: +public: ret_status() : m_success(true) {}; - void success() { m_success = true; } + void success() { + m_success = true; + } void error(const char *msg, const char *ctx) { - m_success = false; - m_error_msg = msg; - m_context = ctx; + m_success = false; + m_error_msg = msg; + m_context = ctx; }; - const char *error_msg() const { return (m_success ? 0 : m_error_msg); }; - const char *context() const { return (m_success ? 0 : m_context); }; - }; + const char *error_msg() const { + return (m_success ? 0 : m_error_msg); + }; + const char *context() const { + return (m_success ? 0 : m_context); + }; +}; } inline void* operator new(size_t nbytes, lua_State *L, enum gs_type_e tp) { - void* p = lua_newuserdata(L, nbytes); - gs_set_metatable (L, tp); - return p; + void* p = lua_newuserdata(L, nbytes); + gs_set_metatable (L, tp); + return p; } template T* push_new_object (lua_State *L, enum gs_type_e tp) { - return new(L, tp) T(); + return new(L, tp) T(); } template T* push_new_object (lua_State *L, enum gs_type_e tp, init_type& init) { - return new(L, tp) T(init); + return new(L, tp) T(init); } template int object_free (lua_State *L, int index, enum gs_type_e tp) { - T *obj = (T *) gs_check_userdata (L, index, tp); - obj->~T(); - return 0; + T *obj = (T *) gs_check_userdata (L, index, tp); + obj->~T(); + return 0; } template T* object_check (lua_State *L, int index, enum gs_type_e tp) { - return (T *) gs_check_userdata (L, index, tp); + return (T *) gs_check_userdata (L, index, tp); } #endif -- cgit v1.2.3

AltStyle によって変換されたページ (->オリジナル) /