[Bf-blender-cvs] [f3e4f42] master: Code cleanup: remove hack for older GCC (4.2x and newer work without)

Campbell Barton noreply at git.blender.org
Fri Jun 13 16:47:55 CEST 2014


Commit: f3e4f426659e1dc1b2171f416d322562f2ccda19
Author: Campbell Barton
Date:   Thu May 29 14:53:10 2014 +1000
https://developer.blender.org/rBf3e4f426659e1dc1b2171f416d322562f2ccda19

Code cleanup: remove hack for older GCC (4.2x and newer work without)

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

M	source/blender/editors/interface/interface.c

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

diff --git a/source/blender/editors/interface/interface.c b/source/blender/editors/interface/interface.c
index 19d4e32..94a9d55 100644
--- a/source/blender/editors/interface/interface.c
+++ b/source/blender/editors/interface/interface.c
@@ -1796,18 +1796,7 @@ void ui_set_but_val(uiBut *but, double value)
 			value = (char)floor(value + 0.5);
 		}
 		else if (but->pointype == UI_BUT_POIN_SHORT) {
-			/* gcc 3.2.1 seems to have problems
-			 * casting a double like 32772.0 to
-			 * a short so we cast to an int, then
-			 * to a short.
-			 *
-			 * Update: even in gcc.4.6 using intermediate int cast gives -32764,
-			 * where as a direct cast from double to short gives -32768,
-			 * if this difference isn't important we could remove this hack,
-			 * since we dont support gcc3 anymore - Campbell */
-			int gcckludge;
-			gcckludge = (int) floor(value + 0.5);
-			value = (short)gcckludge;
+			value = (short)floor(value + 0.5);
 		}
 		else if (but->pointype == UI_BUT_POIN_INT)
 			value = (int)floor(value + 0.5);




More information about the Bf-blender-cvs mailing list