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 B11E63858D20 for ; Sun, 25 Dec 2022 17:56:12 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org B11E63858D20 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 D2713201F5; Sun, 25 Dec 2022 17:56:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1671990970; h=from:from:reply-to: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; bh=H+EyFxXJD2+escU4zBgyWBmPxsCbC5MJn0JVAXUJHJI=; b=DnwNFszNQzFk6KeHoUJhHcNL0WmfUO83SNdHKm2+Wkouujl6NMSb7SeEcp+5mHySGvs4+r e0jJP/p4TdwnTua2FugaghJMwZDEXHLCu+aHnSBWGsYLUCZzcXsNN1q2lBVQfOrF2534Xj 4vlIwtqhuR9s72pkFuz/qGF6BXus9J4= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1671990970; h=from:from:reply-to: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; bh=H+EyFxXJD2+escU4zBgyWBmPxsCbC5MJn0JVAXUJHJI=; b=lTEgL38tBVGB5Fq9MxHazsBGASiy7pBngCdM6Mf75gKIr1ekFM6rjeM+UxT6O3L/A/88/0 F+7fva22pCcqZLCg== 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 CA965138F2; Sun, 25 Dec 2022 17:56:10 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id i5tAMbqOqGNpYwAAMHmgww (envelope-from ); Sun, 25 Dec 2022 17:56:10 +0000 MIME-Version: 1.0 Date: Sun, 25 Dec 2022 17:56:10 +0000 From: tdevries To: Tom Tromey Cc: tdevries via Gdb-patches Subject: Re: [PATCH] Add initializers to comp_unit_head In-Reply-To: <87sfh3cxc0.fsf@tromey.com> References: <20221224224435.760523-1-tom@tromey.com> <71d0815665fb2b2c4904264b023840d1@suse.de> <87sfh3cxc0.fsf@tromey.com> User-Agent: Roundcube Webmail Message-ID: <74dd4be1f399773c5cb7fc9ab188f358@suse.de> X-Sender: tdevries@suse.de Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-6.6 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 2022-12-25 15:33, Tom Tromey wrote: >>>>>> tdevries via Gdb-patches writes: > >> FWIW, I've rebased the patch attached to the PR on your patch, and I'm >> left with the patch below, which makes the length field of >> comp_unit_head private. > >> /* Return the total length of the CU described by this header. */ >> - unsigned int get_length () const >> + unsigned int get_length (bool include_initial = true) const >> { >> - return initial_length_size + length; >> + unsigned int res = m_length; >> + if (include_initial) >> + res += initial_length_size; >> + return res; > > I think that since the callers all statically decide which length they > want, there should probably just be two methods with different names. > OK, so how about: - get_length_with_initial - get_length_without_initial ? Thanks, - Tom > Tom