send: drop CURL_UNCONST() from buffer argument on most platforms#20463
send: drop CURL_UNCONST() from buffer argument on most platforms#20463vszakats wants to merge 3 commits intocurl:masterfrom
CURL_UNCONST() from buffer argument on most platforms#20463Conversation
|
augment review |
There was a problem hiding this comment.
Pull request overview
This pull request modernizes the handling of the send() function's buffer argument const qualifier by replacing a macro-based const qualifier approach with a simpler boolean flag approach. Previously, SEND_QUAL_ARG2 was used to strip const from the buffer argument on most platforms by default. The new approach uses SEND_NONCONST_ARG2 to explicitly mark the two platforms (AmigaOS and OS400) that require non-const buffers, while all other platforms now properly use const buffers.
Changes:
- Replaced
SEND_QUAL_ARG2macro with booleanSEND_NONCONST_ARG2macro - Updated swrite macro to conditionally apply const based on platform requirements
- Removed legacy const-stripping logic from all config files except AmigaOS and OS400
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| projects/vms/config_h.com | Removes SEND_QUAL_ARG2 handling from VMS configuration script |
| lib/functypes.h | Defines SEND_NONCONST_ARG2 for AmigaOS and updates comment to reflect non-const signature |
| lib/curl_setup_once.h | Implements conditional const handling in swrite macro and updates documentation |
| lib/config-win32.h | Removes SEND_QUAL_ARG2 definition (Windows uses const by default) |
| lib/config-riscos.h | Removes SEND_QUAL_ARG2 definition (RISC OS uses const by default) |
| lib/config-os400.h | Replaces SEND_QUAL_ARG2 with SEND_NONCONST_ARG2 and updates comment |
| lib/config-mac.h | Removes SEND_QUAL_ARG2 definition (Mac uses const by default) |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
🤖 Augment PR SummarySummary: This PR updates libcurl’s Changes:
Technical Notes: Default behavior is now “ARG2 accepts const”; only platforms that truly need it must opt in via 🤖 Was this summary useful? React with 👍 or 👎 |
CURL_UNCONST() from buffer argument on most platforms
Keep it on platforms requiring a non-const buffer. These are AmigaOS and
OS400.
Also:
SEND_QUAL_ARG2with boolean macroSEND_NONCONST_ARG2.