Position of the type parameter `name` of `owner` in `f`, or CS_NONE. */
| 883 | |
| 884 | /* Position of the type parameter `name` of `owner` in `f`, or CS_NONE. */ |
| 885 | static int tparam_find(const cs_file_t *f, int owner, const char *name, size_t len) { |
| 886 | int lo = 0; |
| 887 | int hi = f->ntparams; |
| 888 | while (lo < hi) { |
| 889 | int mid = lo + ((hi - lo) / PAIR_LEN); |
| 890 | const cs_tparam_t *t = &f->tparams[mid]; |
| 891 | int c = t->owner != owner ? (t->owner < owner ? -1 : 1) : strncmp(t->name, name, len); |
| 892 | if (c == 0 && t->name[len] != '\0') { |
| 893 | c = 1; |
| 894 | } |
| 895 | if (c < 0) { |
| 896 | lo = mid + SKIP_ONE; |
| 897 | } else if (c > 0) { |
| 898 | hi = mid; |
| 899 | } else { |
| 900 | return t->pos; |
| 901 | } |
| 902 | } |
| 903 | return CS_NONE; |
| 904 | } |
| 905 | |
| 906 | static int span_cmp(const void *a, const void *b) { |
| 907 | const cs_span_lines_t *x = (const cs_span_lines_t *)a; |
no outgoing calls
no test coverage detected