Cycles: enable double promotion warning /w gcc
authorCampbell Barton <ideasman42@gmail.com>
Wed, 8 Oct 2014 08:58:40 +0000 (10:58 +0200)
committerCampbell Barton <ideasman42@gmail.com>
Wed, 8 Oct 2014 08:58:40 +0000 (10:58 +0200)
intern/cycles/CMakeLists.txt
intern/cycles/kernel/osl/osl_services.cpp

index 981499b..fb747c1 100644 (file)
@@ -165,7 +165,9 @@ include_directories(
 # Warnings
 if(CMAKE_COMPILER_IS_GNUCXX)
        ADD_CHECK_CXX_COMPILER_FLAG(CMAKE_CXX_FLAGS _has_cxxflag_float_conversion "-Werror=float-conversion")
+       ADD_CHECK_CXX_COMPILER_FLAG(CMAKE_CXX_FLAGS _has_cxxflag_double_promotion "-Werror=double-promotion")
        unset(_has_cxxflag_float_conversion)
+       unset(_has_cxxflag_double_promotion)
 endif()
 
 
index 1475e5a..a969465 100644 (file)
@@ -1018,7 +1018,7 @@ bool OSLRenderServices::trace(TraceOpt &options, OSL::ShaderGlobals *sg,
 
        ray.P = TO_FLOAT3(P);
        ray.D = TO_FLOAT3(R);
-       ray.t = (options.maxdist == 1.0e30)? FLT_MAX: options.maxdist - options.mindist;
+       ray.t = (options.maxdist == 1.0e30f)? FLT_MAX: options.maxdist - options.mindist;
        ray.time = sd->time;
 
        if(options.mindist == 0.0f) {