It would be more correct to convert all start and end coordinates on query and reference to unsigned, but this is a much smaller change and should do for now.
warning: comparison of integer expressions of different signedness: ‘int’ and ‘unsigned int’ [-Wsign-compare]
99 | if (h.query_start > prev_q_start + k) {
| ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~
It would be more correct to convert all start and end coordinates on query and reference to unsigned, but this is a much smaller change and should do for now.