Make small fixes and oops ran clang-format on dtoa

This commit is contained in:
Justine Tunney 2020-06-30 19:55:47 -07:00
parent b5b60015f5
commit ac00be1a4e
47 changed files with 4933 additions and 5306 deletions

View file

@ -100,7 +100,7 @@ size_t internobj(struct Interner *t, const void *data, size_t size) {
item = data;
hash = max(1, KnuthMultiplicativeHash32(data, size));
do {
/* it is written that triangle probe halts iff i<n/2 && popcount(n)==1 */
/* it is written that triangle probe halts iff i<n/2 && popcnt(n)==1 */
i = (hash + step * (step + 1) / 2) & (it->n - 1);
if (it->p[i].hash == hash && it->p[i].index + size <= it->pool.n &&
memcmp(item, &it->pool.p[it->p[i].index], size) == 0) {

View file

@ -79,7 +79,7 @@ struct Edge {
};
struct Sources {
size_t i, n; /* phase 1: hashmap: popcount(n)==1 if n */
size_t i, n; /* phase 1: hashmap: popcnt(n)==1 if n */
struct Source *p; /* phase 2: arraylist sorted by id */
};

View file

@ -84,6 +84,7 @@ void RefactorFile(const char *path) {
char *mem, *spot = NULL, *part1, *part2;
CHECK_NE(-1, (fd = open(path, O_RDONLY)));
CHECK_NE(-1, fstat(fd, &st));
len2 = 0;
if ((len = st.st_size)) {
CHECK_NE(MAP_FAILED,
(mem = mmap(NULL, len, PROT_READ, MAP_PRIVATE, fd, 0)));