From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id wGITFTaCTWLSMAAAWB0awg (envelope-from ) for ; Wed, 06 Apr 2022 08:06:14 -0400 Received: by simark.ca (Postfix, from userid 112) id 51D6E1F344; Wed, 6 Apr 2022 08:06:14 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-3.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id AF5341E787 for ; Wed, 6 Apr 2022 08:06:13 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 280403858025 for ; Wed, 6 Apr 2022 12:06:13 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 280403858025 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1649246773; bh=3jlrM3DXUJQgcM2BOYPHZ4BzusCfRzB1BfMWC+oQSNg=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=vQASiky8LYBwf2sQDfiqdC5MFRK9MlHAaJkDy4J2tzCinFadUGAqYzy2gf8DGVy4h W7EBkZRDxDxxQsEylllXoJ+y1GNyD3MCAkpToE//UUKDguxcXlxLcNZPQmNAbrxip0 EQk6UwJ988Frd3GHF2RpYPP8MQ7hVZ+eUSpMivyM= Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTPS id 21A023858C27 for ; Wed, 6 Apr 2022 12:04:59 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 21A023858C27 Received: from mail-wr1-f69.google.com (mail-wr1-f69.google.com [209.85.221.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-134-xbuIdLiyP5Op56xmODJNdQ-1; Wed, 06 Apr 2022 08:04:57 -0400 X-MC-Unique: xbuIdLiyP5Op56xmODJNdQ-1 Received: by mail-wr1-f69.google.com with SMTP id q15-20020adfab0f000000b002060c75e65aso427627wrc.5 for ; Wed, 06 Apr 2022 05:04:57 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=3jlrM3DXUJQgcM2BOYPHZ4BzusCfRzB1BfMWC+oQSNg=; b=yXv+ZJhndA+U1fVFpjM9/O8reJ99L9qLitnX28Pt6B2xbwzrZx5xlGwtr/CoSBM7yZ Id21K0oQeS2OK7s0Q1t7BSRcVO0ITQKiH14e47VDqrH7h1duTPjLWkvXcB6PfmPGksh8 zMue+DU64i05IaCn5jufSey6fOjdaAZtgya1iwVVINvbNWzwjoHuti84BSXkMMRrlLku toCaUA7HGQ+z1oQh2UPIQ9M9tDusYd06ZqPLS6e692NAy4ZAcLgEkn8tn46Yqj7oPhtt maCHFCWohpvtehfmtnRXUDqYexqxdz3a5g55Kprte2nYvOEh+liXacLj8Yt+/iwAyF1W IO3Q== X-Gm-Message-State: AOAM532Cd3BwcgvvWfV8vdGPstVQXCMZ7afVS21sjzkDPlMIDkGXbgxQ ZLwdAVd+Nu1AwNOUASg7z/AMpHznXuORgVjUKIGJdfTYmPEHRnwd0TVGDXfJprHLIl7MgYSuc9G OiZC3PqMOkU27Wd6VZ+psjo9FSn55OzSWzv9YIU6yZcWYOJmArfCw4DFJ7DqJee5X+tk5MzZZ1g == X-Received: by 2002:a05:600c:20d3:b0:38e:7c77:58c1 with SMTP id y19-20020a05600c20d300b0038e7c7758c1mr7207320wmm.135.1649246696413; Wed, 06 Apr 2022 05:04:56 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzxc3BR979Y0MMrnuh9FKUyLxmSGJugY6EKYzdcQn4xwAZpMaSo4ZaeJHFBVHN5bIU6Vu19uQ== X-Received: by 2002:a05:600c:20d3:b0:38e:7c77:58c1 with SMTP id y19-20020a05600c20d300b0038e7c7758c1mr7207292wmm.135.1649246696078; Wed, 06 Apr 2022 05:04:56 -0700 (PDT) Received: from localhost (host86-169-131-113.range86-169.btcentralplus.com. [86.169.131.113]) by smtp.gmail.com with ESMTPSA id j31-20020a05600c1c1f00b0038e72206b3dsm5136973wms.30.2022.04.06.05.04.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Apr 2022 05:04:55 -0700 (PDT) To: gdb-patches@sourceware.org Subject: [PATCHv2 02/16] gdb: add some const in gdb/reggroups.c Date: Wed, 6 Apr 2022 13:04:35 +0100 Message-Id: X-Mailer: git-send-email 2.25.4 In-Reply-To: References: MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII"; x-default=true X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Andrew Burgess via Gdb-patches Reply-To: Andrew Burgess Cc: Andrew Burgess Errors-To: gdb-patches-bounces+public-inbox=simark.ca@sourceware.org Sender: "Gdb-patches" This commit makes the 'struct reggroup *' argument const for the following functions: reggroup_next reggroup_prev reggroup_name reggroup_type There are other places that could benefit from const in the reggroup.{c,h} files, but these will be changing in further commits. There should be no user visible changes after this commit. --- gdb/reggroups.c | 8 ++++---- gdb/reggroups.h | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/gdb/reggroups.c b/gdb/reggroups.c index b6afa2f895c..169285b7475 100644 --- a/gdb/reggroups.c +++ b/gdb/reggroups.c @@ -63,13 +63,13 @@ reggroup_gdbarch_new (struct gdbarch *gdbarch, const char *name, /* Register group attributes. */ const char * -reggroup_name (struct reggroup *group) +reggroup_name (const struct reggroup *group) { return group->name; } enum reggroup_type -reggroup_type (struct reggroup *group) +reggroup_type (const struct reggroup *group) { return group->type; } @@ -130,7 +130,7 @@ static struct reggroups default_groups = { NULL, &default_groups.first }; /* A register group iterator. */ struct reggroup * -reggroup_next (struct gdbarch *gdbarch, struct reggroup *last) +reggroup_next (struct gdbarch *gdbarch, const struct reggroup *last) { struct reggroups *groups; struct reggroup_el *el; @@ -161,7 +161,7 @@ reggroup_next (struct gdbarch *gdbarch, struct reggroup *last) /* See reggroups.h. */ struct reggroup * -reggroup_prev (struct gdbarch *gdbarch, struct reggroup *curr) +reggroup_prev (struct gdbarch *gdbarch, const struct reggroup *curr) { struct reggroups *groups; struct reggroup_el *el; diff --git a/gdb/reggroups.h b/gdb/reggroups.h index f2e60c4f1da..ef99483f39f 100644 --- a/gdb/reggroups.h +++ b/gdb/reggroups.h @@ -50,17 +50,17 @@ extern struct reggroup *reggroup_gdbarch_new (struct gdbarch *gdbarch, extern void reggroup_add (struct gdbarch *gdbarch, struct reggroup *group); /* Register group attributes. */ -extern const char *reggroup_name (struct reggroup *reggroup); -extern enum reggroup_type reggroup_type (struct reggroup *reggroup); +extern const char *reggroup_name (const struct reggroup *reggroup); +extern enum reggroup_type reggroup_type (const struct reggroup *reggroup); /* Iterators for the architecture's register groups. Pass in NULL, returns the first (for next), or last (for prev) group. Pass in a group, returns the next or previous group, or NULL when either the end or the beginning of the group list is reached. */ extern struct reggroup *reggroup_next (struct gdbarch *gdbarch, - struct reggroup *last); + const struct reggroup *last); extern struct reggroup *reggroup_prev (struct gdbarch *gdbarch, - struct reggroup *curr); + const struct reggroup *curr); /* Find a reggroup by name. */ extern reggroup *reggroup_find (struct gdbarch *gdbarch, const char *name); -- 2.25.4