From nobody Fri Apr 19 23:15:23 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 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=1642171893; cv=none; d=zohomail.com; s=zohoarc; b=d32fIClqLV426ZzaNfObEumsmdCiZ270V63GS59bHDbsRBmgvdMCiKuHefx0f9E12xLxoqifWpCaayYTPZvO3bS0qb+OvCpbicmdoECwY89kGCu/8lvDEelefDswZ/PAKaS8speYfoD6z7zrkey7Kpyv3u5gj47WAY5nLaY6DY0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1642171893; h=Content-Type:Content-Transfer-Encoding:Cc: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=6SxK3kElV07sIYjvL0SQoMpRlrGBNLc/2YfAdtu+XaE=; b=EZREQk8r7Km3ZSWWhfKXp2QaF6TkoVpChp6/RbKUT9hGWxN9WwTyBGCK9QBMpltjCXK6fj61MzPzUtD/8NSfUxvO9l4YaAeWcs9xJFBhjvV3e8wUt9xpzQmx3nNAmr0He23nUbbsJrCxrPQPwS27eQZq62150enlrqlSWPeauWA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mx.zohomail.com with SMTPS id 1642171893783104.58424741384249; Fri, 14 Jan 2022 06:51:33 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-271-LCj-DG-dNzi57gSEpC3z0g-1; Fri, 14 Jan 2022 09:51:29 -0500 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 mimecast-mx01.redhat.com (Postfix) with ESMTPS id E7A661006AA3; Fri, 14 Jan 2022 14:51:21 +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 B201C84D0B; Fri, 14 Jan 2022 14:51:21 +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 375D51802E2B; Fri, 14 Jan 2022 14:51:21 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 20EEpJec032236 for ; Fri, 14 Jan 2022 09:51:19 -0500 Received: by smtp.corp.redhat.com (Postfix) id 2A99B2BCC1; Fri, 14 Jan 2022 14:51:19 +0000 (UTC) Received: from work.redhat.com (unknown [10.39.194.120]) by smtp.corp.redhat.com (Postfix) with ESMTP id 595F42B6CA; Fri, 14 Jan 2022 14:51:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1642171892; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc: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=6SxK3kElV07sIYjvL0SQoMpRlrGBNLc/2YfAdtu+XaE=; b=eSAYBVbZLcycErt/0NVX7xQkgAuj0hAoRaQOnOadWj6T/Eit9vhy2CFjT9FslS9OfA/PvR VpMifQX8i+rNcdTiprkj7jrcRRrdgzDhkHD3szTPDe5ChKTxD3pI/Wox6gVWbr+OmCR42y 67T6YqiIYUUPWvKuZ1LcKyr2D9Gn3xg= X-MC-Unique: LCj-DG-dNzi57gSEpC3z0g-1 From: Tim Wiederhake To: libvir-list@redhat.com Subject: [libvirt PATCH 1/4] docs: coding-style: Clarify on virXXXPtr types Date: Fri, 14 Jan 2022 15:51:13 +0100 Message-Id: <20220114145116.34866-2-twiederh@redhat.com> In-Reply-To: <20220114145116.34866-1-twiederh@redhat.com> References: <20220114145116.34866-1-twiederh@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-loop: libvir-list@redhat.com Cc: Tim Wiederhake 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.79 on 10.5.11.13 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1642171895229100001 Content-Type: text/plain; charset="utf-8" Signed-off-by: Tim Wiederhake --- docs/coding-style.rst | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/docs/coding-style.rst b/docs/coding-style.rst index 470c61860f..dca9de1915 100644 --- a/docs/coding-style.rst +++ b/docs/coding-style.rst @@ -54,6 +54,7 @@ Struct type names and each following word should have its first letter in uppercase. The struct name should be the same as the typedef name with a leading underscore. + :: =20 typedef struct _virHashTable virHashTable; @@ -61,6 +62,10 @@ Struct type names ... }; =20 + Historically, libvirt declared pointer types 'virXXXPtr' for + both public and internal types. Do not introduce new such + typedefs for internal types. + Function names All functions should have a 'vir' prefix in their name, followed by one or more words with first letter of each word --=20 2.31.1 From nobody Fri Apr 19 23:15:23 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 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=1642171915; cv=none; d=zohomail.com; s=zohoarc; b=Nsb0OfmHxBbSjmPljgNgFbJP12Vfu/Wo/xkPt86EuaNj1kniLyYbmcJHEkpLFznPnE+e39WgLi7dOv/qO5C7VoAgYdNiYjBdIHBy+dhMLiuw/OFAMmgM8IhXpltoJm1fcxbjP9p3vf6QRm7ym14BaNdIqPgkofQiGKkYDZ2+CBI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1642171915; h=Content-Type:Content-Transfer-Encoding:Cc: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=z3S14mYdcNWfIF9k5ZbWpQjcAkxQD10W22XHsgXG7lg=; b=hJMsLyraxRN70w2uJzOvrDldDWJKrBZhuDmR3u5BOHcVCZK9+VzWOwAYfe69Z+kZ8re0+yAq7zPJc/uVc3RpnMqlYyNtjNfpVZKDZQzo8dtqaXaOewyxX6gQbcwikBH7KXM/XN20AdTKRbO1lF6YvsmshXmxCyYQAl7clroMDMw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 1642171915421916.3479379896545; Fri, 14 Jan 2022 06:51:55 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-250-GWv7cC7iP8uJWo-UrLBHow-1; Fri, 14 Jan 2022 09:51:53 -0500 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 52FFC1083F65; Fri, 14 Jan 2022 14:51:48 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 2D3752BCD8; Fri, 14 Jan 2022 14:51:48 +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 EF9DE4A709; Fri, 14 Jan 2022 14:51:47 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 20EEpKth032247 for ; Fri, 14 Jan 2022 09:51:20 -0500 Received: by smtp.corp.redhat.com (Postfix) id 595E42BCC1; Fri, 14 Jan 2022 14:51:20 +0000 (UTC) Received: from work.redhat.com (unknown [10.39.194.120]) by smtp.corp.redhat.com (Postfix) with ESMTP id 910F42B6CA; Fri, 14 Jan 2022 14:51:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1642171914; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc: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=z3S14mYdcNWfIF9k5ZbWpQjcAkxQD10W22XHsgXG7lg=; b=E1MGcm9CC9ycmtq+zs4GBPtg7N/KKY+9l7GH2qCHEqIrXyQx/dN321HSXhyTVHd8MBvdic VUzmHN8etFZguq7QhNiKVbWd2JMMSBiBmruvWhdFU8g6mRrJVP3f00NMcrW9LLplT3Mwzr /5XrwtNvnQT0ggQX+3j3oXr9wpU8IoQ= X-MC-Unique: GWv7cC7iP8uJWo-UrLBHow-1 From: Tim Wiederhake To: libvir-list@redhat.com Subject: [libvirt PATCH 2/4] docs: coding-style: Rewrite section on shortening comparisons Date: Fri, 14 Jan 2022 15:51:14 +0100 Message-Id: <20220114145116.34866-3-twiederh@redhat.com> In-Reply-To: <20220114145116.34866-1-twiederh@redhat.com> References: <20220114145116.34866-1-twiederh@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-loop: libvir-list@redhat.com Cc: Tim Wiederhake 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 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1642171917504100001 Content-Type: text/plain; charset="utf-8" The code style showed `bool hasFoos; if (hasFoos =3D=3D true)` as a good example in one place, only to warn against comparisons with `true` a couple of paragraphs further down. Merge this advice on comparing with `true` into the "Conditional expressions" section and split the example up for readability. Signed-off-by: Tim Wiederhake --- docs/coding-style.rst | 60 +++++++++++++++++++++++++++---------------- 1 file changed, 38 insertions(+), 22 deletions(-) diff --git a/docs/coding-style.rst b/docs/coding-style.rst index dca9de1915..3dedb032f4 100644 --- a/docs/coding-style.rst +++ b/docs/coding-style.rst @@ -427,25 +427,47 @@ Conditional expressions ----------------------- =20 For readability reasons new code should avoid shortening -comparisons to 0 for numeric types. Boolean and pointer -comparisons may be shortened. All long forms are okay: +comparisons to 0 for numeric types: =20 :: =20 - virFoo *foos =3D NULL; size nfoos =3D 0; - bool hasFoos =3D false; =20 GOOD: - if (!foos) - if (!hasFoos) + if (nfoos !=3D 0) if (nfoos =3D=3D 0) - if (foos =3D=3D NULL) - if (hasFoos =3D=3D true) =20 BAD: - if (!nfoos) if (nfoos) + if (!nfoos) + +Prefer the shortened version for boolean values. Boolean values +should never be compared against the literal ``true``, as a +logical non-false value need not be ``1``. + +:: + + bool hasFoos =3D false; + + GOOD: + if (hasFoos) + if (!hasFoos) + + BAD: + if (hasFoos =3D=3D true) + if (hasFoos !=3D false) + if (hasFoos =3D=3D false) + if (hasFoos !=3D true) + +Pointer comparisons may be shortened. All long forms are okay. + +:: + + virFoo *foo =3D NULL; + + GOOD: + if (foo) # or: if (foo !=3D NULL) + if (!foo) # or: if (foo =3D=3D NULL) =20 New code should avoid the ternary operator as much as possible. Specifically it must never span more than one line or nest: @@ -507,19 +529,13 @@ Scalars - In the unusual event that you require a specific width, use a standard type like ``int32_t``, ``uint32_t``, ``uint64_t``, etc. -- While using ``bool`` is good for readability, it comes with - minor caveats: - - - Don't use ``bool`` in places where the type size must be - constant across all systems, like public interfaces and - on-the-wire protocols. Note that it would be possible - (albeit wasteful) to use ``bool`` in libvirt's logical wire - protocol, since XDR maps that to its lower-level ``bool_t`` - type, which **is** fixed-size. - - Don't compare a bool variable against the literal, ``true``, - since a value with a logical non-false value need not be - ``1``. I.e., don't write ``if (seen =3D=3D true) ...``. Rather, - write ``if (seen)...``. +- While using ``bool`` is good for readability, it comes with a + minor caveat: Don't use ``bool`` in places where the type size + must be constant across all systems, like public interfaces and + on-the-wire protocols. Note that it would be possible (albeit + wasteful) to use ``bool`` in libvirt's logical wire protocol, + since XDR maps that to its lower-level ``bool_t`` type, which + **is** fixed-size. =20 Of course, take all of the above with a grain of salt. If you're about to use some system interface that requires a type like --=20 2.31.1 From nobody Fri Apr 19 23:15:23 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 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=1642171894; cv=none; d=zohomail.com; s=zohoarc; b=SKw1SBjKhXHL+vX6a95BRPoA0u5KVR59/hUgtEqFvH8vuR49ea+TJcjU6k12haYJkr3s/2gfbUJv9zVY+GhnQ2NVZsTDMivF2uXbplpax+H2bXrlHUJ/hBMKUg+IZpjP9sg5PcZk2FbWk1SRBH9SO78Jhf6k6E0RTMWalBmSg9w= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1642171894; h=Content-Type:Content-Transfer-Encoding:Cc: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=gs3YqTMZMIlfwbyfHZK2gxaBriXH9+PDoCoghu351C8=; b=MfI8zcNUHrqTzzmG9o906jIJOEYBj8UfBRAbOAwiAwA68IsEdnbDRepLaPvbXo9ijnRT/+VMM2of3FSbHJ7BL7IaApR0LsZnAe0TvxOVDm/MHMo8CkmP/C3EDRrR5gw0ZdKwQUyMYel0WuVJJeFLeYHRvQ8V30neLt9KYqOemcs= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mx.zohomail.com with SMTPS id 1642171894353901.3157623982268; Fri, 14 Jan 2022 06:51:34 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-633-yd6mirJpPNemwx1TXIg8YA-1; Fri, 14 Jan 2022 09:51:30 -0500 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 mimecast-mx01.redhat.com (Postfix) with ESMTPS id 39A84363AD; Fri, 14 Jan 2022 14:51:23 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 1179A84D24; Fri, 14 Jan 2022 14:51:23 +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 CDBBF4BB7C; Fri, 14 Jan 2022 14:51:22 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 20EEpLVm032258 for ; Fri, 14 Jan 2022 09:51:21 -0500 Received: by smtp.corp.redhat.com (Postfix) id 9244E2B6D5; Fri, 14 Jan 2022 14:51:21 +0000 (UTC) Received: from work.redhat.com (unknown [10.39.194.120]) by smtp.corp.redhat.com (Postfix) with ESMTP id B9BB92B6CA; Fri, 14 Jan 2022 14:51:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1642171893; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc: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=gs3YqTMZMIlfwbyfHZK2gxaBriXH9+PDoCoghu351C8=; b=ZOtOoo7kwKANFVRspQGu8jfEQ/vV2F80q00ZidiGYEmvygwmnlGjKSohZ9Qg6A4TmPDYL0 cq7lOR84JB47e//QKxmCuD3bwwRL7FDD1O/9rxpW7N7CsRpuMtVNacJFpAXzGTlF9tsVXV 2H/bOQn+uUEcQf2GBQeZNX9+b/TT/Lg= X-MC-Unique: yd6mirJpPNemwx1TXIg8YA-1 From: Tim Wiederhake To: libvir-list@redhat.com Subject: [libvirt PATCH 3/4] docs: coding-style: Remove "no_memory" as acceptable goto target Date: Fri, 14 Jan 2022 15:51:15 +0100 Message-Id: <20220114145116.34866-4-twiederh@redhat.com> In-Reply-To: <20220114145116.34866-1-twiederh@redhat.com> References: <20220114145116.34866-1-twiederh@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-loop: libvir-list@redhat.com Cc: Tim Wiederhake 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.79 on 10.5.11.13 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1642171895373100003 Content-Type: text/plain; charset="utf-8" There are no instances of that label left. Signed-off-by: Tim Wiederhake Reviewed-by: J=C3=A1n Tomko --- docs/coding-style.rst | 1 - 1 file changed, 1 deletion(-) diff --git a/docs/coding-style.rst b/docs/coding-style.rst index 3dedb032f4..14c5136398 100644 --- a/docs/coding-style.rst +++ b/docs/coding-style.rst @@ -953,7 +953,6 @@ makes sense: =20 error: A path only taken upon return with an error code cleanup: A path taken upon return with success code + optional error - no_memory: A path only taken upon return with an OOM error code retry: If needing to jump upwards (e.g., retry on EINTR) =20 Top-level labels should be indented by one space (putting them on --=20 2.31.1 From nobody Fri Apr 19 23:15:23 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 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=1642171902; cv=none; d=zohomail.com; s=zohoarc; b=nggtZl1vpuT+5VckJHXDDvlme+QQuBcAOd+HoseaOonDMlndcLUkwpZWpwJT76vl+4NAyuMC0qB34c5dB+quEyIsai44bJ+3oqNFPCt21O49OLq5nR5yjudFvD2clAWxavNzZKyjXWwW9nGHIvSzPwgFm5rLlH8R1320bh3G2fg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1642171902; h=Content-Type:Content-Transfer-Encoding:Cc: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=/c5HCNRgkbW1cW69wqE5x8u6hnsr3JHgzhiStyooI2I=; b=TunAFoLg2MpdMisW8mvcRyvjeiktq40BTv9G9nwCsgRDOnSJ8qSqR6wB17nyaYxHcD/ZoDavassdHthOydpyoXOnp9nwxvmBXtlfFJpUJCcMM55niuNoKqSHrB9JOfBmpXp9QoTJzu8p2r6y67vL4DXNoQ1xpvvn5re1R3tIq4Y= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 164217190214722.982670667952902; Fri, 14 Jan 2022 06:51:42 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-554-NdLqrUqfMbCBRnbuMdwH1g-1; Fri, 14 Jan 2022 09:51:37 -0500 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 mimecast-mx01.redhat.com (Postfix) with ESMTPS id CB5931083F65; Fri, 14 Jan 2022 14:51:29 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id A51B97B6F4; Fri, 14 Jan 2022 14:51:29 +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 436364A7C9; Fri, 14 Jan 2022 14:51:29 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 20EEpMN4032268 for ; Fri, 14 Jan 2022 09:51:22 -0500 Received: by smtp.corp.redhat.com (Postfix) id AFDD22BCC1; Fri, 14 Jan 2022 14:51:22 +0000 (UTC) Received: from work.redhat.com (unknown [10.39.194.120]) by smtp.corp.redhat.com (Postfix) with ESMTP id EE4912B6CA; Fri, 14 Jan 2022 14:51:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1642171901; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc: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=/c5HCNRgkbW1cW69wqE5x8u6hnsr3JHgzhiStyooI2I=; b=bCWFCpv2ynjVADMgcZDT+hlMzNRT2rNnwC6YiqzLGRbS+EQfRrQaDvIEwKxFzYFxS9Jqb3 cnKtMW7yL/7OINqT099kOQ7tnbyjK4uPr5eCeGPu8hI12H+MYq0tl9zXWQFhAQo/YbWR/a TwbMsh6LnmiD1HHJPcbYWlne5FPGcKY= X-MC-Unique: NdLqrUqfMbCBRnbuMdwH1g-1 From: Tim Wiederhake To: libvir-list@redhat.com Subject: [libvirt PATCH 4/4] docs: coding-style: One variable declaration per line Date: Fri, 14 Jan 2022 15:51:16 +0100 Message-Id: <20220114145116.34866-5-twiederh@redhat.com> In-Reply-To: <20220114145116.34866-1-twiederh@redhat.com> References: <20220114145116.34866-1-twiederh@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-loop: libvir-list@redhat.com Cc: Tim Wiederhake 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.79 on 10.5.11.16 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1642171902736100001 Content-Type: text/plain; charset="utf-8" This was not mentioned before. Signed-off-by: Tim Wiederhake Reviewed-by: J=C3=A1n Tomko --- docs/coding-style.rst | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/docs/coding-style.rst b/docs/coding-style.rst index 14c5136398..e1ed34f764 100644 --- a/docs/coding-style.rst +++ b/docs/coding-style.rst @@ -600,6 +600,19 @@ calling another function. ... } =20 +Define variables on separate lines. This allows for smaller, easier to +understand diffs when changing them. Define variables in the smallest +possible scope. + +:: + + GOOD: + int x; + int y; + + BAD: + int x, y; + Attribute annotations --------------------- =20 --=20 2.31.1