change, where appropriate, to size_t arguments in c code