mirror of
https://github.com/curl/curl.git
synced 2026-04-14 22:41:40 +03:00
build: use more const
Mostly with `char *` types. Also: - mime, x509asn1, tool_operate, lib3207: drop redundant casts. - examples/smooth-gtk-thread: add missing variable declaration. - reduce variable scopes. - tests/server: move `data_to_hex()` to its only user: `sws`. Closes #20489
This commit is contained in:
parent
66bb641331
commit
9630593650
111 changed files with 278 additions and 268 deletions
|
|
@ -241,7 +241,7 @@ static CURLcode send_CONNECT(struct Curl_cfilter *cf,
|
|||
struct h1_tunnel_state *ts,
|
||||
bool *done)
|
||||
{
|
||||
uint8_t *buf = curlx_dyn_uptr(&ts->request_data);
|
||||
const uint8_t *buf = curlx_dyn_uptr(&ts->request_data);
|
||||
size_t request_len = curlx_dyn_len(&ts->request_data);
|
||||
size_t blen = request_len;
|
||||
CURLcode result = CURLE_OK;
|
||||
|
|
@ -262,7 +262,7 @@ static CURLcode send_CONNECT(struct Curl_cfilter *cf,
|
|||
|
||||
DEBUGASSERT(blen >= nwritten);
|
||||
ts->nsent += nwritten;
|
||||
Curl_debug(data, CURLINFO_HEADER_OUT, (char *)buf, nwritten);
|
||||
Curl_debug(data, CURLINFO_HEADER_OUT, (const char *)buf, nwritten);
|
||||
|
||||
out:
|
||||
if(result)
|
||||
|
|
@ -353,9 +353,9 @@ static CURLcode single_header(struct Curl_cfilter *cf,
|
|||
struct h1_tunnel_state *ts)
|
||||
{
|
||||
CURLcode result = CURLE_OK;
|
||||
char *linep = curlx_dyn_ptr(&ts->rcvbuf);
|
||||
const char *linep = curlx_dyn_ptr(&ts->rcvbuf);
|
||||
size_t line_len = curlx_dyn_len(&ts->rcvbuf); /* bytes in this line */
|
||||
struct SingleRequest *k = &data->req;
|
||||
const struct SingleRequest *k = &data->req;
|
||||
int writetype;
|
||||
ts->headerlines++;
|
||||
|
||||
|
|
@ -531,7 +531,7 @@ static CURLcode recv_CONNECT_resp(struct Curl_cfilter *cf,
|
|||
if(byte != 0x0a)
|
||||
continue;
|
||||
else {
|
||||
char *linep = curlx_dyn_ptr(&ts->rcvbuf);
|
||||
const char *linep = curlx_dyn_ptr(&ts->rcvbuf);
|
||||
size_t hlen = curlx_dyn_len(&ts->rcvbuf);
|
||||
if(hlen && ISNEWLINE(linep[0])) {
|
||||
/* end of headers */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue