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

Function d2s

deps/jemalloc/src/malloc_io.c:276–302  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

274}
275
276static char *
277d2s(intmax_t x, char sign, char *s, size_t *slen_p) {
278 bool neg;
279
280 if ((neg = (x < 0))) {
281 x = -x;
282 }
283 s = u2s(x, 10, false, s, slen_p);
284 if (neg) {
285 sign = '-';
286 }
287 switch (sign) {
288 case '-':
289 if (!neg) {
290 break;
291 }
292 /* Fall through. */
293 case ' ':
294 case '+':
295 s--;
296 (*slen_p)++;
297 *s = sign;
298 break;
299 default: not_reached();
300 }
301 return s;
302}
303
304static char *
305o2s(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