From 9a3ca2e3c100d426d8672fd6fb6bfa8361935ac7 Mon Sep 17 00:00:00 2001 From: hyung-hwan Date: Tue, 10 Mar 2015 09:00:21 +0000 Subject: [PATCH] changed Awk and Sed to inherit Uncopyable --- qse/include/qse/Hashable.hpp | 4 ++-- qse/include/qse/SharedPtr.hpp | 6 +++--- qse/include/qse/awk/Awk.hpp | 7 ++----- qse/include/qse/sed/Sed.hpp | 9 +++------ qse/lib/awk/Awk.cpp | 2 +- 5 files changed, 11 insertions(+), 17 deletions(-) diff --git a/qse/include/qse/Hashable.hpp b/qse/include/qse/Hashable.hpp index 71cdb5fe..928f588c 100644 --- a/qse/include/qse/Hashable.hpp +++ b/qse/include/qse/Hashable.hpp @@ -57,7 +57,7 @@ public: static qse_size_t getHashCode (const qse_char_t* str) { - return getHashCode (0, str); + return this->getHashCode (0, str); } static qse_size_t getHashCode (qse_size_t init, const void* data, qse_size_t size) @@ -88,7 +88,7 @@ public: static qse_size_t getHashCode (const void* data, qse_size_t size) { - return getHashCode (0, data, size); + return this->getHashCode (0, data, size); } }; diff --git a/qse/include/qse/SharedPtr.hpp b/qse/include/qse/SharedPtr.hpp index 81cbaf22..fb851255 100644 --- a/qse/include/qse/SharedPtr.hpp +++ b/qse/include/qse/SharedPtr.hpp @@ -153,9 +153,9 @@ public: protected: qse_size_t* _ref; - T* _ptr; - void* _darg; - DELETER deleter; + T* _ptr; + void* _darg; + DELETER deleter; }; ///////////////////////////////// diff --git a/qse/include/qse/awk/Awk.hpp b/qse/include/qse/awk/Awk.hpp index f789b921..99a883c0 100644 --- a/qse/include/qse/awk/Awk.hpp +++ b/qse/include/qse/awk/Awk.hpp @@ -30,6 +30,7 @@ #include #include #include +#include #include #include #include @@ -45,7 +46,7 @@ QSE_BEGIN_NAMESPACE(QSE) /// The Awk class implements an AWK interpreter by wrapping around /// #qse_awk_t and #qse_awk_rtx_t. /// -class QSE_EXPORT Awk: public Types, public Mmged +class QSE_EXPORT Awk: public Uncopyable, public Types, public Mmged { public: typedef qse_htb_t htb_t; @@ -1363,10 +1364,6 @@ private: int dispatch_function (Run* run, const fnc_info_t* fi); static const char_t* xerrstr (const awk_t* a, errnum_t num); - -private: - Awk (const Awk&); - Awk& operator= (const Awk&); }; ///////////////////////////////// diff --git a/qse/include/qse/sed/Sed.hpp b/qse/include/qse/sed/Sed.hpp index 1779ae32..3f46b62e 100644 --- a/qse/include/qse/sed/Sed.hpp +++ b/qse/include/qse/sed/Sed.hpp @@ -27,6 +27,7 @@ #ifndef _QSE_SED_SED_HPP_ #define _QSE_SED_SED_HPP_ +#include #include #include #include @@ -46,12 +47,12 @@ QSE_BEGIN_NAMESPACE(QSE) /// /// The Sed class implements a stream editor by wrapping around #qse_sed_t. /// -class QSE_EXPORT Sed: public Types, public Mmged +class QSE_EXPORT Sed: public Uncopyable, public Types, public Mmged { public: /// The sed_t type redefines a stream editor type typedef qse_sed_t sed_t; - /// The loc_t type redefines the location type + /// The loc_t type redefines the location type typedef qse_sed_loc_t loc_t; /// The errnum_t type redefines an error number type typedef qse_sed_errnum_t errnum_t; @@ -312,10 +313,6 @@ private: static ssize_t xout ( sed_t* s, io_cmd_t cmd, io_arg_t* arg, char_t* dat, size_t len); static const char_t* xerrstr (const sed_t* s, errnum_t num); - -private: - Sed (const Sed&); - Sed& operator= (const Sed&); }; ///////////////////////////////// diff --git a/qse/lib/awk/Awk.cpp b/qse/lib/awk/Awk.cpp index c0c51f9d..83004493 100644 --- a/qse/lib/awk/Awk.cpp +++ b/qse/lib/awk/Awk.cpp @@ -1383,7 +1383,7 @@ int Awk::dispatch_function (Run* run, const fnc_info_t* fi) } FunctionHandler handler; - handler = *(FunctionHandler*)QSE_HTB_VPTR(pair); + handler = *(FunctionHandler*)QSE_HTB_VPTR(pair); size_t i, nargs = qse_awk_rtx_getnargs(run->rtx);