Fix -Wsign-conversion Clang warning.

JerryScript-DCO-1.0-Signed-off-by: Robert Sipka rsipka.uszeged@partner.samsung.com
This commit is contained in:
Robert Sipka 2016-09-06 12:42:17 +02:00
parent 27deda5712
commit caee6f738e
2 changed files with 5 additions and 4 deletions

View File

@ -178,14 +178,15 @@ jerry_add_compile_warnings(all extra format-nonliteral init-self conversion sign
jerry_add_compile_flags(-Wno-stack-protector -Wno-attributes)
if(CMAKE_COMPILER_IS_GNUCC)
if(JERRY_LIBC)
jerry_add_compile_flags(-Werror)
endif()
jerry_add_compile_warnings(logical-op)
else()
jerry_add_compile_flags(-Wno-nested-anon-types -Wno-static-in-inline)
endif()
if(JERRY_LIBC)
jerry_add_compile_flags(-Werror)
endif()
if(DEFINED EXTERNAL_COMPILE_FLAGS)
jerry_add_compile_flags(${EXTERNAL_COMPILE_FLAGS})
endif()

View File

@ -267,7 +267,7 @@ rand (void)
libc_random_gen_state[3] ^= libc_random_gen_state[3] >> 19;
libc_random_gen_state[3] ^= intermediate;
return libc_random_gen_state[3] % (RAND_MAX + 1u);
return (int) (libc_random_gen_state[3] % (RAND_MAX + 1));
} /* rand */
/**