From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 128157 invoked by alias); 4 Dec 2019 01:43:58 -0000 Mailing-List: contact elfutils-devel-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Post: List-Help: List-Subscribe: Sender: elfutils-devel-owner@sourceware.org Received: (qmail 127214 invoked by uid 89); 4 Dec 2019 01:43:57 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Checked: by ClamAV 0.100.3 on sourceware.org X-Virus-Found: No X-Spam-SWARE-Status: No, score=-19.0 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,SPF_PASS autolearn=ham version=3.3.1 spammy=H*Ad:U*mark, download, HContent-Transfer-Encoding:8bit X-Spam-Status: No, score=-19.0 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,SPF_PASS autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on sourceware.org X-Spam-Level: X-HELO: gnu.wildebeest.org Received: from wildebeest.demon.nl (HELO gnu.wildebeest.org) (212.238.236.112) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 04 Dec 2019 01:43:55 +0000 Received: from tarox.wildebeest.org (tarox.wildebeest.org [172.31.17.39]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by gnu.wildebeest.org (Postfix) with ESMTPSA id 194D1300D927; Wed, 4 Dec 2019 02:43:52 +0100 (CET) Received: by tarox.wildebeest.org (Postfix, from userid 1000) id 00415401EDA3; Wed, 4 Dec 2019 02:43:51 +0100 (CET) From: Mark Wielaard To: elfutils-devel@sourceware.org Cc: Mark Wielaard Subject: [PATCH] debuginfod: Fix implicit conversion from 'CURLcode' to 'CURLMcode' Date: Wed, 04 Dec 2019 01:43:00 -0000 Message-Id: <20191204014350.16397-1-mark@klomp.org> X-Mailer: git-send-email 2.18.1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Flag: NO X-IsSubscribed: yes X-SW-Source: 2019-q4/txt/msg00230.txt.bz2 GCC10 warns when converting the value of one enum type into another: debuginfod-client.c:530:24: error: implicit conversion from ‘CURLcode’ to ‘CURLMcode’ [-Werror=enum-conversion] 530 | curl_res = curl_easy_getinfo(target_handle, | ^ libcurl has different error code enums. The "easy" interfaces return a CURLcode error. The "multi" interface functions return a CURLMcode. Signed-off-by: Mark Wielaard --- debuginfod/ChangeLog | 5 +++++ debuginfod/debuginfod-client.c | 9 ++++----- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/debuginfod/ChangeLog b/debuginfod/ChangeLog index 8aa29443..10b6bfed 100644 --- a/debuginfod/ChangeLog +++ b/debuginfod/ChangeLog @@ -1,3 +1,8 @@ +2019-12-03 Mark Wielaard + + * debuginfod-client.c (debuginfod_query_server): Use separate + local variables for CURLcode curl_res and CURLMcode curlm_res. + 2019-11-26 Mark Wielaard * Makefile.am (BUILD_STATIC): Add needed libraries for libdw and diff --git a/debuginfod/debuginfod-client.c b/debuginfod/debuginfod-client.c index 6e62b86c..302ea2dc 100644 --- a/debuginfod/debuginfod-client.c +++ b/debuginfod/debuginfod-client.c @@ -509,8 +509,6 @@ debuginfod_query_server (debuginfod_client *c, long loops = 0; do { - CURLMcode curl_res; - if (c->progressfn) /* inform/check progress callback */ { loops ++; @@ -518,6 +516,7 @@ debuginfod_query_server (debuginfod_client *c, long pb = 0; if (target_handle) /* we've committed to a server; report its download progress */ { + CURLcode curl_res; #ifdef CURLINFO_SIZE_DOWNLOAD_T curl_off_t dl; curl_res = curl_easy_getinfo(target_handle, @@ -564,10 +563,10 @@ debuginfod_query_server (debuginfod_client *c, if (data[i].handle != target_handle) curl_multi_remove_handle(curlm, data[i].handle); - curl_res = curl_multi_perform(curlm, &still_running); - if (curl_res != CURLM_OK) + CURLMcode curlm_res = curl_multi_perform(curlm, &still_running); + if (curlm_res != CURLM_OK) { - switch (curl_res) + switch (curlm_res) { case CURLM_CALL_MULTI_PERFORM: continue; case CURLM_OUT_OF_MEMORY: rc = -ENOMEM; break; -- 2.18.1