Commit Graph

22 Commits

Author SHA1 Message Date
Daniel Pfeifer 58c5f77837 clang-tidy: fix readability-redundant-* warnings 2024-10-11 15:37:21 +02:00
Brad King 47fbb29ad7 cmUVHandlePtr: Fix conversion to bool on Oracle Studio compiler
The operator added by commit 17690558c3 (cmUVHandlePtr: Add explicit
conversion to bool, 2023-10-26) works in direct expressions like
`if(foo)` but not compound expressions like `if(foo && ...)`.
Drop the `explicit` mark when compiling with Oracle Studio so we
can at least compile valid code.
2023-12-02 06:37:40 -05:00
Brad King 7ee5fb01c6 cmUVHandlePtr: Add uv_write wrapper to manage request lifetime
Provide a way to synchronously cancel a write request callback.
2023-11-22 07:12:38 -05:00
Brad King bec0dd93a3 cmUVHandlePtr: Add explicit uv_loop_ptr::operator*
Previously the dereferencing operator was implicitly available
due to `operator uv_loop_t*() const`.  Make it explicit.
2023-11-21 13:53:23 -05:00
Brad King fb7ee82271 cmUVHandlePtr: Add uv_idle_ptr::{start,stop} methods
These were missing w.r.t. the pattern established for other handle wrappers.
2023-11-20 18:22:53 -05:00
Brad King 9dd14b2946 cmUVHandlePtr: Add uv_timer_ptr::stop method
This was missing w.r.t. the pattern established for other handle wrappers.
2023-11-20 18:22:30 -05:00
Brad King 70d88a5361 cmUVHandlePtr: Add uv_idle_ptr
Wrap a `uv_idle_t` handle.
2023-11-17 08:51:25 -05:00
Brad King 17690558c3 cmUVHandlePtr: Add explicit conversion to bool 2023-11-17 08:50:53 -05:00
Brad King cd2894a089 cmUVHandlePtr: Conversions to raw pointers are const 2023-11-17 08:50:53 -05:00
Sean McBride 907d098838 Source: Fix clang -Wextra-semi warnings 2021-09-28 09:59:24 -04:00
Ben Boeckel c826461d9c clang-tidy: fix bugprone-reserved-identifier warnings 2021-01-27 08:45:44 -05:00
Oleksandr Koval 209daa20b2 Code style: add missed explicit 'this->'
CMake uses explicit 'this->' style. Using custom clang-tidy check we can
detect and fix places where 'this->' was missed.
2021-01-05 14:32:36 +02:00
Marc Chevrier 2faa3f6c55 Refactoring: Third-parties public headers are under cm3p prefix
Fixes: #20666
2020-05-07 12:06:08 +02:00
Regina Pfeifer 62e5f72289 clang-tidy: Replace typedef with using 2019-09-03 13:21:26 -04:00
Kyle Edwards 8cfd25db71 cmUVHandlePtr: Add cm::uv_loop_ptr 2019-04-25 12:03:08 -04:00
Regina Pfeifer b05b778a2d clang-tidy: Use = delete 2019-01-29 14:09:21 -05:00
Regina Pfeifer 55671b41d2 clang-tidy: Use = default
Suppress some cases in `Source/cmGeneratorExpressionNode.cxx` and
`Source/cmUVHandlePtr.h` where a few older compilers require a
user-defined default constructor (with `{}`).
2019-01-25 06:44:32 -05:00
Regina Pfeifer 7ffa6bf999 cmUVHandlePtr: Use inherited constructors 2018-12-15 10:23:23 +01:00
Kitware Robot d7204e649e Revise C++ coding style using clang-format-6.0
Run the `clang-format.bash` script to update all our C and C++ code to a
new style defined by `.clang-format`.  Use `clang-format` version 6.0.

* If you reached this commit for a line in `git blame`, re-run the blame
  operation starting at the parent of this commit to see older history
  for the content.

* See the parent commit for instructions to rebase a change across this
  style transition commit.
2018-06-01 09:53:42 -04:00
Brad King 3bcaa87007 cmUVHandlePtr: Add uv_process_ptr 2017-11-30 13:43:43 -05:00
Brad King dd700e9bfb cmUVHandlePtr: Add uv_timer_ptr 2017-11-30 13:26:35 -05:00
Justin Berger a3abb85c6f Add RAII handles for libuv handle types
The `uv_*_t` handle types are closed by `uv_close`, but the semantics
are tricky.  Calling `uv_close` may not close immediately.  Instead it
hands ownership to the uv loop to which the handle is currently
attached.  When the loop decides to close it, a callback is used to
allow the `uv_close` caller to free resources.

Provide an abstraction layer as `cm::uv_*_ptr` types corresponding to
the `uv_*_t` handle types.  Each pointer is either empty (`nullptr`)
or has an initialized handle attached to a loop.  Use move semantics
to ensure a single owner of the handle so that clients can predict
when the handle is destroyed.
2017-11-29 16:36:31 -05:00