From nobody Wed May 8 09:14:20 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=1642586912; cv=none; d=zohomail.com; s=zohoarc; b=TIiiOcUxvNfYLqOmMLtgrNHbgR8wvJlge/DMD7R+Qy2Kp+cxuZDJS9HyFAowg7sez0Cbwm8jaIrMnxcUtKLk5reqlV5vhIMJvX/kWlc5c2xsrsQhyzlfN3gHvoQlNlobZJYXr1NNhjAhcqPU1mjisxs4Hw5uJyYTkgry+eG1cDg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1642586912; 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=CKubDSGztmKEpzf0eeqnegtJpzyMYAmyjsh6M1RZEmg=; b=LZHd95B9lJplJpwQvBVn4HWN1NwYRlJte5JcGCZoAASgzWy4u9ys0LQ9KNLFR+recE3f2Paqxpldz8ufSoia4ENvOmThvr+tjlbjYitklY5EO4WonlrXc3Sf6BH7GJBg1O8pCyAk01SbRu6oIU1eDw4q9dAJKDNQ6P8pmAxLAmg= 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 164258691261262.89054304562421; Wed, 19 Jan 2022 02:08:32 -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-16-QzVgJjB7O6uIyLnL3_XhYw-1; Wed, 19 Jan 2022 05:08: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 933031084C83; Wed, 19 Jan 2022 10:07:31 +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 6ED7373166; Wed, 19 Jan 2022 10:07:31 +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 3EBC01809CBA; Wed, 19 Jan 2022 10:07:31 +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 20JA6vZa021268 for ; Wed, 19 Jan 2022 05:06:57 -0500 Received: by smtp.corp.redhat.com (Postfix) id 7EAED54469; Wed, 19 Jan 2022 10:06:57 +0000 (UTC) Received: from work.redhat.com (unknown [10.39.194.112]) by smtp.corp.redhat.com (Postfix) with ESMTP id BFCFE5445E; Wed, 19 Jan 2022 10:06:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1642586911; 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=CKubDSGztmKEpzf0eeqnegtJpzyMYAmyjsh6M1RZEmg=; b=RZjaRc3b9nw3ZOSfByFexeuypHDpayz0JNNYzSWkCMMtLNqWtgvohIHlWMsnaijyuB2ztj Z9NSLmnLFScAqxFaHeBZGQyOdH1g693W1jTrBVgyaq+rjwi9EJOJUY3peCrI4iQAe8M4Mh C9J3lF4w4H2Eb8KVHsplqGtnIcyiqoE= X-MC-Unique: QzVgJjB7O6uIyLnL3_XhYw-1 From: Tim Wiederhake To: libvir-list@redhat.com Subject: [libvirt PATCH v3 1/2] docs: coding-style: Clarify on virXXXPtr types Date: Wed, 19 Jan 2022 11:06:53 +0100 Message-Id: <20220119100654.14973-2-twiederh@redhat.com> In-Reply-To: <20220119100654.14973-1-twiederh@redhat.com> References: <20220119100654.14973-1-twiederh@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 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: 1642586913898100001 Content-Type: text/plain; charset="utf-8" This partially reverts commit 9ccbed6afb. Signed-off-by: Tim Wiederhake Reviewed-by: Andrea Bolognani Reviewed-by: J=C3=A1n Tomko Reviewed-by: Michal Privoznik Reviewed-by: Pavel Hrdina Reviewed-by: Peter Krempa --- docs/coding-style.rst | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/docs/coding-style.rst b/docs/coding-style.rst index 37e6009db4..af928a16c0 100644 --- a/docs/coding-style.rst +++ b/docs/coding-style.rst @@ -53,11 +53,16 @@ Struct type names All structs should have a 'vir' prefix in their typedef name, 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. + name with a leading underscore. For types that are part of the + public API, a second typedef should be given for a pointer to + the struct with a 'Ptr' suffix. Do not introduce new such + typedefs for internal types. + :: =20 - typedef struct _virHashTable virHashTable; - struct _virHashTable { + typedef struct _virSomeType virSomeType; + typedef virSomeType *virSomeTypePtr; + struct _virSomeType { ... }; =20 @@ -69,8 +74,8 @@ Function names name prefix should match the object typedef name, otherwise it should match the filename. Following this comes the verb / action name, and finally an optional subject name. For example, - given an object 'virHashTable', all functions should have a - name 'virHashTable$VERB' or 'virHashTable$VERB$SUBJECT", e.g. + given an object 'virSomeType', all functions should have a + name 'virSomeType$VERB' or 'virSomeType$VERB$SUBJECT", e.g. 'virHashTableLookup' or 'virHashTableGetValue'. =20 Macro names --=20 2.31.1 From nobody Wed May 8 09:14:20 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=1642586905; cv=none; d=zohomail.com; s=zohoarc; b=X8GjeP5n7JlmkgbCFGeMwW5HgeKDSWrbXvol35qdjGmEQPTpgO5Qzrg8yKOUiDEPgDILAn8K66MJHPxiE4ee0XtXv6hijHn62Qsg0j6VndAztIca/6MXEyi3y2+WKPebES/wOf5/589zBXRkVBPVoYadO93eBiJxDy3t/CCskUY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1642586905; 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=heMeAAGWbcUfEk5YzmkJ6PrSsesyWPel7ikmRM5C7aM=; b=Um2KqlvxEH2xEKXU5UaWCmiv2GAYBno+GNP+EX11OQdYjIN4KHhKcSHkpjMvV8XV5AZ5EHL8K/fsH8UPMmKPytjyXxuZcrkOv9suTcLHiAq5KwsVw2Fdbg2Y/GnhgGl19AT69dwxoTVAM9qchhmVswLVEjaiuAulFLBySoIt16g= 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 1642586905955811.8801926564021; Wed, 19 Jan 2022 02:08:25 -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-362-5UgvrRChNN64BtGwpB-Rew-1; Wed, 19 Jan 2022 05:08:18 -0500 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id E8AB3108B87A; Wed, 19 Jan 2022 10:07:03 +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 0C1C34F872; Wed, 19 Jan 2022 10:07:03 +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 DF5524BB7C; Wed, 19 Jan 2022 10:06:59 +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 20JA6wwZ021278 for ; Wed, 19 Jan 2022 05:06:58 -0500 Received: by smtp.corp.redhat.com (Postfix) id 970EC54532; Wed, 19 Jan 2022 10:06:58 +0000 (UTC) Received: from work.redhat.com (unknown [10.39.194.112]) by smtp.corp.redhat.com (Postfix) with ESMTP id D692D6F126; Wed, 19 Jan 2022 10:06:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1642586905; 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=heMeAAGWbcUfEk5YzmkJ6PrSsesyWPel7ikmRM5C7aM=; b=Ljy4jf37PeZ4LfsiUVH/HxJGmWDACttJt3gpE0x9/ppzWg/FvLvkuC/z/bn9brd2cN5y0C xZRgcErFJmdvFKTp5eeI7HFSkaw71LuNgtQuU0dPiiTJczYsdLDBispDDZVeDnR/4EPpU3 +1QBjMfyItuwE5yVfFeIQQFGxDFH6eA= X-MC-Unique: 5UgvrRChNN64BtGwpB-Rew-1 From: Tim Wiederhake To: libvir-list@redhat.com Subject: [libvirt PATCH v3 2/2] docs: coding-style: One variable declaration per line Date: Wed, 19 Jan 2022 11:06:54 +0100 Message-Id: <20220119100654.14973-3-twiederh@redhat.com> In-Reply-To: <20220119100654.14973-1-twiederh@redhat.com> References: <20220119100654.14973-1-twiederh@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 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.15 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: 1642586906829100001 Content-Type: text/plain; charset="utf-8" This was not mentioned before. Signed-off-by: Tim Wiederhake Reviewed-by: Andrea Bolognani Reviewed-by: J=C3=A1n Tomko Reviewed-by: Michal Privoznik Reviewed-by: Pavel Hrdina Reviewed-by: Peter Krempa --- docs/coding-style.rst | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/docs/coding-style.rst b/docs/coding-style.rst index af928a16c0..cb23751721 100644 --- a/docs/coding-style.rst +++ b/docs/coding-style.rst @@ -600,6 +600,19 @@ calling another function. ... } =20 +Prefer variable definitions on separate lines. This allows for smaller, +easier to understand diffs when changing them. Define variables in the +smallest possible scope. + +:: + + GOOD: + int count =3D 0; + int nnodes; + + BAD: + int count =3D 0, nnodes; + Attribute annotations --------------------- =20 --=20 2.31.1