Remove struct unieque_fd
authorKazumasa Mitsunari <knimitz@witz-inc.co.jp>
Wed, 22 Aug 2018 04:49:31 +0000 (13:49 +0900)
committerKazumasa Mitsunari <knimitz@witz-inc.co.jp>
Wed, 22 Aug 2018 05:04:27 +0000 (14:04 +0900)
Any code doesn't use it anymore.

Change-Id: I64a3d518d12d33e399261678f715aa466d6df6a3
Signed-off-by: Kazumasa Mitsunari <knimitz@witz-inc.co.jp>
src/util.cpp
src/util.hpp

index be1a046..37977f2 100644 (file)
 
 static char ERROR_FLAG[6][20] = {"NONE", "ERROR", "WARNING", "NOTICE", "INFO", "DEBUG"};
 
-unique_fd::~unique_fd()
-{
-    if (this->fd != -1)
-    {
-        close(this->fd);
-    }
-}
-
 void rectangle::fit(unsigned long to_width, unsigned long to_height)
 {
     // fit rect within (to_width x to_height)
index 812a130..418e7e4 100644 (file)
@@ -52,26 +52,6 @@ void _HMI_LOG(enum LOG_LEVEL level, const char* file, const char* func, const in
 void _HMI_SEQ_LOG(enum LOG_LEVEL level, const char* file, const char* func, const int line, unsigned seq_num, const char* log, ...);
 void _DUMP(enum LOG_LEVEL level, const char *log, ...);
 
-/**
- * @struct unique_fd
- */
-struct unique_fd
-{
-    int fd{-1};
-    unique_fd() = default;
-    explicit unique_fd(int f) : fd{f} {}
-    operator int() const { return fd; }
-    ~unique_fd();
-    unique_fd(unique_fd const &) = delete;
-    unique_fd &operator=(unique_fd const &) = delete;
-    unique_fd(unique_fd &&o) : fd(o.fd) { o.fd = -1; }
-    unique_fd &operator=(unique_fd &&o)
-    {
-        std::swap(this->fd, o.fd);
-        return *this;
-    }
-};
-
 class rectangle
 {
   public: