MCPcopy Create free account
hub / github.com/andysworkshop/stm32plus / itoa

Function itoa

lib/src/string/StringUtil.cpp:41–65  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

39 */
40
41 char* itoa(int value,char* result,int base) {
42
43 char* ptr=result,*ptr1=result,tmp_char;
44 int tmp_value;
45
46 do {
47 tmp_value=value;
48 value/=base;
49 *ptr++="zyxwvutsrqponmlkjihgfedcba9876543210123456789abcdefghijklmnopqrstuvwxyz"[35+(tmp_value-value*base)];
50 } while(value);
51
52 // Apply negative sign
53
54 if(tmp_value<0)
55 *ptr++='-';
56
57 *ptr--='\0';
58
59 while(ptr1<ptr) {
60 tmp_char=*ptr;
61 *ptr--=*ptr1;
62 *ptr1++=tmp_char;
63 }
64 return result;
65 }
66
67
68 /*

Callers 13

computeLossyShortNameMethod · 0.85
GraphicTerminal.hFile · 0.85
drawConsoleMethod · 0.85
SemiHostingClass · 0.85
TextOutputStream.hFile · 0.85
runMethod · 0.85
allocateBlocksMethod · 0.85
countImagesMethod · 0.85
readImagesMethod · 0.85
openImageMethod · 0.85
ThumbManagerMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected