From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp-out2.suse.de (smtp-out2.suse.de [IPv6:2001:67c:2178:6::1d]) by sourceware.org (Postfix) with ESMTPS id B4D143858298 for ; Thu, 31 Aug 2023 07:57:52 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org B4D143858298 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=suse.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=suse.de Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id EE6A51F853; Thu, 31 Aug 2023 07:57:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1693468671; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=JmWmJLc+6NDAfS0nfa++nGM/ilg0A3E0Xbx69KrTZic=; b=uZOvehevNrHV9+aZ77LlGs2/l27ISUsWfb/v8YO1vu2rO9tNLJYSrE4DTLGS2FrfhS1HEB k9TkoyfnogUjTj25c91sN3WLLZ81caHYv1rfvJCCfyzhnTCPTxYL6UGzDmDNspvf5cmZzl AbTCXM+79Tfb0r39Iljz3AqGRdGVDsE= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1693468671; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=JmWmJLc+6NDAfS0nfa++nGM/ilg0A3E0Xbx69KrTZic=; b=MOLq8r6eEE67b/0YId+P/5DUK8L2bx8M941n7R4a/F2I1b+ls/usC3KjYKcrVQ9yKgu4CL tmNKKJQzSw5385Cg== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id D904513587; Thu, 31 Aug 2023 07:57:51 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id 3WflM/9H8GR4ZAAAMHmgww (envelope-from ); Thu, 31 Aug 2023 07:57:51 +0000 Message-ID: <6fb0a077-43c6-d122-7c23-df9aa1d8862f@suse.de> Date: Thu, 31 Aug 2023 09:57:44 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 2/6] [gdb/symtab] Factor out type::{alloc_fields,copy_fields} To: Tom Tromey , Tom de Vries via Gdb-patches References: <20230830191336.15885-1-tdevries@suse.de> <20230830191336.15885-2-tdevries@suse.de> <87r0nkqo7x.fsf@tromey.com> Content-Language: en-US From: Tom de Vries In-Reply-To: <87r0nkqo7x.fsf@tromey.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-5.9 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On 8/30/23 22:17, Tom Tromey wrote: >>>>>> "Tom" == Tom de Vries via Gdb-patches writes: > > Tom> After finding this code in buildsym_compunit::finish_block_internal: > Tom> ... > ftype-> set_fields > Tom> ((struct field *) > Tom> TYPE_ALLOC (ftype, nparams * sizeof (struct field))); > Tom> ... > Tom> and fixing PR30810 by using TYPE_ZALLOC, I wondered if there were more > Tom> locations that needed fixing. > > Tom> I decided to make things easier to spot by factoring out a new function > Tom> alloc_fields: > > Thanks. Seems like a good idea to me. > > Tom> +void type::alloc_fields (unsigned int nfields, bool init) > > gdb style is a newline after the return type. > There's a few cases of this. Ack, fixed and pushed the series. Thanks for the reviews. - Tom