From nobody Sat Apr 27 12:11:34 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1508525445132343.1737881274354; Fri, 20 Oct 2017 11:50:45 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 74CA1D6570; Fri, 20 Oct 2017 18:50:43 +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 4B07E5C3FA; Fri, 20 Oct 2017 18:50:43 +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 D547E1800C9B; Fri, 20 Oct 2017 18:50:42 +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 v9KIogm3031470 for ; Fri, 20 Oct 2017 14:50:42 -0400 Received: by smtp.corp.redhat.com (Postfix) id 20FA65D762; Fri, 20 Oct 2017 18:50:42 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-116-118.phx2.redhat.com [10.3.116.118]) by smtp.corp.redhat.com (Postfix) with ESMTP id DED735D75E for ; Fri, 20 Oct 2017 18:50:39 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 74CA1D6570 Authentication-Results: ext-mx09.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx09.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=libvir-list-bounces@redhat.com From: John Ferlan To: libvir-list@redhat.com Date: Fri, 20 Oct 2017 14:50:37 -0400 Message-Id: <20171020185037.11438-1-jferlan@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH] conf: Rename [n]macs and maxmacs to [n]names and maxnames 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: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Fri, 20 Oct 2017 18:50:44 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" To avoid further confusion - rename the array elements to what they are. Signed-off-by: John Ferlan --- Pushing as trivial as noted by: https://www.redhat.com/archives/libvir-list/2017-October/msg00981.html src/conf/virinterfaceobj.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/src/conf/virinterfaceobj.c b/src/conf/virinterfaceobj.c index 21d76e7507..f90c0bd9c4 100644 --- a/src/conf/virinterfaceobj.c +++ b/src/conf/virinterfaceobj.c @@ -160,9 +160,9 @@ virInterfaceObjListNew(void) struct _virInterfaceObjFindMACData { const char *matchStr; bool error; - int nmacs; - int maxmacs; - char **const macs; + int nnames; + int maxnames; + char **const names; }; =20 static int @@ -176,17 +176,17 @@ virInterfaceObjListFindByMACStringCb(void *payload, if (data->error) return 0; =20 - if (data->nmacs =3D=3D data->maxmacs) + if (data->nnames =3D=3D data->maxnames) return 0; =20 virObjectLock(obj); =20 if (STRCASEEQ(obj->def->mac, data->matchStr)) { - if (VIR_STRDUP(data->macs[data->nmacs], obj->def->name) < 0) { + if (VIR_STRDUP(data->names[data->nnames], obj->def->name) < 0) { data->error =3D true; goto cleanup; } - data->nmacs++; + data->nnames++; } =20 cleanup: @@ -203,9 +203,9 @@ virInterfaceObjListFindByMACString(virInterfaceObjListP= tr interfaces, { struct _virInterfaceObjFindMACData data =3D { .matchStr =3D mac, .error =3D false, - .nmacs =3D 0, - .maxmacs =3D maxmatches, - .macs =3D matches }; + .nnames =3D 0, + .maxnames =3D maxmatches, + .names =3D matches }; =20 virObjectRWLockRead(interfaces); virHashForEach(interfaces->objsName, virInterfaceObjListFindByMACStrin= gCb, @@ -215,11 +215,11 @@ virInterfaceObjListFindByMACString(virInterfaceObjLis= tPtr interfaces, if (data.error) goto error; =20 - return data.nmacs; + return data.nnames; =20 error: - while (--data.nmacs >=3D 0) - VIR_FREE(data.macs[data.nmacs]); + while (--data.nnames >=3D 0) + VIR_FREE(data.names[data.nnames]); =20 return -1; } --=20 2.13.6 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list