From nobody Sun May 5 03:55:53 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.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 216.205.24.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=1615837244; cv=none; d=zohomail.com; s=zohoarc; b=Be2vFvJXV5V6mpa+T5veii8y6d7jNkjNAAyvSsMLwsbLQrOHFrlRM/vlpUyKfHVrWuzlxFHZ2LYidnfy79Sg9gumqDoxAsfAzDgQb7KfAZp6cUxTGOd0MvQmMewkBo0FNirYCwDsvtaq1TzEQhlll65loCE+ujuu1avmZQr6JME= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1615837244; 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=LewqANOomIFcOnfR6o/H74lM51hKp+iF1qN7BUlySys=; b=GkwEveFcjreB1we77mQ7uVstQ2YoVbrf+oyX/H5qXFlyKsYI0ec26S2XqXHRUtMimIDP3P4HuOTDAoB3aAATPv2SRgJHTqntUM0JgsGAP6aARJ4Tnqs1IQtU2HySU1kYP3DDGp0RqT9cw+I7ayVaADcr4PWdPMUe0qxEgc8WS8c= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 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-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mx.zohomail.com with SMTPS id 1615837244517855.8877720244275; Mon, 15 Mar 2021 12:40:44 -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-259-VDM9AjNLO3OgIjIluYHw6g-1; Mon, 15 Mar 2021 15:40:41 -0400 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 1F56319057AD; Mon, 15 Mar 2021 19:40:35 +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 CF3766B8E8; Mon, 15 Mar 2021 19:40:33 +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 326AF18155DE; Mon, 15 Mar 2021 19:40:31 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 12FJeUXf018505 for ; Mon, 15 Mar 2021 15:40:30 -0400 Received: by smtp.corp.redhat.com (Postfix) id 2A1F92C6FA; Mon, 15 Mar 2021 19:40:30 +0000 (UTC) Received: from localhost.localdomain (unknown [10.40.194.27]) by smtp.corp.redhat.com (Postfix) with ESMTP id A064E67879 for ; Mon, 15 Mar 2021 19:40:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1615837243; 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=LewqANOomIFcOnfR6o/H74lM51hKp+iF1qN7BUlySys=; b=R0c7ucbsYhHngqHVLBd+E1VmIeQaQLTABb3aZIPy10oT2jhrg9pmIhhwDpzgZErznNIeVu 9k2Is0zLEY4o0o6E6BgWoerV3IbqU+YBC5Zrp26Ujht+VxrZg+2K1Xy/ImrimRNzBDMGs8 rFOtJYEkMeIIoML3OqdRUC6fTQ6cc0s= X-MC-Unique: VDM9AjNLO3OgIjIluYHw6g-1 From: Michal Privoznik To: libvir-list@redhat.com Subject: [PATCH] coding-style: Don't encourage virXXXPtr typedefs Date: Mon, 15 Mar 2021 20:40:22 +0100 Message-Id: <112f6fe12ceb7a859ac5564cc2512d1383bfd0d4.1615837222.git.mprivozn@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-loop: libvir-list@redhat.com 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) Content-Type: text/plain; charset="utf-8" We don't like virXXXPtr typedefs really and they are going away shortly, possibly. Do not encourage new code to put in the typedefs. Signed-off-by: Michal Privoznik --- docs/coding-style.rst | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/docs/coding-style.rst b/docs/coding-style.rst index 22de86a657..470c61860f 100644 --- a/docs/coding-style.rst +++ b/docs/coding-style.rst @@ -53,13 +53,10 @@ 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. A second typedef should be - given for a pointer to the struct with a 'Ptr' suffix. - + name with a leading underscore. :: =20 typedef struct _virHashTable virHashTable; - typedef virHashTable *virHashTablePtr; struct _virHashTable { ... }; @@ -426,11 +423,11 @@ Conditional expressions =20 For readability reasons new code should avoid shortening comparisons to 0 for numeric types. Boolean and pointer -comparisions may be shortened. All long forms are okay: +comparisons may be shortened. All long forms are okay: =20 :: =20 - virFooPtr foos =3D NULL; + virFoo *foos =3D NULL; size nfoos =3D 0; bool hasFoos =3D false; =20 --=20 2.26.2