Skip to content

Libcperciva import#303

Merged
cperciva merged 8 commits intomasterfrom
libcperciva-import
Jan 14, 2025
Merged

Libcperciva import#303
cperciva merged 8 commits intomasterfrom
libcperciva-import

Conversation

@gperciva
Copy link
Member

No description provided.

If there's an error in ipc_sync_done(), we don't want to call it again.

Reported by:	clang19 scan-build
Previously, we combined strings with:
    d="$a $b $c"
If $b was "", that would leave two spaces, which we trimmed with
    tr -s ' '

However, that was an inelegant solution, and more importantly, was not
compatible with code such as:
    -D_TWO_SPACES="\"2  spaces\""
when defined in Makefile.BSD.
Ideally, there would always be 0 errors.   However, due to porting
issues, some platforms report a non-zero number of errors even for
trivial programs.
cpusupport-ARM-AES.c: the info about _u32 was in a git commit message,
    but it's worth adding a 1-line comment about it.

cpusupport-X86-SSE42*.c: our STYLE says that we should never use
    (unsigned char).  That's what the definition of _mm_crc32_u8() uses,
    but the code in alg/crc32_sse42.c uses (uint8_t), so there's no
    point violating our STYLE by using (unsigned char) here.

network_ssl_compat.c: fix style of assignment & checking.

imalloc.h: split the "return (NULL)" cases from the actual malloc().
A source or destination address of the form ":1234" is parsed as a
hostname of "" which is guaranteed to never work.  While we don't want
to give special error messages for all possible invalid addresses, this
particular case can easily be produced from a broken shell script (with
a hostname variable accidentally not set), so it's worth having a
special error message.

Suggested by:	Ross Richardson
@cperciva cperciva merged commit ee7def1 into master Jan 14, 2025
2 checks passed
@gperciva gperciva deleted the libcperciva-import branch January 14, 2025 23:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants