Fix error -Werror=sign-compare
It blames comparing signed type with unsigned type.
Fix it in two step:
1. If signed variable is definitely a nonnegative value at the
code context, cast it into unsigned type directly.
2. If it is unclear whether a signed variable is nonnegative, then
add assertion for testing the variable is nonnegative. After
that assertion, cast it into unsigned type. It helps catching
violation that casting negative value into unsigned variable.
Change-Id: Ib4f2a2cb2ad1901518d0726de6035ac4a033bc67
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>