LUCY-295 Adapt for changed return type of Vec_Get_Size#36
LUCY-295 Adapt for changed return type of Vec_Get_Size#36asfgit merged 4 commits intoapache:masterfrom
Conversation
Change the type of iteration variables to `size_t` to match the return type of Vec_Get_Size. This commit is restricted to simple cases where the iteration variable is scoped to the loop block and is only used as an C array index or arguments to Vector methods which take a `size_t`.
Widen the types of variables which are assigned the return value from Vec_Get_Size. The widening should have no impact on behavior or require any casting; the variables should not be used in any context which requires implicit conversion.
After converting variables assigned the return value of Vec_Get_Size from `uint32_t` to `size_t`, at least one cast or other type conversion is performed.
|
I see that you avoided any type changes to instance variables or method parameters and return values. So what we have now is a couple of explicit but still unchecked casts from (Or check before adding elements to such arrays.) OTOH, this seems silly for things like the number of PolyQuery children, document fields, or sort rules. |
|
I agree with making I32Array and BitVector use size_t internally to match the other types. Once they are converted, it will make sense to go back and fix the unchecked-but-explicit casts. |
The Clownfish API `Vec_Get_Size` has changed from returning `uint32_t` to returning `size_t`. Adapt Lucy for the effect of this change. This branch is broken up into commits according to the kind of remedy that was applied at each site, and the associated difficulty of proofing the change. This closes #36.
The Clownfish API
Vec_Get_Sizehas changed from returninguint32_tto returningsize_t. Adapt Lucy for the effect of this change.This branch is broken up into commits according to the kind of remedy that was applied at each site, and the associated difficulty of proofing the change.