From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/8968 Path: news.gmane.org!not-for-mail From: Ed Schouten Newsgroups: gmane.linux.lib.musl.general Subject: Re: AVL tree: storing balances instead of heights Date: Mon, 7 Dec 2015 14:22:42 +0100 Message-ID: References: <20151207130344.GZ23362@port70.net> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Trace: ger.gmane.org 1449494598 14613 80.91.229.3 (7 Dec 2015 13:23:18 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 7 Dec 2015 13:23:18 +0000 (UTC) To: Ed Schouten , musl@lists.openwall.com Original-X-From: musl-return-8981-gllmg-musl=m.gmane.org@lists.openwall.com Mon Dec 07 14:23:14 2015 Return-path: Envelope-to: gllmg-musl@m.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by plane.gmane.org with smtp (Exim 4.69) (envelope-from ) id 1a5vl3-0004Zb-3c for gllmg-musl@m.gmane.org; Mon, 07 Dec 2015 14:23:13 +0100 Original-Received: (qmail 19625 invoked by uid 550); 7 Dec 2015 13:23:00 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Original-Received: (qmail 19509 invoked from network); 7 Dec 2015 13:22:54 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nuxi-nl.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=a/MvGAQSMHqGWIqSYIkTz2UckmYopwGCjswRjeXVSG4=; b=JfoL8rMN2e7sY3VGg+9V1DbS2yq25/jFv0NsSv062vkKMkAJ0ShY31Wyt8ipdqarVf sKVL/zY2biGAEUU8kB17VZ3uYwHtZkHGnm7efJXHJoBFLY8bfxtGWMHNY/jNa2eV7Hq9 EWkMzX5Q3TN5AziLpa2GDu7Xhxxog1c1alPed/TBh7prGBtMFltNs4DqVzUdd19opJ7n 5ikaz7CYNf4XwEqa+sPiZGmJProxnRdiZkC467SMfBoY/kLm2dcn+W+nu/JaJDTaD++8 TGn5cN7+4Z3+7Yi/+BY1HLunMlhje0dOB2esm9PlU/zkJNcKAzeC786nVIvleegrbuod 7z6w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:content-type; bh=a/MvGAQSMHqGWIqSYIkTz2UckmYopwGCjswRjeXVSG4=; b=YUftVuKNPiA8pqDlheh+39HMTNf2DL3CgayYuPRWOIBt5kXn4u0Wr2RFv+PLfiLjiC MXWK47wRSqZb9d4aX2PFrQr+FcaY+UkZG6bwin/z1c1M+XPqmDkOIoFghqbh352gP4eI RjzTjmC3q12A2IItR2Xme7+G10OudLUe92Fiu1NIeQTU8N7QBih3dBBBf9lsggzTS/XT QWFIbiTXghRLvZIr6hxTTsTUozvZg0hq4PneumrNXxJ9BlZd9f0jnrO4V0eT8Xp3uZcE nBfurcbr6jMhuKnGgGoEk25CgNoJ2VedRV4Ys0Fe5dtvdm5kqPpPX1xgs3mNvhxG9Pdq Oszw== X-Gm-Message-State: ALoCoQmqws5WCmAldXCF0kcQFhS4I0xJyEdGYHl2faJpHIAXQV81LZkj3pq+jqaPDd36Je0ZiB50 X-Received: by 10.129.96.84 with SMTP id u81mr21848772ywb.80.1449494562773; Mon, 07 Dec 2015 05:22:42 -0800 (PST) In-Reply-To: Xref: news.gmane.org gmane.linux.lib.musl.general:8968 Archived-At: 2015-12-07 14:19 GMT+01:00 Ed Schouten : >> you got the rootp==0 case wrong too (posix requires that to >> return 0). > > That already happens, right? tdelete() sets it to (void *)1, but > tdelete_recurse() then sets it to NULL immediately. Ah, sorry. If rootp itself is NULL, it also needs to return NULL. Thanks for spotting this. -- Ed Schouten Nuxi, 's-Hertogenbosch, the Netherlands KvK-nr.: 62051717