diff --git a/CMakeLists.txt b/CMakeLists.txt index 0362420..2b09073 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -86,6 +86,10 @@ draco_set_cxx_flags() draco_set_exe_linker_flags() draco_generate_features_h() +if (MSVC) + add_compile_options(/wd4996) +endif() + # Draco source file listing variables. list(APPEND draco_attributes_sources "${draco_src_root}/attributes/attribute_octahedron_transform.cc" diff --git a/src/draco/io/parser_utils.cc b/src/draco/io/parser_utils.cc index 378de73..be7e032 100644 --- a/src/draco/io/parser_utils.cc +++ b/src/draco/io/parser_utils.cc @@ -152,7 +152,9 @@ bool ParseSignedInt(DecoderBuffer *buffer, int32_t *value) { if (!ParseUnsignedInt(buffer, &v)) { return false; } - *value = (sign < 0) ? -v : v; + if (sign < 0) + v *= -1; + *value = v; return true; }