]> git.ipfire.org Git - thirdparty/qemu.git/commit
block/curl.c: Use explicit long constants in curl_easy_setopt calls
authorRichard W.M. Jones <rjones@redhat.com>
Thu, 9 Oct 2025 14:08:31 +0000 (15:08 +0100)
committerRichard Henderson <richard.henderson@linaro.org>
Fri, 10 Oct 2025 15:24:14 +0000 (08:24 -0700)
commited26056d90ddff21351f3efd2cb47fea4f0e1d45
tree21fca02e9d141bf019f385506e85606dd3f5f361
parent94474a7733a57365d5a27efc28c05462e90e8944
block/curl.c: Use explicit long constants in curl_easy_setopt calls

curl_easy_setopt takes a variable argument that depends on what
CURLOPT you are setting.  Some require a long constant.  Passing a
plain int constant is potentially wrong on some platforms.

With warnings enabled, multiple warnings like this were printed:

../block/curl.c: In function ‘curl_init_state’:
../block/curl.c:474:13: warning: call to ‘_curl_easy_setopt_err_long’ declared with attribute warning: curl_easy_setopt expects a long argument [-Wattribute-warning]
  474 |             curl_easy_setopt(state->curl, CURLOPT_AUTOREFERER, 1) ||
      |             ^

Signed-off-by: Richard W.M. Jones <rjones@redhat.com>
Signed-off-by: Chenxi Mao <maochenxi@bosc.ac.cn>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Reviewed-by: Akihiko Odaki <odaki@rsg.ci.i.u-tokyo.ac.jp>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-ID: <20251009141026.4042021-2-rjones@redhat.com>
block/curl.c
contrib/elf2dmp/download.c