Support proper %g, %f, and %a float formatting

See #61
See #104
This commit is contained in:
Justine Tunney 2021-03-05 10:31:16 -08:00
parent e26bdbec52
commit f064183646
48 changed files with 1034 additions and 921 deletions

View file

@ -22,9 +22,6 @@
#include "libc/log/log.h"
#include "libc/stdio/stdio.h"
STATIC_YOINK("ntoa");
STATIC_YOINK("stoa");
void __check_fail_aligned(unsigned bytes, uint64_t ptr) {
fflush(stderr);
if (!IsTiny()) memsummary(fileno(stderr));

View file

@ -33,10 +33,6 @@
#include "libc/sysv/consts/auxv.h"
#include "libc/sysv/consts/fileno.h"
STATIC_YOINK("ntoa");
STATIC_YOINK("stoa");
STATIC_YOINK("ftoa");
/**
* Handles failure of CHECK_xx() macros.
*/

View file

@ -44,7 +44,8 @@ LIBC_LOG_A_DIRECTDEPS = \
LIBC_TIME \
LIBC_TINYMATH \
LIBC_UNICODE \
THIRD_PARTY_DLMALLOC
THIRD_PARTY_DLMALLOC \
THIRD_PARTY_GDTOA
LIBC_LOG_A_DEPS := \
$(call uniq,$(foreach x,$(LIBC_LOG_A_DIRECTDEPS),$($(x))))

View file

@ -20,8 +20,6 @@
#include "libc/stdio/stdio.h"
#include "third_party/dlmalloc/dlmalloc.internal.h"
STATIC_YOINK("ntoa");
void malloc_stats(void) {
struct MallocStats res = dlmalloc_stats(g_dlmalloc);
(fprintf)(stderr, "max system bytes = %'10zu\r\n", res.maxfp);

View file

@ -21,9 +21,6 @@
#include "libc/log/log.h"
#include "libc/mem/mem.h"
STATIC_YOINK("ntoa");
STATIC_YOINK("stoa");
static void onmemchunk(void *start, void *end, size_t used_bytes, void *arg) {
(dprintf)(*(int *)arg, "%p - %p : %08zx / %08lx\r\n", start, end, used_bytes,
(intptr_t)end - (intptr_t)start);

View file

@ -20,8 +20,6 @@
#include "libc/log/log.h"
#include "libc/mem/mem.h"
STATIC_YOINK("ntoa");
void memsummary(int fd) {
struct mallinfo mi;
mi = mallinfo();

View file

@ -37,10 +37,6 @@
#define kNontrivialSize (8 * 1000 * 1000)
STATIC_YOINK("ntoa");
STATIC_YOINK("stoa");
STATIC_YOINK("ftoa");
static struct timespec vflogf_ts;
static int vflogf_loglevel2char(unsigned level) {