From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-qt1-x835.google.com (mail-qt1-x835.google.com [IPv6:2607:f8b0:4864:20::835]) by sourceware.org (Postfix) with ESMTPS id 5745A385AC37 for ; Tue, 5 Oct 2021 14:56:48 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 5745A385AC37 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-qt1-x835.google.com with SMTP id t2so2331159qtx.8 for ; Tue, 05 Oct 2021 07:56:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=rUpIX1AZOONnCGK3xp1/ISRz5HgYi0zuFEr3BFg7D3g=; b=cX3QfVGq9rYRBVt8SmDux7gMwCs6YUI8EwCvjysuDP+QlRvLrHwXFHmOgfPnhT/ngy wlH8we7rAD51VHbLRxWSJuKGgbrhJf/HdDrrsbNmBqehoG+elBhZRzfX8G4gKU/G+FJ8 GauVfIpYJ4ZDGo7AOO6jHqivaaDEHh6KPhFa9lsCcV9O4NWjB3IjFaltHwQgPEeLvh8+ 2A4QK/H7Fv2uuvZQ0Pnh6rAujLQrD2KQEW7cnnpfPyI/8Mj1Qm/soUfXwa6oCv5iLz50 oXp8qFRArg4c/nyUwpahvCEnPLhUzembws3bVoc9Z7tv0d9q3h8ZlbWyI8nRzrehwU2Z uEQw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=rUpIX1AZOONnCGK3xp1/ISRz5HgYi0zuFEr3BFg7D3g=; b=0qNo/wPKI4XkNv//Bi/bt9G6rbI9atiIPRsXIymbzVpP6K6/ExK1m4l4UZLnVhVJLu SigIb1Soa71TZo7s0Byn0URNY8ippxJjOvlKrhKerHxEvKx7vw8/qjxCLGtWEbuOsDx1 M3DDJ7DZTli/UlpU1MiB9RX+9AzFlwhMpemL31i/UCYjOCg+USsWR7Qx12zWtAgonFEQ CoEixO3QLb8y/+TYoLQshUSq3M37SKHk/4uzVgtM+laXmTtiDpAgHiHISY+8yMwvNrVI i4FzqLRkOoxRHB++xCZDWkKtvTZYKZb2O34T5o5fYeS6zPb003iBtywxV6w4d+ERBGWZ 8MbA== X-Gm-Message-State: AOAM532Oxzl/sYDDS71kVpJ3zRVY7N2EMAXaA39JQpuQAXtF5K7HeI2J 76Ef3lhMmDFnRfNZdf9KQpU4OZCWzPFWrxOijzRsZ0AwWg== X-Google-Smtp-Source: ABdhPJxR8X2vgGFtK2/qSwhyICymVeQdMY+k2Z2r2d6i3wlmvVj8DsgvRwstnnzGdaE99Z6EBhJV6C2uvGz/ykQe5ho= X-Received: by 2002:ac8:4583:: with SMTP id l3mr20255453qtn.188.1633445807833; Tue, 05 Oct 2021 07:56:47 -0700 (PDT) MIME-Version: 1.0 References: <20211005141625.31585-1-sebastian.huber@embedded-brains.de> <20211005141625.31585-4-sebastian.huber@embedded-brains.de> In-Reply-To: From: C Howland Date: Tue, 5 Oct 2021 10:56:37 -0400 Message-ID: Subject: Re: Fw: [PATCH 3/4] sys/tree.h: Add parent rotations To: newlib@sourceware.org X-Spam-Status: No, score=-8.1 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, HTML_MESSAGE, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: newlib@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Newlib mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Oct 2021 14:56:49 -0000 > > > > ------------------------------ > *From:* Newlib on > behalf of Sebastian Huber > *Sent:* Tuesday, October 5, 2021 10:16 AM > *To:* newlib@sourceware.org > *Cc:* devel@rtems.org > *Subject:* [PATCH 3/4] sys/tree.h: Add parent rotations > > > > Add specialized rotations RB_PARENT_ROTATE_LEFT() and > RB_PARENT_ROTATE_RIGHT() > which may be used if the parent node exists and the direction of the child > is > known. The specialized rotations are derived from RB_ROTATE_LEFT() and > RB_ROTATE_RIGHT() where the RB_SWAP_CHILD() was replaced by a simple > assignment. > It would seem appropriate for both this patch and #4 to include your descriptions from the emails about the specialized nature of these new macros in the source. (Otherwise, how can the conditions on their use be known?) Craig --- > newlib/libc/include/sys/tree.h | 36 ++++++++++++++++++++++++++++++---- > 1 file changed, 32 insertions(+), 4 deletions(-) > > diff --git a/newlib/libc/include/sys/tree.h > b/newlib/libc/include/sys/tree.h > index 180809e9b..5fc052817 100644 > --- a/newlib/libc/include/sys/tree.h > +++ b/newlib/libc/include/sys/tree.h > @@ -381,6 +381,30 @@ struct > { \ > RB_AUGMENT(elm); \ > } while (/*CONSTCOND*/ 0) > > +#define RB_PARENT_ROTATE_LEFT(parent, left, tmp, field) do { \ > ... > 2.26.2 > >