| 129 | namespace strings { |
| 130 | |
| 131 | size_t FastInt32ToBufferLeft(int32 i, char* buffer) { |
| 132 | uint32 u = i; |
| 133 | size_t length = 0; |
| 134 | if (i < 0) { |
| 135 | *buffer++ = '-'; |
| 136 | ++length; |
| 137 | // We need to do the negation in modular (i.e., "unsigned") |
| 138 | // arithmetic; MSVC++ apparently warns for plain "-u", so |
| 139 | // we write the equivalent expression "0 - u" instead. |
| 140 | u = 0 - u; |
| 141 | } |
| 142 | length += FastUInt32ToBufferLeft(u, buffer); |
| 143 | return length; |
| 144 | } |
| 145 | |
| 146 | size_t FastUInt32ToBufferLeft(uint32 i, char* buffer) { |
| 147 | char* start = buffer; |
no test coverage detected