From nobody Tue Feb 10 12:57:32 2026 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; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1560874590; cv=none; d=zoho.com; s=zohoarc; b=WisMAUsCnhGuxdYl+/afikb5dAjPjfW39VpGKxxFgOWz6MKvKBseQFzI92NqgNzQLH4caAKr7cRczRF5VEleTGBOaNjMlBW7V57LxseC2h8WnhKVRRqgSCbHGYKidYweReaGYlfc5LlNXsdSp5KJpohqeDTqgcv07zg9sdH4ol8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1560874590; 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:ARC-Authentication-Results; bh=z/UqaYF76KsQsctDkT3qmNrPLGPV4Tn57IuMJI3MnHA=; b=UD5iCvHaTiCkdUXbU5d86uidgWXIlqBGUfO1BPhr11Dh/PQM4QAyrS9lQaA5dG+aJ4IcC5+Hxr36TC1qOmPvGXdoOqHtzaphIFdosDyCoU8xfpg79haoUWMiHh/Ps6/ivIyiXtBs70Tce9cBpxj4xBfY1TOI2SDBMuc/u4u4cA0= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1560874590304268.25853978537907; Tue, 18 Jun 2019 09:16:30 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id AA75164123; Tue, 18 Jun 2019 16:16:28 +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 7F7BF60634; Tue, 18 Jun 2019 16:16:28 +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 3CA251806B23; Tue, 18 Jun 2019 16:16:28 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x5IGDY5F024339 for ; Tue, 18 Jun 2019 12:13:34 -0400 Received: by smtp.corp.redhat.com (Postfix) id E0D3B60FAB; Tue, 18 Jun 2019 16:13:34 +0000 (UTC) Received: from aegolius.redhat.com (ovpn-117-198.phx2.redhat.com [10.3.117.198]) by smtp.corp.redhat.com (Postfix) with ESMTPS id ACEB984F4 for ; Tue, 18 Jun 2019 16:13:34 +0000 (UTC) From: Jonathon Jongsma To: libvir-list@redhat.com Date: Tue, 18 Jun 2019 11:13:02 -0500 Message-Id: <20190618161316.1722-33-jjongsma@redhat.com> In-Reply-To: <20190618161316.1722-1-jjongsma@redhat.com> References: <20190618161316.1722-1-jjongsma@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 32/46] util: string: use #pragma once in headers 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: , 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.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Tue, 18 Jun 2019 16:16:29 +0000 (UTC) Content-Type: text/plain; charset="utf-8" Signed-off-by: Jonathon Jongsma Reviewed-by: J=C3=A1n Tomko --- src/util/virstring.h | 37 +++++++++++++++++-------------------- 1 file changed, 17 insertions(+), 20 deletions(-) diff --git a/src/util/virstring.h b/src/util/virstring.h index b2cd8ea53c..5e64ad1bb9 100644 --- a/src/util/virstring.h +++ b/src/util/virstring.h @@ -16,12 +16,11 @@ * . */ =20 -#ifndef LIBVIRT_VIRSTRING_H -# define LIBVIRT_VIRSTRING_H +#pragma once =20 -# include +#include =20 -# include "internal.h" +#include "internal.h" =20 char **virStringSplitCount(const char *string, const char *delim, @@ -126,7 +125,7 @@ int virStrncpy(char *dest, const char *src, size_t n, s= ize_t destbytes) ATTRIBUTE_RETURN_CHECK; int virStrcpy(char *dest, const char *src, size_t destbytes) ATTRIBUTE_RETURN_CHECK; -# define virStrcpyStatic(dest, src) virStrcpy((dest), (src), sizeof(dest)) +#define virStrcpyStatic(dest, src) virStrcpy((dest), (src), sizeof(dest)) =20 /* Don't call these directly - use the macros below */ int virStrdup(char **dest, const char *src, bool report, int domcode, @@ -159,8 +158,8 @@ int virVasprintfInternal(bool report, int domcode, cons= t char *filename, * Returns -1 on failure (with OOM error reported), 0 if @src was NULL, * 1 if @src was copied */ -# define VIR_STRDUP(dst, src) virStrdup(&(dst), src, true, VIR_FROM_THIS, \ - __FILE__, __FUNCTION__, __LINE__) +#define VIR_STRDUP(dst, src) virStrdup(&(dst), src, true, VIR_FROM_THIS, \ + __FILE__, __FUNCTION__, __LINE__) =20 /** * VIR_STRDUP_QUIET: @@ -173,7 +172,7 @@ int virVasprintfInternal(bool report, int domcode, cons= t char *filename, * * Returns -1 on failure, 0 if @src was NULL, 1 if @src was copied */ -# define VIR_STRDUP_QUIET(dst, src) virStrdup(&(dst), src, false, 0, NULL,= NULL, 0) +#define VIR_STRDUP_QUIET(dst, src) virStrdup(&(dst), src, false, 0, NULL, = NULL, 0) =20 /** * VIR_STRNDUP: @@ -191,9 +190,9 @@ int virVasprintfInternal(bool report, int domcode, cons= t char *filename, * Returns -1 on failure (with OOM error reported), 0 if @src was NULL, * 1 if @src was copied */ -# define VIR_STRNDUP(dst, src, n) virStrndup(&(dst), src, n, true, \ - VIR_FROM_THIS, __FILE__, \ - __FUNCTION__, __LINE__) +#define VIR_STRNDUP(dst, src, n) virStrndup(&(dst), src, n, true, \ + VIR_FROM_THIS, __FILE__, \ + __FUNCTION__, __LINE__) =20 /** * VIR_STRNDUP_QUIET: @@ -211,8 +210,8 @@ int virVasprintfInternal(bool report, int domcode, cons= t char *filename, * * Returns -1 on failure, 0 if @src was NULL, 1 if @src was copied */ -# define VIR_STRNDUP_QUIET(dst, src, n) virStrndup(&(dst), src, n, false, \ - 0, NULL, NULL, 0) +#define VIR_STRNDUP_QUIET(dst, src, n) virStrndup(&(dst), src, n, false, \ + 0, NULL, NULL, 0) =20 size_t virStringListLength(const char * const *strings); =20 @@ -225,7 +224,7 @@ size_t virStringListLength(const char * const *strings); * Returns -1 on failure (with OOM error reported), number of bytes printed * on success. */ -# define virVasprintf(strp, fmt, list) \ +#define virVasprintf(strp, fmt, list) \ virVasprintfInternal(true, VIR_FROM_THIS, __FILE__, __FUNCTION__, \ __LINE__, strp, fmt, list) =20 @@ -236,7 +235,7 @@ size_t virStringListLength(const char * const *strings); * * Returns -1 on failure, number of bytes printed on success. */ -# define virVasprintfQuiet(strp, fmt, list) \ +#define virVasprintfQuiet(strp, fmt, list) \ virVasprintfInternal(false, 0, NULL, NULL, 0, strp, fmt, list) =20 /** @@ -251,7 +250,7 @@ size_t virStringListLength(const char * const *strings); * on success. */ =20 -# define virAsprintf(strp, ...) \ +#define virAsprintf(strp, ...) \ virAsprintfInternal(true, VIR_FROM_THIS, __FILE__, __FUNCTION__, __LIN= E__, \ strp, __VA_ARGS__) =20 @@ -265,7 +264,7 @@ size_t virStringListLength(const char * const *strings); * Returns -1 on failure, number of bytes printed on success. */ =20 -# define virAsprintfQuiet(strp, ...) \ +#define virAsprintfQuiet(strp, ...) \ virAsprintfInternal(false, 0, NULL, NULL, 0, \ strp, __VA_ARGS__) =20 @@ -324,7 +323,5 @@ int virStringParseYesNo(const char *str, * Declares a NULL-terminated list of strings which will be automatically = freed * when the pointer goes out of scope. */ -# define VIR_AUTOSTRINGLIST \ +#define VIR_AUTOSTRINGLIST \ __attribute__((cleanup(virStringListAutoFree))) char ** - -#endif /* LIBVIRT_VIRSTRING_H */ --=20 2.20.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list