MCPcopy Create free account
hub / github.com/GarageGames/Torque2D / dItoa

Function dItoa

engine/source/platformEmscripten/EmscriptenStrings.cpp:351–370  ·  view source on GitHub ↗

-Mat hack

Source from the content-addressed store, hash-verified

349
350//-Mat hack
351int dItoa(int n, char s[])
352{
353 int i, sign;
354
355 if ((sign = n) < 0) /* record sign */
356 n = -n; /* make n positivNSStringe */
357 i = 0;
358 do { /* generate digits in reverse order */
359 s[i++] = n % 10 + '0'; /* get next digit */
360 } while ((n /= 10) > 0); /* delete it */
361 if (sign < 0)
362 s[i++] = '-';
363 s[i] = '\0';
364
365 // Reverse string.
366 dStrrev(s);
367
368 // Return length.
369 return dStrlen(s);
370}
371
372int dSscanf(const char *buffer, const char *format, ...)
373{

Callers

nothing calls this directly

Calls 2

dStrrevFunction · 0.70
dStrlenFunction · 0.70

Tested by

no test coverage detected