On Sat, Feb 8, 2014 at 2:01 PM, Pádraig Brady <[email protected]> wrote:
>>> + if (input_swap && sizeof(T) > 1) \
>>> + { \
>>> + int j; \
The new patch looks complete. Thanks to both of you.
One nit: please change the type of "j" here (identical in attached)
to be unsigned, to match that of the upper bound.
>>> + union { \
>>> + T x; \
>>> + char b[sizeof(T)]; \
>>> + } u; \
>>> + for (j = 0; j < sizeof(T); j++) \
>>> + u.b[j] = ((const char *) p)[sizeof(T) - 1 - j]; \
Re this function in the new test,
> +in_swapped() { printf '%s' "$in" | sed "s/.\{$1\}/&\\n/g" | rev | tr -d
> '\n'; }
That would be our first use of "rev". Is it ubiquitous enough to depend on?