Several warnings detected by static code analyzer fixed

Implicit type conversion argument of function to size_t type
Suspicious sequence of types castings: size_t -> int -> size_t
Consider reviewing the expression of the 'A = B == C' kind. The expression is calculated as following: 'A = (B == C)'
Unsigned type is never < 0
Merge pull request #1420 from KindDragon/static-code-analyzer-warnings

Several warnings detected by static code analyzer fixed