Repository navigation
Conversation
There was a problem hiding this comment.
Pull request overview
This PR is a clang-tidy–style follow-up cleanup that standardizes formatting and simplifies some redundant expressions across the codebase (including public headers and docs).
Changes:
- Simplify boolean/bitmask checks and remove redundant
elsebranches (e.g., VMS helper code). - Normalize function-pointer macro usage and casts by removing redundant parentheses around declarators.
- Apply minor whitespace/parentheses cleanups in macros, calls, and documentation snippets for consistency.
Reviewed changes
Copilot reviewed 24 out of 28 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| vms/man2help.c | Clarifies VMS status-bit test and removes redundant else nesting. |
| src/wincng.c | Small whitespace/parentheses tidying in conditions, casts, and calls. |
| src/userauth.h | Normalizes function-pointer macro declarator style in prototypes. |
| src/userauth.c | Normalizes function-pointer macro declarator style in definitions/prototypes. |
| src/transport.c | Minor whitespace normalization in an expression. |
| src/session.c | Updates callback function-pointer declarations/casts to the new macro style. |
| src/openssl.h | Simplifies _libssh2_random macro formatting/parentheses. |
| src/mac.c | Minor whitespace normalization in memcpy casts. |
| src/libssh2_priv.h | Normalizes function-pointer fields in internal structs. |
| src/libgcrypt.h | Drops redundant parentheses in macro args and adjusts continuation indentation. |
| src/kex.c | Removes redundant parentheses in a local helper macro’s calls/args. |
| src/chacha.c | Macro whitespace/parentheses cleanup for internal ChaCha helpers. |
| src/blowfish.c | Minor macro formatting normalization. |
| os400/include/sys/socket.h | Simplifies macro wrapper argument parentheses. |
| include/libssh2_sftp.h | Simplifies convenience macro wrappers by dropping redundant parentheses. |
| include/libssh2_publickey.h | Simplifies convenience macro wrappers by dropping redundant parentheses. |
| include/libssh2.h | Normalizes public callback macro declarators and related prototypes/macros. |
| example/sftp_append.c | Minor cast whitespace tweak in a debug print. |
| docs/libssh2_userauth_publickey_sk.md | Sync docs signature formatting with header changes. |
| docs/libssh2_userauth_password_ex.md | Sync docs signature/macro formatting with header changes. |
| docs/libssh2_userauth_keyboard_interactive.md | Sync docs signature formatting with header changes. |
| docs/libssh2_sign_sk.md | Sync docs struct signature formatting with header changes. |
| docs/libssh2_sftp_symlink.md | Sync docs macro formatting with header changes. |
| docs/libssh2_sftp_rmdir.md | Sync docs macro formatting with header changes. |
| docs/libssh2_sftp_realpath.md | Sync docs macro formatting with header changes. |
| docs/libssh2_sftp_readlink.md | Sync docs macro formatting with header changes. |
| docs/libssh2_sftp_fstat_ex.md | Sync docs macro formatting with header changes. |
| docs/libssh2_session_init_ex.md | Sync docs prototype formatting with header changes. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
vszakats
added a commit
that referenced
this pull request
Sep 3, 2026
To avoid the chance of breaking compatibility. Make an exception for values also passed to `strlen()` because these were already not supporting callers passing `x, y`-style macro expressions to these macros, as arguments. Also note that SFTP handle args already did not support this due to the lack of parentheses in `libssh2_sftp_close()`, `libssh2_sftp_closedir()` macros. Follow-up to b6f307d #1898 Closes #2577
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Also:
ifexpression, drop redundantelseexpression.
Follow-up to 6e47049 #1844
https://github.com/libssh2/libssh2/pull/1898/files?w=1