Skip to content

Commit

Permalink
Fix clang19 warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
halx99 committed Jan 5, 2025
1 parent 0817150 commit ab20246
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions yasio/pod_vector.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -406,8 +406,8 @@ class pod_vector {
}
void _Assign_rv(pod_vector&& rhs)
{
memcpy(this, &rhs, sizeof(rhs));
memset(&rhs, 0, sizeof(rhs));
memcpy((void*)this, &rhs, sizeof(rhs));
memset((void*)&rhs, 0, sizeof(rhs));
}
enum class _Reallocation_policy
{
Expand Down
8 changes: 4 additions & 4 deletions yasio/string_view.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1074,10 +1074,10 @@ inline namespace literals
{
inline namespace string_view_literals
{
inline cxx17::string_view operator"" _sv(const char* _Str, size_t _Len) { return cxx17::string_view(_Str, _Len); }
inline cxx17::wstring_view operator"" _sv(const wchar_t* _Str, size_t _Len) { return cxx17::wstring_view(_Str, _Len); }
inline cxx17::u16string_view operator"" _sv(const char16_t* _Str, size_t _Len) { return cxx17::u16string_view(_Str, _Len); }
inline cxx17::u32string_view operator"" _sv(const char32_t* _Str, size_t _Len) { return cxx17::u32string_view(_Str, _Len); }
inline cxx17::string_view operator""_sv(const char* _Str, size_t _Len) { return cxx17::string_view(_Str, _Len); }
inline cxx17::wstring_view operator""_sv(const wchar_t* _Str, size_t _Len) { return cxx17::wstring_view(_Str, _Len); }
inline cxx17::u16string_view operator""_sv(const char16_t* _Str, size_t _Len) { return cxx17::u16string_view(_Str, _Len); }
inline cxx17::u32string_view operator""_sv(const char32_t* _Str, size_t _Len) { return cxx17::u32string_view(_Str, _Len); }
} // namespace string_view_literals
} // namespace literals
} // namespace cxx17
Expand Down
4 changes: 2 additions & 2 deletions yasio/xxsocket.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ struct endpoint final {
endpoint& operator=(const endpoint& rhs) { return as_is(rhs); }
endpoint& as_is(const endpoint& rhs)
{
memcpy(this, &rhs, sizeof(rhs));
memcpy((void*)this, &rhs, sizeof(rhs));
return *this;
}
endpoint& as_is(const addrinfo* info) { return as_is_raw(info->ai_addr, info->ai_addrlen); }
Expand Down Expand Up @@ -373,7 +373,7 @@ struct endpoint final {

endpoint& as_is_raw(const void* ai_addr, size_t ai_addrlen)
{
::memcpy(this, ai_addr, ai_addrlen);
::memcpy((void*)this, ai_addr, ai_addrlen);
this->len(ai_addrlen);
return *this;
}
Expand Down

0 comments on commit ab20246

Please sign in to comment.