| 950 | } |
| 951 | |
| 952 | static int gb_span_cmp(const void *a, const void *b) { |
| 953 | const gb_span_t *x = a; |
| 954 | const gb_span_t *y = b; |
| 955 | int c = strcmp(x->file, y->file); |
| 956 | if (c == 0) { |
| 957 | c = (x->start > y->start) - (x->start < y->start); |
| 958 | } |
| 959 | if (c == 0) { |
| 960 | c = (x->end > y->end) - (x->end < y->end); |
| 961 | } |
| 962 | return c; |
| 963 | } |
| 964 | |
| 965 | /* The non-empty `variants` list of a properties document, or NULL. */ |
| 966 | static yyjson_val *gb_variants_list(yyjson_doc *doc) { |