TokTok / c-toxcore

The future of online communications.
https://tox.chat
GNU General Public License v3.0
2.25k stars 284 forks source link

cleanup: Don't use `memcpy` to cast arbitrary `struct`s to `uint8_t[]`. #2684

Closed iphydf closed 7 months ago

iphydf commented 7 months ago

We can memcpy integral types and array types. There's no need to directly memcpy into or from struct types.


This change is Reviewable

codecov[bot] commented 7 months ago

Codecov Report

Attention: 1 lines in your changes are missing coverage. Please review.

Comparison is base (c71567d) 72.94% compared to head (623e3ee) 73.11%.

Files Patch % Lines
toxcore/network.c 75.00% 1 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #2684 +/- ## ========================================== + Coverage 72.94% 73.11% +0.17% ========================================== Files 148 148 Lines 30486 30486 ========================================== + Hits 22238 22291 +53 + Misses 8248 8195 -53 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

Green-Sky commented 7 months ago

I thought we ran autotests on ipv6 too?

iphydf commented 7 months ago

I thought we ran autotests on ipv6 too?

I'm not sure we run those on CI. Why are you asking?

nurupo commented 7 months ago

Maybe this warning has something to do with it

image