Skip to content

Commit

Permalink
fix type wrong. format python file. add this-> to improve code read…
Browse files Browse the repository at this point in the history
…ability.
  • Loading branch information
levalup committed Jun 30, 2024
1 parent 21cd8cf commit 3274a3b
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 9 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
- `fs_event` start return `callback<const char *, uv_fs_event>`.
- `fs_poll` start return `callback<const uv_stat_t *, const uv_stat_t *>`.
- `poll` start return `callback<int>`.
- `stream` listen return `callback<int>`.
- `stream` listen return `callback<>`.
- Handle status issue with `except<uvcxx::errcode>(...)`.

--------------------------------
Expand Down
16 changes: 8 additions & 8 deletions include/uvcxx/stream.h
Original file line number Diff line number Diff line change
Expand Up @@ -95,14 +95,14 @@ namespace uv {

UVCXX_NODISCARD
uvcxx::promise<> write(const write_t &req, uvcxx::buffer buf) {
return write(req, &buf.buf, 1);
return this->write(req, &buf.buf, 1);
}

UVCXX_NODISCARD
uvcxx::promise<> write(const write_t &req, std::initializer_list<uvcxx::buffer> bufs) {
std::vector<uv_buf_t> buffers;
for (auto &buf: bufs) { buffers.emplace_back(buf.buf); }
return write(req, buffers.data(), (unsigned int) buffers.size());
return this->write(req, buffers.data(), (unsigned int) buffers.size());
}

UVCXX_NODISCARD
Expand All @@ -112,14 +112,14 @@ namespace uv {

UVCXX_NODISCARD
uvcxx::promise<> write(uvcxx::buffer buf) {
return write(&buf.buf, 1);
return this->write(&buf.buf, 1);
}

UVCXX_NODISCARD
uvcxx::promise<> write(std::initializer_list<uvcxx::buffer> bufs) {
std::vector<uv_buf_t> buffers;
for (auto &buf: bufs) { buffers.emplace_back(buf.buf); }
return write(buffers.data(), (unsigned int) buffers.size());
return this->write(buffers.data(), (unsigned int) buffers.size());
}

UVCXX_NODISCARD
Expand All @@ -131,15 +131,15 @@ namespace uv {
UVCXX_NODISCARD
uvcxx::promise<> write2(const write_t &req,
uvcxx::mutable_buffer buf, const stream_t &send_handle) {
return write2(req, &buf.buf, 1, send_handle);
return this->write2(req, &buf.buf, 1, send_handle);
}

UVCXX_NODISCARD
uvcxx::promise<> write2(const write_t &req,
std::initializer_list<uvcxx::mutable_buffer> bufs, const stream_t &send_handle) {
std::vector<uv_buf_t> buffers;
for (auto &buf: bufs) { buffers.emplace_back(buf.buf); }
return write2(req, buffers.data(), (unsigned int) buffers.size(), send_handle);
return this->write2(req, buffers.data(), (unsigned int) buffers.size(), send_handle);
}

UVCXX_NODISCARD
Expand All @@ -149,14 +149,14 @@ namespace uv {

UVCXX_NODISCARD
uvcxx::promise<> write2(uvcxx::mutable_buffer buf, const stream_t &send_handle) {
return write2(&buf.buf, 1, send_handle);
return this->write2(&buf.buf, 1, send_handle);
}

UVCXX_NODISCARD
uvcxx::promise<> write2(std::initializer_list<uvcxx::mutable_buffer> bufs, const stream_t &send_handle) {
std::vector<uv_buf_t> buffers;
for (auto &buf: bufs) { buffers.emplace_back(buf.buf); }
return write2(buffers.data(), (unsigned int) buffers.size(), send_handle);
return this->write2(buffers.data(), (unsigned int) buffers.size(), send_handle);
}

int try_write(const uv_buf_t bufs[], unsigned int nbufs) {
Expand Down
1 change: 1 addition & 0 deletions scripts/merge.py
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,7 @@ def comment_license(lic: str) -> List[str]:
*/
"""


def merge_header() -> str:
macro_control = 'UVCXX_H'
version_control_header = 'uvcxx/cxx/version.h'
Expand Down

0 comments on commit 3274a3b

Please sign in to comment.