From nobody Tue Apr 16 15:52:34 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 207.211.31.120 as permitted sender) client-ip=207.211.31.120; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zoho.com: domain of redhat.com designates 207.211.31.120 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=1571926338; cv=none; d=zoho.com; s=zohoarc; b=QNJAb+INKxV3ov3JUySo3Pl8jyvK0tlZLW1obNPSf41G5LhtYBz9yig/FpacDrHBto9aHpnj1U8+mlhC2DpIfz2eVlR+OY593WI5nocz4+f/RFeimMA25vvEtAnvMTIUKrPS2J/JjTbukpBcTiZ1dy62kNRp+cjca0lSsHTAlAI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1571926338; h=Content-Type:Content-Transfer-Encoding:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=YXWJ2JqZe14qusfUiPiT4bVwxvlJk3lHg91VD2fxEH0=; b=jL/uRI5odhUsuwgWyoMiqQMWIh/9D+VlGrqLrFInECU9v3s7iIb8fACwjY3GGNLx92lvXpP1LN6xIX3Z2nuWA1R6agzkc5zhJ/+7iH2yCZV2/zsIRwACIsuqOHCiGh3jsL7BtRSiLzTb4p9Ta+9tkqk6VNmtVVfPoGj9Q0DqPEQ= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=pass; spf=pass (zoho.com: domain of redhat.com designates 207.211.31.120 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-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) by mx.zohomail.com with SMTPS id 1571926338644154.20805983556386; Thu, 24 Oct 2019 07:12:18 -0700 (PDT) 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-117-OYm5EVFPOMG_nYTL_baaAg-1; Thu, 24 Oct 2019 10:12:13 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 68FD91800DD0; Thu, 24 Oct 2019 14:12: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 19135196B2; Thu, 24 Oct 2019 14:12:08 +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 85AA01803B4B; Thu, 24 Oct 2019 14:12:05 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x9OEC4tW028145 for ; Thu, 24 Oct 2019 10:12:04 -0400 Received: by smtp.corp.redhat.com (Postfix) id 51BA760166; Thu, 24 Oct 2019 14:12:04 +0000 (UTC) Received: from angien.redhat.com (unknown [10.43.2.229]) by smtp.corp.redhat.com (Postfix) with ESMTP id CF6C26012E for ; Thu, 24 Oct 2019 14:12:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1571926337; 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:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=YXWJ2JqZe14qusfUiPiT4bVwxvlJk3lHg91VD2fxEH0=; b=eYd7OS/L+dnxveR3q52gtpKy8E6Vfd2sqAHUITM3tinIF3ve20ePxKflPpk/o3z3AJS8w0 L5/qjrhvjmMaHxNlWedYXW51fCRrDZjZ+tNqTVZS8B0nVH7YSIc1+Hc+bvvoPvufqFnG4A axmuErqflTvqutIgHerfebcNWanXr4w= From: Peter Krempa To: libvir-list@redhat.com Date: Thu, 24 Oct 2019 16:12:00 +0200 Message-Id: <88e207cf093e9dad9d10899d6dce8e5729fd17e4.1571926064.git.pkrempa@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH] internal: Use g_strcmp0 in STR(N)EQ_NULLABLE 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.23 X-MC-Unique: OYm5EVFPOMG_nYTL_baaAg-1 X-Mimecast-Spam-Score: 0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- src/internal.h | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/internal.h b/src/internal.h index 5b0a2335f5..0ff9f496ac 100644 --- a/src/internal.h +++ b/src/internal.h @@ -86,10 +86,8 @@ #define STRCASEPREFIX(a, b) (c_strncasecmp(a, b, strlen(b)) =3D=3D 0) #define STRSKIP(a, b) (STRPREFIX(a, b) ? (a) + strlen(b) : NULL) -#define STREQ_NULLABLE(a, b) \ - ((a) ? (b) && STREQ((a), (b)) : !(b)) -#define STRNEQ_NULLABLE(a, b) \ - ((a) ? !(b) || STRNEQ((a), (b)) : !!(b)) +#define STREQ_NULLABLE(a, b) (g_strcmp0(a, b) =3D=3D 0) +#define STRNEQ_NULLABLE(a, b) (g_strcmp0(a, b) !=3D 0) #define NUL_TERMINATE(buf) do { (buf)[sizeof(buf)-1] =3D '\0'; } while (0) --=20 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list