]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
lib1509: make callbacks static
authorViktor Szakats <commit@vsz.me>
Wed, 12 Nov 2025 12:30:12 +0000 (13:30 +0100)
committerViktor Szakats <commit@vsz.me>
Wed, 12 Nov 2025 12:49:30 +0000 (13:49 +0100)
Closes #19488

tests/libtest/lib1509.c

index 1bbf61c74a22c841dde5aafc6cee09d0818f0840..3ab4feea8b8ea291c5434a6a2ef86540f3788706 100644 (file)
 
 #include "memdebug.h"
 
-size_t WriteOutput(char *ptr, size_t size, size_t nmemb, void *stream);
-size_t WriteHeader(char *ptr, size_t size, size_t nmemb, void *stream);
-
 static size_t realHeaderSize = 0;
 
+static size_t WriteOutput(char *ptr, size_t size, size_t nmemb, void *stream)
+{
+  fwrite(ptr, size, nmemb, stream);
+  return nmemb * size;
+}
+
+static size_t WriteHeader(char *ptr, size_t size, size_t nmemb, void *stream)
+{
+  (void)ptr;
+  (void)stream;
+
+  realHeaderSize += size * nmemb;
+
+  return nmemb * size;
+}
+
 static CURLcode test_lib1509(const char *URL)
 {
   long headerSize;
@@ -43,8 +56,8 @@ static CURLcode test_lib1509(const char *URL)
 
   easy_setopt(curl, CURLOPT_PROXY, libtest_arg2); /* set in first.c */
 
-  easy_setopt(curl, CURLOPT_WRITEFUNCTION, *WriteOutput);
-  easy_setopt(curl, CURLOPT_HEADERFUNCTION, *WriteHeader);
+  easy_setopt(curl, CURLOPT_WRITEFUNCTION, WriteOutput);
+  easy_setopt(curl, CURLOPT_HEADERFUNCTION, WriteHeader);
 
   easy_setopt(curl, CURLOPT_HEADER, 1L);
   easy_setopt(curl, CURLOPT_VERBOSE, 1L);
@@ -79,19 +92,3 @@ test_cleanup:
 
   return res;
 }
-
-size_t WriteOutput(char *ptr, size_t size, size_t nmemb, void *stream)
-{
-  fwrite(ptr, size, nmemb, stream);
-  return nmemb * size;
-}
-
-size_t WriteHeader(char *ptr, size_t size, size_t nmemb, void *stream)
-{
-  (void)ptr;
-  (void)stream;
-
-  realHeaderSize += size * nmemb;
-
-  return nmemb * size;
-}