Skip to content

tidy-up: minor code fixes and improvements - #22444

Closed
vszakats wants to merge 10 commits into
curl:masterfrom
vszakats:tidyc
Closed

tidy-up: minor code fixes and improvements#22444
vszakats wants to merge 10 commits into
curl:masterfrom
vszakats:tidyc

Conversation

@vszakats

@vszakats vszakats commented Jul 30, 2026

Copy link
Copy Markdown
Member

@github-actions github-actions Bot added the tests label Jul 30, 2026
This reverts commit 8762fbd.

Skip.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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(...)-N string-length idiom with CURL_CSTRLEN() in lib650 and 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.

@vszakats vszakats closed this in b848380 Jul 30, 2026
@vszakats
vszakats deleted the tidyc branch July 30, 2026 10:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Development

Successfully merging this pull request may close these issues.

2 participants