[v2] misc: make uv_ip4_addr()
/uv_ip6_addr()
accept an unsigned short
port instead of int
#4130
+14
−10
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Change the
port
parameter ofuv_ip4_addr()
anduv_ip6_addr()
from anint
to anunsigned short
.Currently, the
uv_ip4_addr()
anduv_ip6_addr()
functions cast theport
to auint16_t
internally anyway, when callinghtons()
.Making the function accept
unsigned short
instead has two benefits:unsigned short
->int
->unsigned short
conversion.libuv
if theirport
parameter touv_ip4_addr()
might be truncated.ABI BREAKING CHANGE: This PR targets the
master
/v2 branch, as this change breaks the ABI. Although, it does not break the API (other than potentially causing some compiler warnings if the user calls this function with overflowing types), so I haven't bothered putting a message into the libuv v1 -> v2 migration guide.The
CI-docs
CI will probably fail due to a broken link that's unrelated to this PR.It's already been fixed in the
v1.x
branch thanks to PR #4128, but this PR targets themaster
branch, which doesn't yet have this fix.