From nobody Sun Feb 8 19:24:32 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) client-ip=207.211.31.81; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1582489278; cv=none; d=zohomail.com; s=zohoarc; b=ByNaZsfjD/i74v2DLAqzELVYM0LgbYByEqCMc6b2hOQo0FB1YjA7G+Z99ugE912WhoHboL/GE0jAZiErk8h7IPkioIqOTiZSjq/fwO2+bFi9ZmK4mcOV+roXaLH0hA3EEDPXIvY78F3L4r5oXtbNjMOmhgwkKvVk4L4eTsmt5aU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1582489278; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=uK9jUVz7vhz+eEO4nvqttzZVwjcOyZr/ZGuyfKm0PS4=; b=hBdhMwLIzRZCmlBoV6kOohYikI3sGnScb9mfdtqXsJxQKAGNa1EYp0m0K62kJb97Vg45QFK4JZ2q0vZju+8mpIpNVAu74TfOGQL5MWWCZbxS8K5LusQ9/vSitJ6byLyFYv4OSVHPsOUcHeILYyMpvznJTviD87T1WyFz4D2ZjtE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-1.mimecast.com (us-smtp-1.mimecast.com [207.211.31.81]) by mx.zohomail.com with SMTPS id 158248927797499.29557340661029; Sun, 23 Feb 2020 12:21:17 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-27-jxy3dr9qM0eJ4J1ywNi1dw-1; Sun, 23 Feb 2020 15:21:13 -0500 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 13DDC8017CC; Sun, 23 Feb 2020 20:21:08 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id B18341001B2D; Sun, 23 Feb 2020 20:21:07 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id DE97918089C8; Sun, 23 Feb 2020 20:21:02 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 01NKL1lq023729 for ; Sun, 23 Feb 2020 15:21:01 -0500 Received: by smtp.corp.redhat.com (Postfix) id A7F8291833; Sun, 23 Feb 2020 20:21:01 +0000 (UTC) Received: from lpt.redhat.com (ovpn-200-20.brq.redhat.com [10.40.200.20]) by smtp.corp.redhat.com (Postfix) with ESMTP id D287C5C105 for ; Sun, 23 Feb 2020 20:21:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1582489276; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=uK9jUVz7vhz+eEO4nvqttzZVwjcOyZr/ZGuyfKm0PS4=; b=TXEZk8Z5U9xYGvke391g9mGLZlrkSATGINx8/u0Hn28dB2VwBXmIpVn5bmlR/QGscIcePh mNVObwy5IWSmiYR4Om8oe9iH3M0r0o+vNOGh2HmePv5aXXSgfAOu/UzTC7+pr846+CtffF LGLUhv0/POXixbiWSSoGfqLCUMv822w= X-MC-Unique: jxy3dr9qM0eJ4J1ywNi1dw-1 From: =?UTF-8?q?J=C3=A1n=20Tomko?= To: libvir-list@redhat.com Subject: [libvirt PATCH 2/3] Remove all use of virHexToBin Date: Sun, 23 Feb 2020 21:20:53 +0100 Message-Id: <4f27b6d1554a259dd096e17ea7a248cc6e3b74a7.1582489237.git.jtomko@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Replace it by g_ascii_xdigit_value. Signed-off-by: J=C3=A1n Tomko --- src/util/virbitmap.c | 3 +-- src/util/virmacaddr.c | 5 ++--- src/vmx/vmx.c | 4 ++-- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/src/util/virbitmap.c b/src/util/virbitmap.c index 0679915f70..baf77fe556 100644 --- a/src/util/virbitmap.c +++ b/src/util/virbitmap.c @@ -27,7 +27,6 @@ #include "viralloc.h" #include "virbuffer.h" #include "virstring.h" -#include "virutil.h" #include "virerror.h" =20 #define VIR_FROM_THIS VIR_FROM_NONE @@ -1168,7 +1167,7 @@ virBitmapNewString(const char *string) return NULL; =20 for (i =3D 0; i < len; i++) { - unsigned long nibble =3D virHexToBin(string[len - i - 1]); + unsigned long nibble =3D g_ascii_xdigit_value(string[len - i - 1]); nibble <<=3D VIR_BITMAP_BIT_OFFSET(i * 4); bitmap->map[VIR_BITMAP_UNIT_OFFSET(i * 4)] |=3D nibble; } diff --git a/src/util/virmacaddr.c b/src/util/virmacaddr.c index 182bd582fb..35918bca41 100644 --- a/src/util/virmacaddr.c +++ b/src/util/virmacaddr.c @@ -23,7 +23,6 @@ =20 #include "virmacaddr.h" #include "virrandom.h" -#include "virutil.h" #include "viralloc.h" =20 static const unsigned char virMacAddrBroadcastAddrRaw[VIR_MAC_BUFLEN] =3D @@ -213,8 +212,8 @@ virMacAddrParseHex(const char *str, virMacAddrPtr addr) return -1; =20 for (i =3D 0; i < VIR_MAC_BUFLEN; i++) - addr->addr[i] =3D (virHexToBin(str[2 * i]) << 4 | - virHexToBin(str[2 * i + 1])); + addr->addr[i] =3D (g_ascii_xdigit_value(str[2 * i]) << 4 | + g_ascii_xdigit_value(str[2 * i + 1])); return 0; } =20 diff --git a/src/vmx/vmx.c b/src/vmx/vmx.c index 4362da6cee..b0f7b6a977 100644 --- a/src/vmx/vmx.c +++ b/src/vmx/vmx.c @@ -28,7 +28,6 @@ #include "virconf.h" #include "viralloc.h" #include "virlog.h" -#include "viruuid.h" #include "vmx.h" #include "viruri.h" #include "virstring.h" @@ -673,7 +672,8 @@ virVMXUnescapeHex(char *string, char escape) if (!g_ascii_isxdigit(tmp1[1]) || !g_ascii_isxdigit(tmp1[2])) return -1; =20 - *tmp2++ =3D virHexToBin(tmp1[1]) * 16 + virHexToBin(tmp1[2]); + *tmp2++ =3D g_ascii_xdigit_value(tmp1[1]) * 16 + + g_ascii_xdigit_value(tmp1[2]); tmp1 +=3D 3; } else { *tmp2++ =3D *tmp1++; --=20 2.24.1