tidy-up: minor code fixes and improvements - #22444
Closed
vszakats wants to merge 10 commits into
Closed
Conversation
Follow-up to ebc5212 curl#22374
This reverts commit 8762fbd. Skip.
There was a problem hiding this comment.
Pull request overview
This PR applies a set of small “tidy-up” refactors across curl’s test suite and a couple of platform/TLS implementation files, focusing on removing redundancies and aligning code with established local patterns (e.g., CURL_CSTRLEN(), const-correctness, and consistent Python test style).
Changes:
- Replaces a
sizeof(...)-Nstring-length idiom withCURL_CSTRLEN()inlib650and removes redundant(long)casts in several libtests. - Improves local const-correctness for
struct curl_slist *iteration pointers in a few libtests. - Removes redundant includes in the OS/400 source and drops redundant parentheses in schannel ALPN buffer pointer casts; adjusts a couple of pytest membership checks to use lists for consistency.
Reviewed changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| tests/libtest/lib650.c | Uses CURL_CSTRLEN() for a static string length expression (equivalent result to prior code). |
| tests/libtest/lib5004.c | Drops redundant (long) cast when passing CURLHTTPSIG_ED25519 (already a long constant). |
| tests/libtest/lib5000.c | Drops redundant (long) cast when passing CURLHTTPSIG_ED25519 (already a long constant). |
| tests/libtest/lib3207.c | Constifies a local curl_slist iteration pointer (no behavioral change). |
| tests/libtest/lib3102.c | Constifies a local curl_slist iteration pointer (no behavioral change). |
| tests/libtest/lib1582.c | Drops redundant (long) cast when passing CURLAUTH_NEGOTIATE (typecheck accepts unsigned/signed long). |
| tests/libtest/lib1549.c | Constifies a local curl_slist iteration pointer (no behavioral change). |
| tests/http/test_21_resolve.py | Uses list instead of tuple in an in check to match surrounding test style. |
| tests/http/test_02_download.py | Uses list instead of tuple in an in check to match surrounding test style. |
| projects/OS400/os400sys.c | Removes redundant sys/types.h and sys/socket.h includes (already pulled in via <curl/curl.h> on non-Windows). |
| lib/vtls/schannel.c | Removes redundant parentheses in two pointer-cast expressions (no behavioral change). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
Follow-up to ebc5212 tidy-up: drop redundant includes #22374
()with[]to match rest of tests.(long)casts.CURL_CSTRLEN().Follow-up to 59dc2bb tidy-up: use
CURL_CSTRLEN()macro on more static strings #22424