Skip to content

Commit

Permalink
pipe: hide pipe_handle::connect -Wsign-conversion
Browse files Browse the repository at this point in the history
Hide the following `-Wsign-conversion` warning in
`uvw::pipe_handle::connect()` by explicitly passing an `unsigned int`.

```
src/uvw/stream.h:56:48: warning: conversion to ‘unsigned int’ from ‘int’ may change the sign of the result [-Wsign-conversion]
   56 |         return this->leak_if(std::forward<F>(f)(raw(), std::forward<Args>(args)..., &connect_callback));
```
  • Loading branch information
aloisklink committed Aug 23, 2023
1 parent 36b586f commit d7d58d8
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/uvw/pipe.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ UVW_INLINE int pipe_handle::connect(const std::string &name, const bool no_trunc
connect->on<error_event>(listener);
connect->on<connect_event>(listener);

return connect->connect(&uv_pipe_connect2, raw(), name.data(), name.size(), no_truncate * UV_PIPE_NO_TRUNCATE);
unsigned int flags = no_truncate * UV_PIPE_NO_TRUNCATE;
return connect->connect(&uv_pipe_connect2, raw(), name.data(), name.size(), flags);
}

UVW_INLINE std::string pipe_handle::sock() const noexcept {
Expand Down

0 comments on commit d7d58d8

Please sign in to comment.