FastLED 3.9.15
Loading...
Searching...
No Matches

◆ itoa()

static int fl::string_functions::itoa ( int value,
char * sp,
int radix )
static

Definition at line 74 of file str.cpp.

74 {
75 char tmp[16]; // be careful with the length of the buffer
76 char *tp = tmp;
77 int i;
78 unsigned v;
79
80 int sign = (radix == 10 && value < 0);
81 if (sign)
82 v = -value;
83 else
84 v = (unsigned)value;
85
86 while (v || tp == tmp) {
87 i = v % radix;
88 v = radix ? v / radix : 0;
89 if (i < 10)
90 *tp++ = i + '0';
91 else
92 *tp++ = i + 'a' - 10;
93 }
94
95 int len = tp - tmp;
96
97 if (sign) {
98 *sp++ = '-';
99 len++;
100 }
101
102 while (tp > tmp)
103 *sp++ = *--tp;
104
105 return len;
106}

References itoa().

Referenced by itoa().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: