MCPcopy Create free account
hub / github.com/Snapchat/KeyDB / d2s

Function d2s

deps/memkind/src/jemalloc/src/malloc_io.c:289–315  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

287}
288
289static char *
290d2s(intmax_t x, char sign, char *s, size_t *slen_p) {
291 bool neg;
292
293 if ((neg = (x < 0))) {
294 x = -x;
295 }
296 s = u2s(x, 10, false, s, slen_p);
297 if (neg) {
298 sign = '-';
299 }
300 switch (sign) {
301 case '-':
302 if (!neg) {
303 break;
304 }
305 /* Fall through. */
306 case ' ':
307 case '+':
308 s--;
309 (*slen_p)++;
310 *s = sign;
311 break;
312 default: not_reached();
313 }
314 return s;
315}
316
317static char *
318o2s(uintmax_t x, bool alt_form, char *s, size_t *slen_p) {

Callers 1

malloc_io.cFile · 0.70

Calls 1

u2sFunction · 0.70

Tested by

no test coverage detected