* Convert a string into a number */
| 573 | * Convert a string into a number |
| 574 | */ |
| 575 | static npy_intp |
| 576 | _get_size(const char* str) |
| 577 | { |
| 578 | char *stop; |
| 579 | npy_longlong size = NumPyOS_strtoll(str, &stop, 10); |
| 580 | |
| 581 | if (stop == str || _is_alpha_underscore(*stop)) { |
| 582 | /* not a well formed number */ |
| 583 | return -1; |
| 584 | } |
| 585 | if (size >= NPY_MAX_INTP || size <= NPY_MIN_INTP) { |
| 586 | /* len(str) too long */ |
| 587 | return -1; |
| 588 | } |
| 589 | return size; |
| 590 | } |
| 591 | |
| 592 | /* |
| 593 | * Return the ending position of a variable name including optional modifier |
no test coverage detected