Add spellcheck example
One of the benefits of implementing system call support from scratch is
that we're able to have embedded zip filesystem support which trickles
into libraries such as stdio, without unportable symbolic interposition.
It's also be great if we could say open("gs://bucket/object", O_RDONLY)
for seamless GCS, similar to Java NIO, but abstracted by the C library.
This commit is contained in:
@ -36,6 +36,7 @@ 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 long hamming(unsigned long, unsigned long) pureconst;
|
||||
|
||||
/*───────────────────────────────────────────────────────────────────────────│─╗
|
||||
│ cosmopolitan § bits » no assembly required ─╬─│┼
|
||||
|
||||
@ -19,6 +19,9 @@
|
||||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/bits/bits.h"
|
||||
|
||||
unsigned long(hamming)(unsigned long x, unsigned long y) {
|
||||
/**
|
||||
* Counts number of different bits.
|
||||
*/
|
||||
unsigned long hamming(unsigned long x, unsigned long y) {
|
||||
return popcount(x ^ y);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user