[Ohrrpgce] SVN: teeemcee/8282 vectors: remove all use of unsigned ints, and add more error checking.

subversion at HamsterRepublic.com subversion at HamsterRepublic.com
Thu Dec 29 17:51:59 PST 2016


teeemcee
2016-12-29 17:51:59 -0800 (Thu, 29 Dec 2016)
391
vectors: remove all use of unsigned ints, and add more error checking.

It turns out that writing 'x <= v_len(array) - 1' didn't work when the
length was 0, because v_len returned an unsigned 0, which underflowed
to INT_MAX. In C, GCC would throw a warning, but FB doesn't warn
although it follows C's semantics! So unsigned integers are extra risky
in FB, and I will avoid them from now on.
---
U   wip/array.c
U   wip/array.h
U   wip/vector.bi


More information about the Ohrrpgce mailing list