]> git.mxchange.org Git - flightgear.git/blobdiff - src/Scripting/nasal-props.cxx
MIPSpro 7.4 fixes
[flightgear.git] / src / Scripting / nasal-props.cxx
index de0efca33fac241c29c8835dcc481b41663fb243..1237171b7efc8cd16145b8d678cbba633478b379 100644 (file)
@@ -25,6 +25,7 @@ naGhostType PropNodeGhostType = { propNodeGhostDestroy };
 
 static naRef propNodeGhostCreate(naContext c, SGPropertyNode* n)
 {
+    if(!n) return naNil();
     SGPropertyNode_ptr* ghost = new SGPropertyNode_ptr(n);
     return naNewGhost(c, &PropNodeGhostType, ghost);
 }
@@ -110,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();
 }