| 72 | |
| 73 | |
| 74 | static int |
| 75 | fromstr_next_element(char **s, void *dptr, PyArray_Descr *dtype, |
| 76 | const char *end) |
| 77 | { |
| 78 | char *e = *s; |
| 79 | int r = dtype->f->fromstr(*s, dptr, &e, dtype); |
| 80 | /* |
| 81 | * fromstr always returns 0 for basic dtypes; s points to the end of the |
| 82 | * parsed string. If s is not changed an error occurred or the end was |
| 83 | * reached. |
| 84 | */ |
| 85 | if (*s == e || r < 0) { |
| 86 | /* Nothing read, could be end of string or an error (or both) */ |
| 87 | if (string_is_fully_read(*s, end)) { |
| 88 | return -1; |
| 89 | } |
| 90 | return -2; |
| 91 | } |
| 92 | *s = e; |
| 93 | if (end != NULL && *s > end) { |
| 94 | /* Stop the iteration if we read far enough */ |
| 95 | return -1; |
| 96 | } |
| 97 | return 0; |
| 98 | } |
| 99 | |
| 100 | static int |
| 101 | fromfile_next_element(FILE **fp, void *dptr, PyArray_Descr *dtype, |
nothing calls this directly
no test coverage detected