summaryrefslogtreecommitdiff
path: root/lib/xtoa.c
diff options
context:
space:
mode:
authorFreya Murphy <freya@freyacat.org>2025-04-08 10:39:48 -0400
committerFreya Murphy <freya@freyacat.org>2025-04-08 10:39:48 -0400
commit8a19547957a86bed3f58c9abc1ac218d04698faf (patch)
treeed7ccc6f3a8902915dfe6c9bf763fc45d752b3c4 /lib/xtoa.c
parentfmt (diff)
downloadcomus-8a19547957a86bed3f58c9abc1ac218d04698faf.tar.gz
comus-8a19547957a86bed3f58c9abc1ac218d04698faf.tar.bz2
comus-8a19547957a86bed3f58c9abc1ac218d04698faf.zip
break apart c libaray
Diffstat (limited to 'lib/xtoa.c')
-rw-r--r--lib/xtoa.c31
1 files changed, 0 insertions, 31 deletions
diff --git a/lib/xtoa.c b/lib/xtoa.c
deleted file mode 100644
index bf02236..0000000
--- a/lib/xtoa.c
+++ /dev/null
@@ -1,31 +0,0 @@
-#include <stdlib.h>
-
-#define XTOA(type, name) \
- char *name(type n, char *buffer, int radix) \
- { \
- if (n == 0) { \
- buffer[0] = '0'; \
- buffer[1] = '\0'; \
- return buffer + 1; \
- } \
- if (n < 0) { \
- *buffer++ = '-'; \
- n = -n; \
- } \
- char *start = buffer; \
- for (; n; n /= radix) { \
- *buffer++ = itoc(n % radix); \
- } \
- char *buf_end = buffer; \
- *buffer-- = '\0'; \
- while (buffer > start) { \
- char tmp = *start; \
- *start++ = *buffer; \
- *buffer-- = tmp; \
- } \
- return buf_end; \
- }
-
-XTOA(int, itoa)
-XTOA(long int, ltoa)
-XTOA(long long int, lltoa)