From patchwork Thu Mar 11 22:33:15 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alejandro Colomar X-Patchwork-Id: 1451564 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=sourceware.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=sourceware.org; envelope-from=libc-alpha-bounces@sourceware.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.a=rsa-sha256 header.s=default header.b=HmqUbL93; dkim-atps=neutral Received: from sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4DxNyv2D2Qz9sSC for ; Fri, 12 Mar 2021 09:33:59 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 38EF23953074; Thu, 11 Mar 2021 22:33:49 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 38EF23953074 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1615502029; bh=jdRQlz8+r30MTEGQfc5lYycYeDSOcfabeFJAMaZKm9w=; 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=HmqUbL93Ud8EhzD2FkAYbzHoDkeWurtagNKNeCBDIwFkZsvVGPy1Y0IYQz0bKheRV yKnYfy712/Fe2Ym/NC1d8F5YVqOfJxMyOWVkH0Buy/Ilcen+IoqdxB3D/17wCi5wFF o05Vcy/3zsY7XizM2+fkXd8CuJhz/uAIOEBif+Xo= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-wm1-x330.google.com (mail-wm1-x330.google.com [IPv6:2a00:1450:4864:20::330]) by sourceware.org (Postfix) with ESMTPS id 890033951C4F for ; Thu, 11 Mar 2021 22:33:44 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 890033951C4F Received: by mail-wm1-x330.google.com with SMTP id b2-20020a7bc2420000b029010be1081172so14058428wmj.1 for ; Thu, 11 Mar 2021 14:33:44 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=jdRQlz8+r30MTEGQfc5lYycYeDSOcfabeFJAMaZKm9w=; b=UwkIlIrTzyZqpKBCw/Q+5jaY6tp/aO+baWoXg0u+Z7syPjQEym5DdZEv4Vv25pZv8/ ILUt5QjzRhEbOxn77NSiMe3rlVqM9x/7xwqdHESlX+fQaqtC0RvuiqsTtJJFHCPkLUf0 R8jehM5n7vpHN8XGXMuTB99myvtiwdKPxWiJLHdbz+UMMYU0fezG8TMubE6QCtma25X9 U98C4YT/M6vpGtDnksEvG6pzBjmhY22gbNhgBYyIXgQAmtzWTbMEQyaS4SpzjXyq9E5f c6+y8lifDi8AhgekYiRBYnn/8M3soRVxHXo5/LipIeYMBAR1SELn3jIvHSpci3Gq89Tn hoLQ== X-Gm-Message-State: AOAM5335PZ60KxbI7GN3JN9VyjChWpZK5TXcglNmOjqGeaPu3g9KGyot LGoHoVr7wg2MJnau562WLhI= X-Google-Smtp-Source: ABdhPJyHky8LAHU7G1KqgAyn7vVB6R4WVuGcimDUltj325bCWQ2oifx9mUJyZ5kdkiqNkJzQ/RyZWg== X-Received: by 2002:a7b:c931:: with SMTP id h17mr10386220wml.4.1615502023757; Thu, 11 Mar 2021 14:33:43 -0800 (PST) Received: from localhost.localdomain ([170.253.36.171]) by smtp.googlemail.com with ESMTPSA id v2sm22365771wmj.1.2021.03.11.14.33.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 11 Mar 2021 14:33:43 -0800 (PST) To: mtk.manpages@gmail.com Subject: [PATCH 02/17] tsearch.3: SYNOPSIS: Use 'restrict' in prototypes Date: Thu, 11 Mar 2021 23:33:15 +0100 Message-Id: <20210311223330.722437-3-alx.manpages@gmail.com> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210311223330.722437-1-alx.manpages@gmail.com> References: <20210311223330.722437-1-alx.manpages@gmail.com> MIME-Version: 1.0 X-Spam-Status: No, score=-11.7 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Alejandro Colomar via Libc-alpha From: Alejandro Colomar Reply-To: Alejandro Colomar Cc: Alejandro Colomar , linux-man@vger.kernel.org, libc-alpha@sourceware.org Errors-To: libc-alpha-bounces@sourceware.org Sender: "Libc-alpha" Both POSIX and glibc use 'restrict' in tdelete(). Let's use it here too. .../glibc$ grep_glibc_prototype tdelete misc/search.h:138: extern void *tdelete (const void *__restrict __key, void **__restrict __rootp, __compar_fn_t __compar); .../glibc$ Signed-off-by: Alejandro Colomar --- man3/tsearch.3 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/man3/tsearch.3 b/man3/tsearch.3 index 1c771ef4a..ab4a2b767 100644 --- a/man3/tsearch.3 +++ b/man3/tsearch.3 @@ -35,11 +35,11 @@ tsearch, tfind, tdelete, twalk, tdestroy \- manage a binary search tree .BI " int (*" compar ")(const void *, const void *));" .BI "void *tfind(const void *" key ", void *const *" rootp , .BI " int (*" compar ")(const void *, const void *));" -.BI "void *tdelete(const void *" key ", void **" rootp , +.BI "void *tdelete(const void *restrict " key ", void **restrict " rootp , .BI " int (*" compar ")(const void *, const void *));" .BI "void twalk(const void *" root , .BI " void (*" action ")(const void *" nodep ", VISIT " which , -.BI " int " depth "));" +.BI " int " depth )); .PP .BR "#define _GNU_SOURCE" " /* See feature_test_macros(7) */" .B #include