Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
nvalue sanitisation part 5: remove 'union Value' (re: 0686c70)
The last uses of union Value were variables in shell functions in array.c, name.c and nvdisc.c. These are now converted to use simple void pointers, with typecasts where necessary for correct dereference when reading or assigning values. In most functions, 'union Value *up;' needed to be replaced with a pointer to a pointer, 'void **vpp', because up was not always dereferenced. However, in nv_arrayisset() and nv_getnum(), 'up' was always dereferenced, so a further simplification to 'void *vp' was possible, removing one layer of dereference. In array.c, the 'val' member of struct index_array is now an array of void pointers. With that, all 'union Value' usage is gone, so the union definition is deleted from name.h.
- Loading branch information