From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-io1-xd31.google.com (mail-io1-xd31.google.com [IPv6:2607:f8b0:4864:20::d31]) by sourceware.org (Postfix) with ESMTPS id A0ECC3858C2C for ; Mon, 28 Aug 2023 19:59:34 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org A0ECC3858C2C Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=adacore.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=adacore.com Received: by mail-io1-xd31.google.com with SMTP id ca18e2360f4ac-7927952ca67so106296539f.2 for ; Mon, 28 Aug 2023 12:59:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adacore.com; s=google; t=1693252774; x=1693857574; h=to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=0/n8x8ZLOC/C27sq48acvQD2StpytyRUNgyNKbqDAT0=; b=X/MJXk5iEvyd85WZy5ll6t1Y1Tzm+MX1LQcjiDAY2/CEV4HxNgbyr88YsV6HPa79p0 4k6DZnLXnHYYsWABJqCEnus6yqykyBs84dSzDmxI7vJO0Q+uBN69R94jOysNSrPGziel ne84+NWkV6WSCkUq17DUAdnII40V4UTCZ8ZupefJldEIe4Y8exX0oYw+VX6H4hD1Mzqs 1ermog2OEY7p5VUxlz8U42Tt8il59l7aCkhDRzUZBRw0PnGtAbOOu2LJLWiJeWy1dAW1 uKsdhykIhSAUC4mVFPL3GNRvRxojtoRGWg4BaN2YwseVdTvK80R2Zo63yRNhOI15lnbs /xog== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1693252774; x=1693857574; h=to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=0/n8x8ZLOC/C27sq48acvQD2StpytyRUNgyNKbqDAT0=; b=YNrcVnqjMOsqZaYm73yDMaZQnqO4WvKnphCavjWpUuL3/p+q6+L/jleRys6xclGFn3 jDH+eDghz6svaA/Hmod5pPL4vsVZcbHdKWVCQZ2fdNBHgbzJgzFSAdxDOfVybtOorkyu pk0L8DMSRcy1GTZcpZea18ci2HU/Fu9GqS5JBNa1Ky/0AAgxOSxCBGBFUG0bSEpW0UrQ kSz7F0N6VtKujXfJNygfTYkykA0h2FoSFkLZjRhNhPN3U/kyOqokTumu/19fDbtWnSS/ GJvBd+PIVaoO6/Vg9nihof5bJQY+MXPXr3kTzSWTzsYSmG2uavK3hLu8Lch5AVHaEaQ9 +d5g== X-Gm-Message-State: AOJu0YyPdEH3ABfAx2aZO0INnnX1z6/Nlu8vKfJsNVBw4wklI1/Cn0uT 4YCtvEHRMH0tFLvArfCDbGsQIa8QQUIo4fyEyf857w== X-Google-Smtp-Source: AGHT+IHnULROKfvUGRjVLSw10gAtxBaKfZMwixLgo+XhTZ2s/sV43Sjw1hrQX5Ue/Uf69B6OlwpvSQ== X-Received: by 2002:a05:6602:19d9:b0:790:a010:4c42 with SMTP id ba25-20020a05660219d900b00790a0104c42mr19753554iob.13.1693252773918; Mon, 28 Aug 2023 12:59:33 -0700 (PDT) Received: from localhost.localdomain (75-166-150-212.hlrn.qwest.net. [75.166.150.212]) by smtp.gmail.com with ESMTPSA id z24-20020a056602205800b00777b7fdbbffsm2769063iod.8.2023.08.28.12.59.33 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 28 Aug 2023 12:59:33 -0700 (PDT) From: Tom Tromey Date: Mon, 28 Aug 2023 13:59:34 -0600 Subject: [PATCH 4/5] Remove redundant variable from array_operation::evaluate MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20230828-cleanup-array-op-v1-4-12ca00f20917@adacore.com> References: <20230828-cleanup-array-op-v1-0-12ca00f20917@adacore.com> In-Reply-To: <20230828-cleanup-array-op-v1-0-12ca00f20917@adacore.com> To: gdb-patches@sourceware.org X-Mailer: b4 0.12.3 X-Spam-Status: No, score=-11.5 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,RCVD_IN_DNSWL_NONE,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: In array_operation::evaluate, 'idx' and 'tem' are redundant in one branch. This patch merges them, using the clearer name. --- gdb/eval.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/gdb/eval.c b/gdb/eval.c index 6cf72545f62..710506ef778 100644 --- a/gdb/eval.c +++ b/gdb/eval.c @@ -2464,14 +2464,13 @@ array_operation::evaluate (struct type *expect_type, if (!get_discrete_bounds (element_type, &low_bound, &high_bound)) error (_("(power)set type with unknown size")); memset (valaddr, '\0', type->length ()); - int idx = 0; - for (int tem = 0; tem < nargs; tem++) + for (int idx = 0; idx < nargs; idx++) { LONGEST range_low, range_high; struct type *range_low_type, *range_high_type; struct value *elem_val; - elem_val = in_args[idx++]->evaluate (element_type, exp, noside); + elem_val = in_args[idx]->evaluate (element_type, exp, noside); range_low_type = range_high_type = elem_val->type (); range_low = range_high = value_as_long (elem_val); -- 2.40.1