| 238 | } |
| 239 | |
| 240 | txInteger fx_Date_parse_number(txByte* theCharacter, txString* theString, txBoolean* overflow) |
| 241 | { |
| 242 | txByte c = *theCharacter; |
| 243 | txString p = *theString; |
| 244 | txInteger aResult = c - '0'; |
| 245 | c = c_read8(p++); |
| 246 | while (('0' <= c) && (c <= '9')) { |
| 247 | #if __has_builtin(__builtin_add_overflow) && __has_builtin(__builtin_mul_overflow) |
| 248 | if (__builtin_mul_overflow(aResult, 10, &aResult) || |
| 249 | __builtin_add_overflow(aResult, c - '0', &aResult)) |
| 250 | *overflow = 1; |
| 251 | #else |
| 252 | aResult = (aResult * 10) + c - '0'; |
| 253 | if (aResult < 0) |
| 254 | *overflow = 1; |
| 255 | #endif |
| 256 | c = c_read8(p++); |
| 257 | } |
| 258 | *theCharacter = c; |
| 259 | *theString = p; |
| 260 | return aResult; |
| 261 | } |
| 262 | |
| 263 | txInteger fx_Date_parse_fraction(txByte* theCharacter, txString* theString) |
| 264 | { |