This patch eliminates some gcc sign-cast warnings by being more explicit about what the code does. Please review. I don't have commit access, so can someone apply this? Thanks! -David