diff --git a/src/uvw/handle.hpp b/src/uvw/handle.hpp index 855c38fc..b1c223f2 100644 --- a/src/uvw/handle.hpp +++ b/src/uvw/handle.hpp @@ -25,7 +25,7 @@ protected: static void close_callback(uv_handle_t *hndl) { handle &ref = *(static_cast(hndl->data)); [[maybe_unused]] auto ptr = ref.shared_from_this(); - ref.reset(); + ref.self_reset(); ref.publish(close_event{}); } diff --git a/src/uvw/request.hpp b/src/uvw/request.hpp index fa3a7896..39f50157 100644 --- a/src/uvw/request.hpp +++ b/src/uvw/request.hpp @@ -20,7 +20,7 @@ class request: public resource { protected: static auto reserve(U *req) { auto ptr = static_cast(req->data)->shared_from_this(); - ptr->reset(); + ptr->self_reset(); return ptr; } diff --git a/src/uvw/resource.hpp b/src/uvw/resource.hpp index 49f15e6b..07b929f4 100644 --- a/src/uvw/resource.hpp +++ b/src/uvw/resource.hpp @@ -25,11 +25,11 @@ protected: return err; } - void reset() noexcept { + void self_reset() noexcept { self_ptr.reset(); } - bool self() const noexcept { + bool has_self() const noexcept { return static_cast(self_ptr); } diff --git a/src/uvw/tty.cpp b/src/uvw/tty.cpp index 2e801248..09e83a4f 100644 --- a/src/uvw/tty.cpp +++ b/src/uvw/tty.cpp @@ -32,7 +32,7 @@ UVW_INLINE bool tty_handle::mode(tty_handle::tty_mode m) { return (0 == uv_tty_set_mode(raw(), static_cast(m))); } -UVW_INLINE bool tty_handle::reset() noexcept { +UVW_INLINE bool tty_handle::reset_mode() noexcept { return (0 == uv_tty_reset_mode()); } diff --git a/src/uvw/tty.h b/src/uvw/tty.h index 0bb8ade6..387585d2 100644 --- a/src/uvw/tty.h +++ b/src/uvw/tty.h @@ -84,7 +84,7 @@ public: * @brief Resets TTY settings to default values. * @return True in case of success, false otherwise. */ - bool reset() noexcept; + bool reset_mode() noexcept; /** * @brief Gets the current Window size. diff --git a/test/uvw/tty.cpp b/test/uvw/tty.cpp index 27731d52..fb7ec357 100644 --- a/test/uvw/tty.cpp +++ b/test/uvw/tty.cpp @@ -23,7 +23,7 @@ TEST(TTY, Functionalities) { hndl.close(); }); - ASSERT_TRUE(handle->reset()); + ASSERT_TRUE(handle->reset_mode()); ASSERT_TRUE(!handle->readable() || handle->mode(uvw::tty_handle::tty_mode::NORMAL)); ASSERT_NO_THROW(handle->get_win_size());