Using AStyle of all the C and C++ source and header files - gsl-shell.git - gsl-shell

index : gsl-shell.git
gsl-shell
summary refs log tree commit diff
path: root/agg-plot/lua-cpp-utils.h
diff options
context:
space:
mode:
authorFrancesco Abbate <francesco.bbt@gmail.com>2012年10月15日 13:11:54 +0200
committerFrancesco Abbate <francesco.bbt@gmail.com>2012年10月15日 13:11:54 +0200
commit137e4d264c73b3087a5d0968362c5b9ca3108f2d (patch)
treea80691d187615ec2e63f25182be7895b9a8a313f /agg-plot/lua-cpp-utils.h
parent7d157c5bd8ddf920094907a35c9329ce0688e3d4 (diff)
downloadgsl-shell-137e4d264c73b3087a5d0968362c5b9ca3108f2d.tar.gz
Using AStyle of all the C and C++ source and header files
Using default AStyle formatting, "allman" style.
Diffstat (limited to 'agg-plot/lua-cpp-utils.h')
-rw-r--r--agg-plot/lua-cpp-utils.h 42
1 files changed, 24 insertions, 18 deletions
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 <class T>
T* push_new_object (lua_State *L, enum gs_type_e tp)
{
- return new(L, tp) T();
+ return new(L, tp) T();
}
template <class T, class init_type>
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 <class T>
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 <class T>
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
generated by cgit v1.2.3 (git 2.39.1) at 2025年09月14日 12:14:29 +0000

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