explicitly cast to int to avoid compilation errors with icc compiler
Merge pull request #4277 from smuzaffar/icc-type-conversion-fix2

fix for compiling with icc compiler