mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-07-02 17:28:30 +00:00
Make small fixes and oops ran clang-format on dtoa
This commit is contained in:
parent
b5b60015f5
commit
ac00be1a4e
47 changed files with 4933 additions and 5306 deletions
|
@ -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) {
|
||||
|
|
|
@ -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 */
|
||||
};
|
||||
|
||||
|
|
|
@ -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)));
|
||||
|
|
|
@ -145,6 +145,8 @@ int main(int argc, char *argv[]) {
|
|||
SHOWOP(error);
|
||||
SHOWOP(esrc);
|
||||
SHOWOP(first_f2f3);
|
||||
SHOWOP(modrm);
|
||||
SHOWOP(sib);
|
||||
SHOWOP(has_modrm);
|
||||
SHOWOP(has_sib);
|
||||
SHOWOP(hint);
|
||||
|
@ -162,9 +164,6 @@ int main(int argc, char *argv[]) {
|
|||
SHOWOP(mod);
|
||||
SHOWOP(mode);
|
||||
SHOWOP(mode_first_prefix);
|
||||
SHOWOP(modep5);
|
||||
SHOWOP(modep55c);
|
||||
SHOWOP(modrm_byte);
|
||||
SHOWOP(nominal_opcode);
|
||||
SHOWOP(nprefixes);
|
||||
SHOWOP(nrexes);
|
||||
|
@ -189,9 +188,6 @@ int main(int argc, char *argv[]) {
|
|||
SHOWOP(rexx);
|
||||
SHOWOP(rm);
|
||||
SHOWOP(seg_ovd);
|
||||
SHOWOP(sibbase);
|
||||
SHOWOP(sibindex);
|
||||
SHOWOP(sibscale);
|
||||
SHOWOP(srm);
|
||||
SHOWOP(ubit);
|
||||
SHOWOP(uimm0);
|
||||
|
|
|
@ -177,6 +177,7 @@ mode.\n\
|
|||
#define CTRL(C) ((C) ^ 0100)
|
||||
#define ALT(C) ((033 << 010) | (C))
|
||||
#define ARGZ(...) ((char *const[]){__VA_ARGS__, NULL})
|
||||
#define MOD(X, Y) ((X) - (ABS(Y)) * ((X) / ABS(Y)))
|
||||
|
||||
#define BALLOC(B, A, N, NAME) \
|
||||
({ \
|
||||
|
@ -509,8 +510,8 @@ static bool TrySpeaker(const char *prog, char *const *args) {
|
|||
int rc;
|
||||
int fds[3];
|
||||
fds[0] = -1;
|
||||
fds[1] = STDERR_FILENO;
|
||||
fds[2] = STDERR_FILENO;
|
||||
fds[1] = fileno(g_logfile);
|
||||
fds[2] = fileno(g_logfile);
|
||||
LOGF("spawning %s", prog);
|
||||
if ((rc = spawnve(0, fds, prog, args, environ)) != -1) {
|
||||
playpid_ = rc;
|
||||
|
@ -541,8 +542,8 @@ static bool OpenSpeaker(void) {
|
|||
if (!once) {
|
||||
once = true;
|
||||
i = 0;
|
||||
if (sox_) tryspeakerfns_[i++] = TrySox;
|
||||
if (ffplay_) tryspeakerfns_[i++] = TryFfplay;
|
||||
if (sox_) tryspeakerfns_[i++] = TrySox;
|
||||
}
|
||||
snprintf(fifopath_, sizeof(fifopath_), "%s%s.%d.%d.wav", kTmpPath,
|
||||
program_invocation_short_name, getpid(), count);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue