tidy-up: miscellaneous

- curl_ntlm_core, smtp, schannel: fix comments.
- curl_setup.h: fix to undef before define.
- tool_doswin, server/sockfilt: reduce variables scopes.
- tool_doswin: drop an interim variable.
- windows: replace `SOCKET_ERROR` with `0` to align with rest of code.
- libssh2: rename variable to align with rest of code.
- gtls, unit1398: use `#if 0`.
- curl_trc.h, curlx/inet_ntop.h: add missing parentheses in macro
  expressions.
- ldap.c: set empty macro to `do {} while(0)`.
- examples/crawler: rename a non-CURLcode `result` variable.
- CURLINFO_TLS_SESSION: drop stray colon.
- add `const` to casts where missing.
- drop unnecessary parentheses.
- fix indent.
- quote style.
- comment style.
- whitespace, newlines, fold/unfold.

Closes #20554
This commit is contained in:
Viktor Szakats 2026-02-01 01:56:43 +01:00
parent 2a92c39a21
commit 61df5f466c
No known key found for this signature in database
88 changed files with 503 additions and 503 deletions

View file

@ -131,18 +131,18 @@ static size_t follow_links(CURLM *multi, struct memory *mem, const char *url)
xmlChar *xpath;
xmlNodeSetPtr nodeset;
xmlXPathContextPtr context;
xmlXPathObjectPtr result;
xmlXPathObjectPtr object;
if(!doc)
return 0;
xpath = (xmlChar *)"//a/@href";
context = xmlXPathNewContext(doc);
result = xmlXPathEvalExpression(xpath, context);
object = xmlXPathEvalExpression(xpath, context);
xmlXPathFreeContext(context);
if(!result)
if(!object)
return 0;
nodeset = result->nodesetval;
nodeset = object->nodesetval;
if(xmlXPathNodeSetIsEmpty(nodeset)) {
xmlXPathFreeObject(result);
xmlXPathFreeObject(object);
return 0;
}
count = 0;
@ -167,7 +167,7 @@ static size_t follow_links(CURLM *multi, struct memory *mem, const char *url)
}
xmlFree(link);
}
xmlXPathFreeObject(result);
xmlXPathFreeObject(object);
return count;
}

View file

@ -38,6 +38,7 @@
#include <stdio.h>
#include <curl/curl.h>
#include <gnutls/gnutls.h>
#include <gnutls/x509.h>

View file

@ -34,7 +34,6 @@
* gcc -ggdb `pkg-config --cflags --libs gtk+-2.0` -lcurl -lssl -lcrypto
* -lgthread-2.0 -dl smooth-gtk-thread.c -o smooth-gtk-thread
*/
#include <stdio.h>
#include <gtk/gtk.h>
#include <glib.h>

View file

@ -26,6 +26,7 @@
* </DESC>
*/
#include <stdio.h>
#include <curl/curl.h>
#ifdef USE_ABSTRACT

View file

@ -39,10 +39,10 @@
#include <openssl/ssl.h>
#include <curl/curl.h>
#include <stdio.h>
#include <curl/curl.h>
#if defined(__GNUC__) || defined(__clang__)
#pragma GCC diagnostic ignored "-Woverlength-strings"
#endif

View file

@ -27,6 +27,7 @@
*/
#include <stdio.h>
#include <string.h>
#include <curl/curl.h>
static size_t write_cb(char *b, size_t size, size_t nitems, void *p)