From patchwork Mon Jan 27 22:32:06 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Burgess X-Patchwork-Id: 1230056 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-518348-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=embecosm.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.a=rsa-sha1 header.s=default header.b=I/I4ASpI; dkim=pass (2048-bit key; unprotected) header.d=embecosm.com header.i=@embecosm.com header.a=rsa-sha256 header.s=google header.b=E3S4AtSC; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4864Hs1TfYz9s1x for ; Tue, 28 Jan 2020 09:32:23 +1100 (AEDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:cc:subject:date:message-id; q=dns; s=default; b=dqfxy6WlkR5Z tjEd9gU0mLjWQEPhqw57QI6ugwjXXnyCuoMVbxHU30oywUNKk6TzqpbDLUOwruRm ZBX7vwu97Yym/J5CvyjRlUVWjGCn0Gkolf/7BhMYZWYp8b9/POzyKAbaw1+qiq94 jP2ih+Er3e5qGbcXD1xtReWZgA+wEFY= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:cc:subject:date:message-id; s=default; bh=G809q25T11YzpYXLfr 5iOYV603Y=; b=I/I4ASpIkn9ynQqfwUgHfZpKwrHXCIm697PwAl0bovjSNdpzOQ JYkIu/oa6gyBsRLJUK6T1aclZeNKuNXmoWLAka9YpdfcYTcJPEB0COKaK+2jb0kw 5av0O82czKIazSXUUcyO+tDuVMzi0PltaWWOI3sDWN/+N7y9Ks++GYp+8= Received: (qmail 7221 invoked by alias); 27 Jan 2020 22:32:15 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 7209 invoked by uid 89); 27 Jan 2020 22:32:15 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-21.7 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.1 spammy= X-HELO: mail-wr1-f65.google.com Received: from mail-wr1-f65.google.com (HELO mail-wr1-f65.google.com) (209.85.221.65) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 27 Jan 2020 22:32:14 +0000 Received: by mail-wr1-f65.google.com with SMTP id t2so13662750wrr.1 for ; Mon, 27 Jan 2020 14:32:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=embecosm.com; s=google; h=from:to:cc:subject:date:message-id; bh=rTZCKGYuHdXCzww3pIVZrTJILU4DZV2WAViYOokldYo=; b=E3S4AtSCULFkdLOBHDwtm3/coJHgfj6VwThZkqB9sqVKTYjAOIcf8zsceR5CR7R7qF wptzg6dv8Dj2BNtp7LRlvGZRdhbuU9EzFP4oLyVgVCdTfsnPNZFOWOw8FpcyyTsmsUq1 vn3tB+7x82dkteH4ynCz0GcQ2IAS8b8h47gDyF5ELhM2kUse5ZkXG5ERbjmHZO002wAb ThuRT1QVZO4KC4xwVkcLwYOHRBZnBIx9dr1xH+csiP7VP1TH7a83cClrODglNSCkgNVw FTQfWQut/pKpW8yWrbwE7OyRUuLXhd4AXCtY61/DhwcU5A1W0GT0fP1W1aAolP3DBvlf EEzQ== Received: from localhost (host86-191-239-73.range86-191.btcentralplus.com. [86.191.239.73]) by smtp.gmail.com with ESMTPSA id w7sm330394wmi.9.2020.01.27.14.32.09 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 27 Jan 2020 14:32:09 -0800 (PST) From: Andrew Burgess To: gcc-patches@gcc.gnu.org Cc: Andrew Burgess Subject: [PATCH] libiberty/hashtab: More const parameters Date: Mon, 27 Jan 2020 22:32:06 +0000 Message-Id: <20200127223206.12393-1-andrew.burgess@embecosm.com> X-IsSubscribed: yes I know that the tree's currently closed to non-bugfix changes, but I was hoping this might be accpeted anyway so it can be backported to binutils-gdb. --- Makes some parameters const in libiberty's hashtab library. include/ChangeLog: * hashtab.h (htab_remove_elt): Make a parameter const. (htab_remove_elt_with_hash): Likewise. libiberty/ChangeLog: * hashtab.c (htab_remove_elt): Make a parameter const. (htab_remove_elt_with_hash): Likewise. --- include/ChangeLog | 5 +++++ include/hashtab.h | 4 ++-- libiberty/ChangeLog | 5 +++++ libiberty/hashtab.c | 4 ++-- 4 files changed, 14 insertions(+), 4 deletions(-) diff --git a/include/hashtab.h b/include/hashtab.h index d94b54c3c41..6cca342b989 100644 --- a/include/hashtab.h +++ b/include/hashtab.h @@ -173,8 +173,8 @@ extern void * htab_find_with_hash (htab_t, const void *, hashval_t); extern void ** htab_find_slot_with_hash (htab_t, const void *, hashval_t, enum insert_option); extern void htab_clear_slot (htab_t, void **); -extern void htab_remove_elt (htab_t, void *); -extern void htab_remove_elt_with_hash (htab_t, void *, hashval_t); +extern void htab_remove_elt (htab_t, const void *); +extern void htab_remove_elt_with_hash (htab_t, const void *, hashval_t); extern void htab_traverse (htab_t, htab_trav, void *); extern void htab_traverse_noresize (htab_t, htab_trav, void *); diff --git a/libiberty/hashtab.c b/libiberty/hashtab.c index 26c98ce2d68..225e9e540a7 100644 --- a/libiberty/hashtab.c +++ b/libiberty/hashtab.c @@ -709,7 +709,7 @@ htab_find_slot (htab_t htab, const PTR element, enum insert_option insert) element in the hash table, this function does nothing. */ void -htab_remove_elt (htab_t htab, PTR element) +htab_remove_elt (htab_t htab, const PTR element) { htab_remove_elt_with_hash (htab, element, (*htab->hash_f) (element)); } @@ -720,7 +720,7 @@ htab_remove_elt (htab_t htab, PTR element) function does nothing. */ void -htab_remove_elt_with_hash (htab_t htab, PTR element, hashval_t hash) +htab_remove_elt_with_hash (htab_t htab, const PTR element, hashval_t hash) { PTR *slot;