From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id cW6ZLSfdQ2oThB8AWB0awg (envelope-from ) for ; Tue, 30 Jun 2026 11:13:43 -0400 Authentication-Results: simark.ca; dkim=pass (2048-bit key; secure) header.d=adacore.com header.i=@adacore.com header.a=rsa-sha256 header.s=google header.b=dH7SIE6Z; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id B6F6B1E098; Tue, 30 Jun 2026 11:13:43 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-5.4 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham autolearn_force=no version=4.0.1 Received: from vm01.sourceware.org (vm01.sourceware.org [38.145.34.32]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id D4C351E024 for ; Tue, 30 Jun 2026 11:13:42 -0400 (EDT) Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 7A6B64BA23DB for ; Tue, 30 Jun 2026 15:13:42 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 7A6B64BA23DB Authentication-Results: sourceware.org; dkim=pass (2048-bit key, secure) header.d=adacore.com header.i=@adacore.com header.a=rsa-sha256 header.s=google header.b=dH7SIE6Z Received: from mail-oo1-xc30.google.com (mail-oo1-xc30.google.com [IPv6:2607:f8b0:4864:20::c30]) by sourceware.org (Postfix) with ESMTPS id 32F764BA2E28 for ; Tue, 30 Jun 2026 15:13:19 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 32F764BA2E28 Authentication-Results: sourceware.org; dmarc=pass (p=quarantine dis=none) header.from=adacore.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=adacore.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 32F764BA2E28 Authentication-Results: sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::c30 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1782832399; cv=none; b=JVwvmxDnTkLyne8JnbKJv7Jubd7yH0ZB5ldB9PnDdBcZVcLrsecC50D2/jx3/7MpTGdHFBZJSme9nThFWcbpBWJm27hthukzl8ELo9qV3/vizlIPIsz9FHq0ztdyOLwgFd7CuWiJuqseyrXMugVErPRI7u29a5oK+3IYE1zjaNM= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1782832399; c=relaxed/simple; bh=oKbLn9Ki0iFHu/eVyjlAxasKx5F6VNVVC6X7XMl72SI=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=pxAemq2UIyeK9ifmyEb9LPQ7LqwAj09X332JNmna3pEJAY6ZjvGOjLqWK1+IePAq6dFzMXw0uqM+64COtXQX0NeTMldoo2mJI0A+dZ9CbwoBs3Lek4ChRNfdHLvB856xrhn6UI4Kd89WCkZHaRtBDW5brbMWWqALw+Hev0+Octs= ARC-Authentication-Results: i=1; sourceware.org; dkim=pass (2048-bit key, secure) header.d=adacore.com header.i=@adacore.com header.a=rsa-sha256 header.s=google header.b=dH7SIE6Z DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 32F764BA2E28 Received: by mail-oo1-xc30.google.com with SMTP id 006d021491bc7-6a192afad7dso352844eaf.2 for ; Tue, 30 Jun 2026 08:13:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adacore.com; s=google; t=1782832398; x=1783437198; darn=sourceware.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to:content-type; bh=MZJcGrjGFNa/re8pZwVu1RwsBI1u2fMX39GKh+8Q4nY=; b=dH7SIE6Zud1AYHvirD0cV8fKBaiekbIs/GjNxj8wE8h1wc+Z3MEtqUUV3BK+b8Dmxp T0/586D2M6cSwvBuJq1olVkroOaLt5NjI4ZkK8Jizoj1PLs1DqNCMqWRi9ysrJITCKig R9Qg68eivBvcH/FHQ29aCsHC2vqG6wT18U06TPbQ/OCD8EjHC5e4Cb3Q3yU2MFyuXHAR SZJ+rGWHahCtQhWCG2FtcGZEtoDtJaGPe2A69lNoCUD2b82K6JS0m9ZM1mk8/IOgrxZu x0bbb5tEWfdzBU5SxJbLX+YHGPq+SCHmHO9rjXDOV2M+/SLSUTZ45ccUwgqBPVnZdxiQ 9soA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1782832398; x=1783437198; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=MZJcGrjGFNa/re8pZwVu1RwsBI1u2fMX39GKh+8Q4nY=; b=UEBeG11nY08wSKncnZEcTYDUB2txXeGGT4KkaApq7cslQc16O1dF3BG0gYNYKcR42C rgtOJS+IgUZTOnm91ZnNzLKVZRB/IKFMRaE0FeL4yxWnqYYwkdixj+Auqc5m5GrXjduk gFskEpTX+Md7qkBUwfe0A6k+ohKSg70+CVZFwigIWRtClvuqFkCQmwevIR+VEESQVQIz yCkIndQ60WX4Z+PY4nCmIzAJ7mbI0e7tZwjLZInvdXzOee5JFiQfn3uLFwZthx58A2b5 wyP+ek/grcvCr88qM4zyt/5J1MgPKdWvtywULru9ho+56RIzHGjL1RPNTcF7i7jUD/YH FWvA== X-Gm-Message-State: AOJu0YwzMBYw6EI0vempvVeGjKtMIYLgH4eX0vOyaeTjPBjoc5/u4ffo ChoMeJFoiRgA2H+A2TBTjDpIFRg13P4VnuGcGpEiJ0pRPxfRHarFD8oUmqN6h3g0RKY6YF2HhgP vGPU= X-Gm-Gg: AfdE7cnd6tCrjQIzPWaizAeVx6vEVMhZKMrnjvkYjgG9HI6wzZ192yfIPZU9lDPId7y U3A5QYhtWQXOPeuxlyOW6lT5VuyBJiZDEqkl57UHgOdRA6CwvobcRAnP1Lv5UfYvkA9XLXhcIxi J30K2BFZ2gobfi0v0xtn1noExRQ6L/hwLe9NpCtDYIyJq1QwTuUoqbf/Culput7aVmEIQJ4FiHH WrXqwVCxZdKaZsv+V8H3xMpHysrRaePtLlzMX01b7iSjbnG7uBrIIxM5nYFqeec4GwiRUjfbVcS Qat4AQOnzOJoCPcDOGCsxvyHKOMNjEZzBMRGc6RY4XLayj3cqZvJK81ZqNPBLD1cEOPvwpn7IjC 3PMgcRP0Twiem1tpeXVB7CBbKf4348L75qRIctPdhcKGtnIhcor3ppGuNeBeh7+FR6eA3Yfq9ti 9YbD3xOlUcDAS+TuozH592zIYwmiu+mJ3B X-Received: by 2002:a05:6820:83d1:10b0:6a1:3e91:dca6 with SMTP id 006d021491bc7-6a18915380bmr2268040eaf.22.1782832398547; Tue, 30 Jun 2026 08:13:18 -0700 (PDT) Received: from bapiya (75-166-225-82.hlrn.qwest.net. [75.166.225.82]) by smtp.gmail.com with ESMTPSA id 006d021491bc7-6a189173c3bsm2244137eaf.1.2026.06.30.08.13.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Jun 2026 08:13:18 -0700 (PDT) From: Tom Tromey To: gdb-patches@sourceware.org Cc: Tom Tromey Subject: [PATCH] Use bool in ada_type_of_array Date: Tue, 30 Jun 2026 09:13:16 -0600 Message-ID: <20260630151316.882186-1-tromey@adacore.com> X-Mailer: git-send-email 2.54.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-patches-bounces~public-inbox=simark.ca@sourceware.org I found yet another spot in ada-lang.c where a bool is more appropriate than an int. --- gdb/ada-lang.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c index 35ebd924021..8c85eb9a5e0 100644 --- a/gdb/ada-lang.c +++ b/gdb/ada-lang.c @@ -2136,14 +2136,14 @@ ada_is_array_descriptor_type (struct type *type) /* If ARR has a record type in the form of a standard GNAT array descriptor, (fat pointer) returns the type of the array data described---specifically, - a pointer-to-array type. If BOUNDS is non-zero, the bounds data are filled + a pointer-to-array type. If BOUNDS is true, the bounds data are filled in from the descriptor; otherwise, they are left unspecified. If the ARR denotes a null array descriptor and BOUNDS is non-zero, returns NULL. The result is simply the type of ARR if ARR is not a descriptor. */ static struct type * -ada_type_of_array (struct value *arr, int bounds) +ada_type_of_array (struct value *arr, bool bounds) { if (ada_is_constrained_packed_array_type (arr->type ())) return decode_constrained_packed_array_type (arr->type ()); @@ -2231,7 +2231,7 @@ ada_coerce_to_simple_array_ptr (struct value *arr) { if (ada_is_array_descriptor_type (arr->type ())) { - struct type *arrType = ada_type_of_array (arr, 1); + struct type *arrType = ada_type_of_array (arr, true); if (arrType == NULL) return NULL; @@ -10268,7 +10268,7 @@ ada_ternop_slice_operation::evaluate (struct type *expect_type, if (noside == EVAL_AVOID_SIDE_EFFECTS && ada_is_array_descriptor_type (ada_check_typedef (array->type ()))) - return empty_array (ada_type_of_array (array, 0), low_bound, + return empty_array (ada_type_of_array (array, false), low_bound, high_bound); array = ada_coerce_to_simple_array_ptr (array); @@ -11047,7 +11047,7 @@ ada_unop_ind_operation::evaluate (struct type *expect_type, "dereference" a thick pointer here -- that will end up giving us an array with (1 .. 0) for bounds, which is less clear than (<>). */ - struct type *arrType = ada_type_of_array (arg1, 0); + struct type *arrType = ada_type_of_array (arg1, false); if (arrType == NULL) error (_("Attempt to dereference null array pointer.")); base-commit: 12743d8290311a090ba115978d72351a2b321ce0 -- 2.54.0