docs: rename CURLcode variables to 'result'

This commit is contained in:
Daniel Stenberg 2025-12-16 15:54:06 +01:00
parent d21f4372ff
commit 09f01f28ec
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2
381 changed files with 1705 additions and 1695 deletions

View file

@ -60,14 +60,15 @@ static size_t read_cb(char *buf, size_t nitems, size_t buflen, void *p)
struct read_ctx *ctx = p;
size_t len = nitems * buflen;
size_t left = ctx->blen - ctx->nsent;
CURLcode res;
CURLcode result;
if(!ctx->nsent) {
/* On first call, set the FRAME information to be used (it defaults
* to CURLWS_BINARY otherwise). */
res = curl_ws_start_frame(ctx->curl, CURLWS_TEXT, (curl_off_t)ctx->blen);
if(res) {
fprintf(stderr, "error starting frame: %d\n", res);
/* On first call, set the FRAME information to be used (it defaults to
* CURLWS_BINARY otherwise). */
result = curl_ws_start_frame(ctx->curl, CURLWS_TEXT,
(curl_off_t)ctx->blen);
if(result) {
fprintf(stderr, "error starting frame: %d\n", result);
return CURL_READFUNC_ABORT;
}
}
@ -88,9 +89,9 @@ int main(int argc, const char *argv[])
struct read_ctx rctx;
const char *payload = "Hello, friend!";
CURLcode res = curl_global_init(CURL_GLOBAL_ALL);
if(res)
return (int)res;
CURLcode result = curl_global_init(CURL_GLOBAL_ALL);
if(result)
return (int)result;
memset(&rctx, 0, sizeof(rctx));
@ -111,16 +112,16 @@ int main(int argc, const char *argv[])
curl_easy_setopt(curl, CURLOPT_READDATA, &rctx);
curl_easy_setopt(curl, CURLOPT_UPLOAD, 1L);
/* Perform the request, res gets the return code */
res = curl_easy_perform(curl);
/* Perform the request, result gets the return code */
result = curl_easy_perform(curl);
/* Check for errors */
if(res != CURLE_OK)
if(result != CURLE_OK)
fprintf(stderr, "curl_easy_perform() failed: %s\n",
curl_easy_strerror(res));
curl_easy_strerror(result));
/* always cleanup */
curl_easy_cleanup(curl);
}
curl_global_cleanup();
return (int)res;
return (int)result;
}