[Bf-blender-cvs] [d330162] master: Cycles: Fix Uninitialized Value compiler warning in the scoped_timer

Lukas Stockner noreply at git.blender.org
Sun Jan 10 00:51:52 CET 2016


Commit: d330162ba6981a6c3691bcc8759215463d47f973
Author: Lukas Stockner
Date:   Sun Jan 10 00:45:29 2016 +0100
Branches: master
https://developer.blender.org/rBd330162ba6981a6c3691bcc8759215463d47f973

Cycles: Fix Uninitialized Value compiler warning in the scoped_timer

Although the code made it impossible to use time_start_ uninitialized, at least GCC did
still produce multiple warnings about it.
Since time_dt() is an extremely cheap operation and functionality does not change in any way when
removing the check in the constructor, this commit removes the check and therefore the warning.

===================================================================

M	intern/cycles/util/util_time.h

===================================================================

diff --git a/intern/cycles/util/util_time.h b/intern/cycles/util/util_time.h
index e2f7ca2..9cd52d5 100644
--- a/intern/cycles/util/util_time.h
+++ b/intern/cycles/util/util_time.h
@@ -31,9 +31,7 @@ class scoped_timer {
 public:
 	scoped_timer(double *value) : value_(value)
 	{
-		if(value_ != NULL) {
-			time_start_ = time_dt();
-		}
+		time_start_ = time_dt();
 	}
 
 	~scoped_timer()




More information about the Bf-blender-cvs mailing list