summaryrefslogtreecommitdiffstats
path: root/lib/libc/stdlib/twalk.c
Commit message (Collapse)AuthorAgeFilesLines
* MFC r307227 and r307343:ed2016-10-291-6/+3
| | | | | | | | | | | | | | | | | | | | | | Improve typing of POSIX search tree functions. Back in 2015 when I reimplemented these functions to use an AVL tree, I was annoyed by the weakness of the typing of these functions. Both tree nodes and keys are represented by 'void *', meaning that things like the documentation for these functions are an absolute train wreck. To make things worse, users of these functions need to cast the return value of tfind()/tsearch() from 'void *' to 'type_of_key **' in order to access the key. Technically speaking such casts violate aliasing rules. I've observed actual breakages as a result of this by enabling features like LTO. I've filed a bug report at the Austin Group. Looking at the way the bug got resolved, they made a pretty good step in the right direction. A new type 'posix_tnode' has been added to correspond to tree nodes. It is still defined as 'void' for source-level compatibility, but in the very far future it could be replaced by a proper structure type containing a key pointer.
* libc/stdlib: Minor cleanups to code originating in NetBSDpfg2014-07-151-11/+6
| | | | | | | Mostly ANSIfication and typos. Obtained from: NetBSD MFC after: 5 days
* No need to include <assert.h> here.tjr2003-01-051-1/+0
|
* Fix the style of the SCM ID's.obrien2002-03-221-1/+3
| | | | I believe have made all of libc .c's as consistent as possible.
* Remove multi-line __P() usage.obrien2002-03-221-2/+2
|
* Remove __P() usage.obrien2002-03-211-2/+2
|
* bring in binary search tree code.alfred2000-07-011-0/+57
Obtained from: NetBSD
OpenPOWER on IntegriCloud