Remove unused vars
Fix subtle bug when src & dst agree on sparsity but have different dimensions
Remove unused var "total"
Declare vars as locally as possible
Merge pull request #415 from asmaloney:cvCopyHist-fix
Merge pull request #414 from asmaloney:remove-unused-vars2