From patchwork Tue Jan 19 21:12:27 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alejandro Colomar X-Patchwork-Id: 1428868 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=V++JTDgm; 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 4DL1br26RGz9sSs for ; Wed, 20 Jan 2021 08:13:44 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 9F8763971C17; Tue, 19 Jan 2021 21:13:41 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 9F8763971C17 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1611090821; bh=BY7xwSN4ssWgzzC6vjtSs+vZHHzAm1h9eoQpuOa40Ys=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:Cc:From; b=V++JTDgmXJ1Fn1QCY148QpbhfmtDUCP89ymxHjPPgE5vBwFoDxB5uwaKijRdSRsNc qgs0HOjeu0L/UJeDfu/BIienQ7J+HSElP0guOO/7K3TISDw0qF54SyWfyjdCv2yIg8 vt08Bqa85I8oUzA00Q77Rty0S2NoK1wPlYwKz2Bc= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-wr1-x430.google.com (mail-wr1-x430.google.com [IPv6:2a00:1450:4864:20::430]) by sourceware.org (Postfix) with ESMTPS id EFBEC3950CB9 for ; Tue, 19 Jan 2021 21:13:38 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org EFBEC3950CB9 Received: by mail-wr1-x430.google.com with SMTP id c12so2573209wrc.7 for ; Tue, 19 Jan 2021 13:13:38 -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:mime-version :content-transfer-encoding; bh=BY7xwSN4ssWgzzC6vjtSs+vZHHzAm1h9eoQpuOa40Ys=; b=h4YDUbx/ZCy1HIHamu4tawDFMSmg5lEoTHPl2ZJ4AqaKsWXWDqFOlCAjGap9HdLTKf TkzYVFMroszQ7rw7Qc4RqWVG5H3koNtODtK5a7DRZB06wE3YnSZ2d9OZdnK6Usx6E5r3 HHY0OciQD0b3L9uExdUEvHyEbNuVA3rgkdz3DX68X4gOoGlcCxk7DkdKhQR40oqpN1sE rs7HOX8FqvdnRipF1XKsLb556xWPTR6o/IgsBaOFp1EvaUX4G1+VD2w3+OBsp9Xdtijg dOEsMf71KHdt6XSLCUTLX3iI8IbZocCRYjlM1bHcH7D0Z12h7vrBMYm9Pw+6Nf4PadsQ qZWw== X-Gm-Message-State: AOAM532G/QWpXFotOUWljSYNwnfoADVIJBnfOf9wYC+aVXcGlPio9eoX wBvrrPJ1D51KwouA/8zaKVU= X-Google-Smtp-Source: ABdhPJxSXzFMl3q5Y8vijhS/NFFv5wGXn5vfGZbMmFSly/0H0S0EaWSGvkADQ1QvAUP/gRYtbRGUFA== X-Received: by 2002:a5d:6282:: with SMTP id k2mr5413974wru.159.1611090818169; Tue, 19 Jan 2021 13:13:38 -0800 (PST) Received: from localhost.localdomain ([170.253.49.0]) by smtp.googlemail.com with ESMTPSA id x11sm24160wmi.4.2021.01.19.13.13.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Jan 2021 13:13:37 -0800 (PST) To: mtk.manpages@gmail.com Subject: [PATCH] circleq.3: Fix CIRCLEQ_LOOP_*() return type Date: Tue, 19 Jan 2021 22:12:27 +0100 Message-Id: <20210119211226.440430-1-alx.manpages@gmail.com> X-Mailer: git-send-email 2.30.0 MIME-Version: 1.0 X-Spam-Status: No, score=-11.2 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" Signed-off-by: Alejandro Colomar --- man3/circleq.3 | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/man3/circleq.3 b/man3/circleq.3 index 6b6b9aa14..f21bbf903 100644 --- a/man3/circleq.3 +++ b/man3/circleq.3 @@ -75,9 +75,9 @@ CIRCLEQ_REMOVE .BI "struct TYPE *CIRCLEQ_LAST(CIRCLEQ_HEAD *" head ); .BI "struct TYPE *CIRCLEQ_PREV(struct TYPE *" elm ", CIRCLEQ_ENTRY " NAME ); .BI "struct TYPE *CIRCLEQ_NEXT(struct TYPE *" elm ", CIRCLEQ_ENTRY " NAME ); -.BI "void CIRCLEQ_LOOP_PREV(CIRCLEQ_HEAD *" head , +.BI "struct TYPE *CIRCLEQ_LOOP_PREV(CIRCLEQ_HEAD *" head , .BI " struct TYPE *" elm ", CIRCLEQ_ENTRY " NAME ); -.BI "void CIRCLEQ_LOOP_NEXT(CIRCLEQ_HEAD *" head , +.BI "struct TYPE *CIRCLEQ_LOOP_NEXT(CIRCLEQ_HEAD *" head , .BI " struct TYPE *" elm ", CIRCLEQ_ENTRY " NAME ); .PP .BI "CIRCLEQ_FOREACH(struct TYPE *" var ", CIRCLEQ_HEAD *" head , @@ -238,13 +238,23 @@ and zero if the queue contains at least one entry. .PP .BR CIRCLEQ_FIRST (), .BR CIRCLEQ_LAST (), -.BR CIRCLEQ_PREV (), +.BR CIRCLEQ_LOOP_PREV (), and -.BR CIRCLEQ_NEXT () +.BR CIRCLEQ_LOOP_NEXT () return a pointer to the first, last, previous, or next .I TYPE structure, respectively. .PP +.BR CIRCLEQ_PREV (), +and +.BR CIRCLEQ_NEXT () +are similar to their +.BR CIRCLEQ_LOOP_* () +counterparts, +except that if the argument is the first or last element, respectively, +they return +.IR &head . +.PP .BR CIRCLEQ_HEAD_INITIALIZER () returns an initializer that can be assigned to the queue .IR head .