C: Generic Swap Function