Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/source
diff options
context:
space:
mode:
authorChris Want <cwant@ualberta.ca>2003-02-15 07:18:22 +0300
committerChris Want <cwant@ualberta.ca>2003-02-15 07:18:22 +0300
commit8956af99abae0508a68abcf094ec748eb408dbfe (patch)
tree0759d093c54d59d8c83b30f311775fd8bc2fbd1e /source
parent5cc0dcc97060d612ef50c163d0ab3e8c0ddf31b9 (diff)
gcc 3.2.1 seems to have problems casting a double like 32772.0 to
a short, so we cast to an int first, then to a short when a button that modifies a short value is pressed. (Allieviates the bug where the Unified Renderer button modifies the values of a bunch of other buttons).
Diffstat (limited to 'source')
-rw-r--r--source/blender/src/interface.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/source/blender/src/interface.c b/source/blender/src/interface.c
index 0209607d2e5..55605e9154e 100644
--- a/source/blender/src/interface.c
+++ b/source/blender/src/interface.c
@@ -3337,8 +3337,15 @@ static void ui_set_but_val(uiBut *but, double value)
}
else if( but->pointype==CHA )
*((char *)poin)= (char)value;
- else if( but->pointype==SHO )
- *((short *)poin)= (short)value;
+ else if( but->pointype==SHO ) {
+ /* 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 */
+ int gcckludge;
+ gcckludge = (int) value;
+ *((short *)poin)= (short) gcckludge;
+ }
else if( but->pointype==INT )
*((int *)poin)= (int)value;
else if( but->pointype==FLO )