[Just a short review, more later]review]
Not a 3-way compare
data->size - *key is never negative as it is a wide unsigned subtraction and so does not meet "Requires a 3-way comparison function".
Idiomatic compare is (a > b) - (a < b), which works for all numeric types.