K 10
svn:author
V 6
iulius
K 8
svn:date
V 27
2014-09-03T17:54:25.736066Z
K 7
svn:log
V 1664
sync the vector library with its latest rra-c-util version

Changes are:

- Always allocate room for at least one string to be stored in the
vector.  It simplifies some of the internal logic and, more to the
point, unconfuses clang, which otherwise produces tons of warnings
about possibly dereferencing NULL pointers since it can't follow
the logic.

- Update the confparse test to expect another value for the allocated
size of a vector, further to the previous change.

- Add __warn_unused_result__ to some vector functions that return
newly-allocated memory.

- Add asserts to the vector library to catch incoming NULL vectors.
These will probably be optimized away by gcc, but they also help
unconfuse clang.

- Allow NULL to be passed to (c)vector_free.  It's much more convenient
for freeing data structures to be able to call free routines
unconditionally without first testing for NULL.  Support this in the
vector interface.

- Define *_split_space in terms of *_split_multi to save some code.

- Check for integer overflow when determining the size of the results of
vector_join and vector_cjoin.

- Handle empty vectors in vector_join and cvector_join.

- Don't check whether a pointer is NULL before passing it into free
and instead assume free can handle NULL pointers properly.  This
has been true for many years.

- Fix vector_free to support taking NULL pointers and doing nothing with them.

- Allocate memory with calloc and assume this sets pointers to NULL
instead of explicitly initializing them.  We already had to assume
this in various places, and architectures where the all-zero bit
pattern is not the NULL pointer are exceedingly rare.

END
