1 /* Copyright (C) 2012,2013 Matthew Fluet.
2 * Copyright (C) 2004-2008 Henry Cejtin, Matthew Fluet, Suresh
3 * Jagannathan, and Stephen Weeks.
5 * MLton is released under a BSD-style license.
6 * See the file MLton-LICENSE for details.
11 const char* boolToString (bool b
) {
12 return b
? "TRUE" : "FALSE";
16 char* intmaxToCommaString (intmax_t n
) {
17 static char buf1
[BUF_SIZE
];
18 static char buf2
[BUF_SIZE
];
19 static char buf3
[BUF_SIZE
];
20 static char buf4
[BUF_SIZE
];
21 static char buf5
[BUF_SIZE
];
22 static char *bufs
[] = {buf1
, buf2
, buf3
, buf4
, buf5
};
23 static int bufIndex
= 0;
28 buf
= bufs
[bufIndex
++];
31 l
= snprintf(tmp
, BUF_SIZE
, "%"PRIdMAX
, n
);
47 while (tmp
[i
] != '\000') {
60 char* uintmaxToCommaString (uintmax_t n
) {
61 static char buf1
[BUF_SIZE
];
62 static char buf2
[BUF_SIZE
];
63 static char buf3
[BUF_SIZE
];
64 static char buf4
[BUF_SIZE
];
65 static char buf5
[BUF_SIZE
];
66 static char *bufs
[] = {buf1
, buf2
, buf3
, buf4
, buf5
};
67 static int bufIndex
= 0;
72 buf
= bufs
[bufIndex
++];
75 l
= snprintf(tmp
, BUF_SIZE
, "%"PRIuMAX
, n
);
84 while (tmp
[i
] != '\000') {