More unsigned signed warning fixes

This batch includes:

* Change pcapa from int to size_t, all the capacities should probably be a size_t here
* Change index in codedump loop to uint, starts at 0 and is only ever incremented
* Change start_index to size_t, it is a size_t in the calling function.