Clean up more code

The *NSYNC linked list API is good enough that it deserves to be part of
the C libray, so this change writes an improved version of it which uses
that offsetof() trick from the Linux Kernel. We vendor all of the *NSYNC
tests in third_party which helped confirm the needed refactoring is safe

This change also deletes more old code that didn't pan out. My goal here
is to work towards a vision where the Cosmopolitan core libraries become
less experimental and more focused on curation. This better reflects the
current level of quality we've managed to achieve.
This commit is contained in:
Justine Tunney 2023-07-06 06:57:28 -07:00
parent 88612a2cd7
commit 0a24b4fc3c
No known key found for this signature in database
GPG key ID: BE714B4575D6E328
268 changed files with 632 additions and 8688 deletions

View file

@ -4,20 +4,13 @@
COSMOPOLITAN_C_START_
#ifdef COSMO
#define CheckUnsigned(x) ((x) / !((typeof(x))(-1) < 0))
extern const uint8_t kReverseBits[256];
int _bitreverse8(int) libcesque pureconst;
int _bitreverse16(int) libcesque pureconst;
uint32_t _bitreverse32(uint32_t)
libcesque pureconst;
uint64_t _bitreverse64(uint64_t)
libcesque pureconst;
unsigned long _roundup2pow(unsigned long) libcesque pureconst;
unsigned long _roundup2log(unsigned long) libcesque pureconst;
unsigned long _rounddown2pow(unsigned long) libcesque pureconst;
unsigned _bextra(const unsigned *, size_t, char);
int _bitreverse8(int) pureconst;
int _bitreverse16(int) pureconst;
uint32_t _bitreverse32(uint32_t) pureconst;
uint64_t _bitreverse64(uint64_t) pureconst;
unsigned long _roundup2pow(unsigned long) pureconst;
unsigned long _roundup2log(unsigned long) pureconst;
unsigned long _rounddown2pow(unsigned long) pureconst;
#define READ16LE(P) \
(__extension__({ \