void swap(void **p1, void **p2) { void *tmp = *p1; *p1 = *p2; *p2 = tmp; }