@@ -138,7 +138,7 @@ static int closesocket_callback(void __attribute__((unused)) *clientp, curl_sock
138138 return 0 ;
139139}
140140
141- static void https_log_data (enum LogSeverity level , struct https_fetch_ctx * ctx ,
141+ static void https_log_data (int level , struct https_fetch_ctx * ctx ,
142142 const char * prefix , char * ptr , size_t size )
143143{
144144 const size_t width = 0x10 ;
@@ -156,14 +156,14 @@ static void https_log_data(enum LogSeverity level, struct https_fetch_ctx *ctx,
156156 for (size_t c = 0 ; c < width ; c ++ ) {
157157 if (i + c < size ) {
158158 // NOLINTNEXTLINE(clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling)
159- hex_off += snprintf (hex + hex_off , sizeof (hex ) - hex_off ,
160- "%02x " , (unsigned char )ptr [i + c ]);
159+ hex_off += ( size_t ) snprintf (hex + hex_off , sizeof (hex ) - hex_off ,
160+ "%02x " , (unsigned char )ptr [i + c ]);
161161 // NOLINTNEXTLINE(clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling)
162- str_off += snprintf (str + str_off , sizeof (str ) - str_off ,
163- "%c" , isprint (ptr [i + c ]) ? ptr [i + c ] : '.' );
162+ str_off += ( size_t ) snprintf (str + str_off , sizeof (str ) - str_off ,
163+ "%c" , isprint (ptr [i + c ]) ? ptr [i + c ] : '.' );
164164 } else {
165165 // NOLINTNEXTLINE(clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling)
166- hex_off += snprintf (hex + hex_off , sizeof (hex ) - hex_off , " " );
166+ hex_off += ( size_t ) snprintf (hex + hex_off , sizeof (hex ) - hex_off , " " );
167167 }
168168 }
169169
@@ -249,7 +249,7 @@ static void https_set_request_version(https_client_t *client,
249249 switch (client -> opt -> use_http_version ) {
250250 case 1 :
251251 http_version_int = CURL_HTTP_VERSION_1_1 ;
252- // fallthrough
252+ __attribute__(( fallthrough ));
253253 case 2 :
254254 break ;
255255 case 3 :
@@ -338,7 +338,7 @@ static void https_fetch_ctx_init(https_client_t *client,
338338
339339static int https_fetch_ctx_process_response (https_client_t * client ,
340340 struct https_fetch_ctx * ctx ,
341- int curl_result_code )
341+ CURLcode curl_result_code )
342342{
343343 CURLcode res = 0 ;
344344 long long_resp = 0 ;
@@ -419,15 +419,15 @@ static int https_fetch_ctx_process_response(https_client_t *client,
419419 res = curl_easy_getinfo (ctx -> curl , CURLINFO_SSL_VERIFYRESULT , & long_resp );
420420 if (res != CURLE_OK ) {
421421 ELOG_REQ ("CURLINFO_SSL_VERIFYRESULT: %s" , curl_easy_strerror (res ));
422- } else if (long_resp != CURLE_OK ) {
423- WLOG_REQ ("CURLINFO_SSL_VERIFYRESULT: %s " , curl_easy_strerror ( long_resp ) );
422+ } else if (long_resp != 0 ) {
423+ WLOG_REQ ("CURLINFO_SSL_VERIFYRESULT: certificate verification failure %d " , long_resp );
424424 }
425425
426426 res = curl_easy_getinfo (ctx -> curl , CURLINFO_OS_ERRNO , & long_resp );
427427 if (res != CURLE_OK ) {
428428 ELOG_REQ ("CURLINFO_OS_ERRNO: %s" , curl_easy_strerror (res ));
429429 } else if (long_resp != 0 ) {
430- WLOG_REQ ("CURLINFO_OS_ERRNO: %d %s" , long_resp , strerror (long_resp ));
430+ WLOG_REQ ("CURLINFO_OS_ERRNO: %d %s" , long_resp , strerror (( int ) long_resp ));
431431 if (long_resp == ENETUNREACH && !client -> opt -> ipv4 ) {
432432 // this can't be fixed here with option overwrite because of dns_poller
433433 WLOG ("Try to run application with -4 argument!" );
@@ -510,7 +510,7 @@ static void https_fetch_ctx_cleanup(https_client_t *client,
510510 if (curl_result_code < 0 ) {
511511 WLOG_REQ ("Request was aborted" );
512512 drop_reply = 1 ;
513- } else if (https_fetch_ctx_process_response (client , ctx , curl_result_code ) != 0 ) {
513+ } else if (https_fetch_ctx_process_response (client , ctx , ( CURLcode ) curl_result_code ) != 0 ) {
514514 ILOG_REQ ("Response was faulty, skipping DNS reply" );
515515 drop_reply = 1 ;
516516 }
@@ -540,7 +540,7 @@ static void check_multi_info(https_client_t *c) {
540540 struct https_fetch_ctx * cur = c -> fetches ;
541541 while (cur ) {
542542 if (cur -> curl == msg -> easy_handle ) {
543- https_fetch_ctx_cleanup (c , prev , cur , msg -> data .result );
543+ https_fetch_ctx_cleanup (c , prev , cur , ( int ) msg -> data .result );
544544 break ;
545545 }
546546 prev = cur ;
@@ -642,7 +642,7 @@ static int multi_timer_cb(CURLM __attribute__((unused)) *multi,
642642 ev_timer_stop (c -> loop , & c -> timer );
643643 if (timeout_ms >= 0 ) {
644644 // NOLINTNEXTLINE(clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling)
645- ev_timer_init (& c -> timer , timer_cb , timeout_ms / 1000.0 , 0 );
645+ ev_timer_init (& c -> timer , timer_cb , ( double ) timeout_ms / 1000.0 , 0 );
646646 ev_timer_start (c -> loop , & c -> timer );
647647 }
648648 return 0 ;
0 commit comments