fix compile on gcc4.7

-Wshadow is broken in older gcc, so needs unique func/var names.

reported by Vinson Lee <vlee@twitter.com>