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

Function modp_uitoa10

lib/src/string/StringUtil.cpp:72–98  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

70 */
71
72 uint32_t modp_uitoa10(uint32_t value,char *str) {
73
74 char *wstr=str;
75 uint32_t size;
76
77 // Conversion. Number is reversed.
78
79 do *wstr++ = (char)(48 + (value % 10)); while (value /= 10);
80 *wstr='\0';
81
82 // andy's mod: reverse the string in place. this is probably optimal.
83
84 size=wstr-str;
85 wstr--;
86
87 while(str<wstr) {
88
89 *str^=*wstr;
90 *wstr^=*str;
91 *str^=*wstr;
92
93 wstr--;
94 str++;
95 }
96
97 return size;
98 }
99
100
101 /*

Callers 15

GraphicTerminal.hFile · 0.85
SemiHostingClass · 0.85
toStringMethod · 0.85
pasvCommandMethod · 0.85
sizeCommandMethod · 0.85
AsciiMethod · 0.85
TextOutputStream.hFile · 0.85
onErrorMethod · 0.85
runMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected