summaryrefslogtreecommitdiff
path: root/libc/misc/internals/ulltostr.c
diff options
context:
space:
mode:
authorManuel Novoa III <mjn3@codepoet.org>2002-03-12 01:18:50 +0000
committerManuel Novoa III <mjn3@codepoet.org>2002-03-12 01:18:50 +0000
commit03e039820dc5092e27e81f3671652f25da7f25f1 (patch)
tree37bddad6951b8a6aa5d75184353705f672217812 /libc/misc/internals/ulltostr.c
parentff3e48d94097ed02480bb0df538620b221ccd72f (diff)
Swap in the new stdio code.
Diffstat (limited to 'libc/misc/internals/ulltostr.c')
-rw-r--r--libc/misc/internals/ulltostr.c37
1 files changed, 0 insertions, 37 deletions
diff --git a/libc/misc/internals/ulltostr.c b/libc/misc/internals/ulltostr.c
deleted file mode 100644
index 50246d3bc..000000000
--- a/libc/misc/internals/ulltostr.c
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Copyright (C) 2000 Manuel Novoa III
- *
- * Note: buf is a pointer to the END of the buffer passed.
- * Call like this:
- * char buf[SIZE], *p;
- * p = __ulltostr(buf + sizeof(buf) - 1, ...)
- *
- * For long longs of 64 bits, appropriate buffer sizes are:
- * base = 2 65 = 64 digits + 1 nul
- * base = 10 20 = 19 digits + 1 nul
- * base = 16 17 = 16 hex digits + 1 nul
- */
-
-char *__ulltostr(char *buf, unsigned long long uval, int base, int uppercase)
-{
- int digit;
-
- if ((base < 2) || (base > 36)) {
- return 0;
- }
-
- *buf = '\0';
-
- do {
- digit = uval % base;
- uval /= base;
-
- /* note: slightly slower but generates less code */
- *--buf = '0' + digit;
- if (digit > 9) {
- *buf = (uppercase ? 'A' : 'a') + digit - 10;
- }
- } while (uval);
-
- return buf;
-}