From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([209.51.188.92]:35562) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gjjhp-0007TO-KJ for qemu-devel@nongnu.org; Wed, 16 Jan 2019 06:50:02 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gjjhn-0008N8-KL for qemu-devel@nongnu.org; Wed, 16 Jan 2019 06:50:01 -0500 References: <20190111140857.4211-1-philmd@redhat.com> <20190111140857.4211-4-philmd@redhat.com> <875zuqjea7.fsf@dusky.pond.sub.org> <403ad2e4-3282-051c-1ff5-8a3a23899293@redhat.com> <87sgxtatod.fsf@dusky.pond.sub.org> <4b24723e-5a27-f25f-76c1-f2f4e94757ba@redhat.com> <20190116113455.dyl6uctl4dpaqh6v@sirius.home.kraxel.org> From: Paolo Bonzini Message-ID: Date: Wed, 16 Jan 2019 12:49:07 +0100 MIME-Version: 1.0 In-Reply-To: <20190116113455.dyl6uctl4dpaqh6v@sirius.home.kraxel.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 03/15] hw/ssi: Remove SSIBus from "qemu/typedefs.h" List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Gerd Hoffmann Cc: Markus Armbruster , Thomas Huth , =?UTF-8?Q?Philippe_Mathieu-Daud=c3=a9?= , Peter Maydell , Peter Crosthwaite , Xiao Guangrong , qemu-block@nongnu.org, "Michael S. Tsirkin" , Alistair Francis , qemu-devel@nongnu.org, =?UTF-8?Q?Philippe_Mathieu-Daud=c3=a9?= , Greg Kurz , qemu-arm@nongnu.org, Igor Mammedov , Laszlo Ersek , =?UTF-8?Q?C=c3=a9dric_Le_Goater?= On 16/01/19 12:34, Gerd Hoffmann wrote: > Hi, > >> typedefs.h is useful to avoid rebuilding the world too often if a type >> is used many times as a pointer, but rarely as a struct and rarely has >> functions called on its instances. > > Related: Can also be used to keep struct content private. struct > QemuConsole for example is private to ui/console.c, but pointers to > QemuConsole are passed around alot in ui/* and hw/display/* code. True, though as we switch more and more from pointers to embedded structs that does not work that much anymore. Another way to do that is to split the header in include/path/to/foo.h and path/to/foo_internal.h. Paolo