| 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 | /* |
no outgoing calls
no test coverage detected