]> git.mxchange.org Git - flightgear.git/commitdiff
Workaround for code generation bug in gcc-2.95.3
authorandy <andy>
Tue, 16 Dec 2003 05:39:04 +0000 (05:39 +0000)
committerandy <andy>
Tue, 16 Dec 2003 05:39:04 +0000 (05:39 +0000)
src/Scripting/nasal-props.cxx

index 78401e1f9cebaff2b74aecb5f78a0c61642650b4..1237171b7efc8cd16145b8d678cbba633478b379 100644 (file)
@@ -111,7 +111,15 @@ static naRef f_setValue(naContext c, naRef args)
 static naRef f_setIntValue(naContext c, naRef args)
 {
     NODEARG();
-    int iv = (int)naNumValue(naVec_get(args, 0)).num;
+    // Original code:
+    //   int iv = (int)naNumValue(naVec_get(args, 0)).num;
+
+    // Junk to pacify the gcc-2.95.3 optimizer:
+    naRef tmp0 = naVec_get(args, 0);
+    naRef tmp1 = naNumValue(tmp0);
+    double tmp2 = tmp1.num;
+    int iv = (int)tmp2;
+
     (*node)->setIntValue(iv);
     return naNil();
 }