Changeset 96152 in vbox for trunk/src/VBox/Runtime/common/string
- Timestamp:
- Aug 11, 2022 11:49:45 PM (2 years ago)
- Location:
- trunk/src/VBox/Runtime/common/string
- Files:
-
- 1 added
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/common/string/strtonum.cpp
r96127 r96152 41 41 *********************************************************************************************************************************/ 42 42 /** 8-bit char -> digit. 43 * Non-digits have values 255 (most), 254 (zero), 253 (colon) and 252 (space). 44 */ 45 static const unsigned char g_auchDigits[256] = 43 * Non-digits have values 255 (most), 254 (zero), 253 (colon), 252 (space), 251 (dot). 44 * 45 * @note Also used by strtofloat.cpp 46 */ 47 extern const unsigned char g_auchDigits[256] = 46 48 { 47 49 254,255,255,255,255,255,255,255,255,252,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, 48 252,255,255,255,255,255,255,255,255,255,255,255,255,255,25 5,255, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,253,255,255,255,255,255,50 252,255,255,255,255,255,255,255,255,255,255,255,255,255,251,255, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,253,255,255,255,255,255, 49 51 255, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35,255,255,255,255,255, 50 52 255, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35,255,255,255,255,255, … … 54 56 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255 55 57 }; 58 59 #define DIGITS_ZERO_TERM 254 60 #define DIGITS_COLON 253 61 #define DIGITS_SPACE 252 62 #define DIGITS_DOT 251 56 63 57 64 /** Approximated overflow shift checks. */ … … 84 91 else if (i == ' ' || i == '\t') 85 92 ch = 252; 93 else if (i == '.') 94 ch = 251; 86 95 if (i == 0) 87 96 printf("\n %3d", ch);
Note:
See TracChangeset
for help on using the changeset viewer.