/[svn]/linuxsampler/trunk/src/scriptvm/tree.cpp
ViewVC logotype

Diff of /linuxsampler/trunk/src/scriptvm/tree.cpp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 3713 by schoenebeck, Wed Jan 8 21:21:58 2020 UTC revision 3714 by schoenebeck, Sat Jan 11 20:19:11 2020 UTC
# Line 639  vmfloat FunctionCall::evalReal() { Line 639  vmfloat FunctionCall::evalReal() {
639  }  }
640    
641  VMIntArrayExpr* FunctionCall::asIntArray() const {  VMIntArrayExpr* FunctionCall::asIntArray() const {
642        //FIXME: asIntArray() not intended for evaluation semantics (for both
643        // performance reasons with arrays, but also to prevent undesired value
644        // mutation by implied (hidden) evaluation, as actually done here. We must
645        // force function evaluation here though, because we need it for function
646        // calls to be evaluated at all. This issue should be addressed cleanly by
647        // adjusting the API appropriately.
648        FunctionCall* rwSelf = const_cast<FunctionCall*>(this);
649        rwSelf->result = rwSelf->execVMFn();
650    
651      if (!result) return 0;      if (!result) return 0;
652      VMIntArrayExpr* intArrExpr = dynamic_cast<VMIntArrayExpr*>(result->resultValue());      VMIntArrayExpr* intArrExpr = dynamic_cast<VMIntArrayExpr*>(result->resultValue());
653      return intArrExpr;      return intArrExpr;
654  }  }
655    
656  VMRealArrayExpr* FunctionCall::asRealArray() const {  VMRealArrayExpr* FunctionCall::asRealArray() const {
657        //FIXME: asRealArray() not intended for evaluation semantics (for both
658        // performance reasons with arrays, but also to prevent undesired value
659        // mutation by implied (hidden) evaluation, as actually done here. We must
660        // force function evaluation here though, because we need it for function
661        // calls to be evaluated at all. This issue should be addressed cleanly by
662        // adjusting the API appropriately.
663        FunctionCall* rwSelf = const_cast<FunctionCall*>(this);
664        rwSelf->result = rwSelf->execVMFn();
665    
666      if (!result) return 0;      if (!result) return 0;
667      VMRealArrayExpr* realArrExpr = dynamic_cast<VMRealArrayExpr*>(result->resultValue());      VMRealArrayExpr* realArrExpr = dynamic_cast<VMRealArrayExpr*>(result->resultValue());
668      return realArrExpr;      return realArrExpr;

Legend:
Removed from v.3713  
changed lines
  Added in v.3714

  ViewVC Help
Powered by ViewVC