libuv 1.45.0, #include cleanup, probably something else.

git-svn-id: https://www.unprompted.com/svn/projects/tildefriends/trunk@4308 ed5197a5-7fde-0310-b194-c3ffbd925b24
This commit is contained in:
2023-05-21 21:36:51 +00:00
parent 1ccb9183b4
commit f421606e21
299 changed files with 7167 additions and 4918 deletions

View File

@ -37,28 +37,14 @@ static int compare_task(const void* va, const void* vb) {
}
const char* fmt(double d) {
static char buf[1024];
static char* p;
char* fmt(char (*buf)[32], double d) {
uint64_t v;
char* p;
if (p == NULL)
p = buf;
p += 31;
if (p >= buf + sizeof(buf))
return "<buffer too small>";
p = &(*buf)[32];
v = (uint64_t) d;
#if 0 /* works but we don't care about fractional precision */
if (d - v >= 0.01) {
*--p = '0' + (uint64_t) (d * 100) % 10;
*--p = '0' + (uint64_t) (d * 10) % 10;
*--p = '.';
}
#endif
*--p = '\0';
if (v == 0)
*--p = '0';
@ -77,9 +63,7 @@ const char* fmt(double d) {
int run_tests(int benchmark_output) {
int actual;
int total;
int passed;
int failed;
int skipped;
int current;
int test_result;
int skip;
@ -102,9 +86,7 @@ int run_tests(int benchmark_output) {
fflush(stdout);
/* Run all tests. */
passed = 0;
failed = 0;
skipped = 0;
current = 1;
for (task = TASKS; task->main; task++) {
if (task->is_helper) {
@ -113,8 +95,8 @@ int run_tests(int benchmark_output) {
test_result = run_test(task->task_name, benchmark_output, current);
switch (test_result) {
case TEST_OK: passed++; break;
case TEST_SKIP: skipped++; break;
case TEST_OK: break;
case TEST_SKIP: break;
default: failed++;
}
current++;