Converts a character to the decimal number based on the radix Returns -1 if the character is not valid for the radix
| 163 | // Converts a character to the decimal number based on the radix |
| 164 | // Returns -1 if the character is not valid for the radix |
| 165 | static int asCharToNbr(char ch, int radix) |
| 166 | { |
| 167 | if( ch >= '0' && ch <= '9' ) return ((ch -= '0') < radix ? ch : -1); |
| 168 | if( ch >= 'A' && ch <= 'Z' ) return ((ch -= 'A'-10) < radix ? ch : -1); |
| 169 | if( ch >= 'a' && ch <= 'z' ) return ((ch -= 'a'-10) < radix ? ch : -1); |
| 170 | return -1; |
| 171 | } |
| 172 | |
| 173 | // If base is 0 the string should be prefixed by 0x, 0d, 0o, or 0b to allow the function to automatically determine the radix |
| 174 | asQWORD asStringScanUInt64(const char *string, int base, size_t *numScanned, bool *overflow) |
no outgoing calls
no test coverage detected