/[svn]/linuxsampler/trunk/src/scriptvm/parser.y
ViewVC logotype

Diff of /linuxsampler/trunk/src/scriptvm/parser.y

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

revision 3592 by schoenebeck, Mon Sep 2 09:40:44 2019 UTC revision 3595 by schoenebeck, Tue Sep 3 11:06:33 2019 UTC
# Line 519  statement: Line 519  statement:
519              if (!expr->isConstExpr()) {              if (!expr->isConstExpr()) {
520                  PARSE_ERR(@5, (String("Assignment to const real number variable '") + name + "' requires const expression.").c_str());                  PARSE_ERR(@5, (String("Assignment to const real number variable '") + name + "' requires const expression.").c_str());
521              }              }
522              ConstRealVariableRef var = new ConstRealVariable({              ConstRealVariableRef var = new ConstRealVariable(
523                    #if defined(__GNUC__) && !defined(__clang__)
524                    (const RealVarDef&) // GCC 8.x requires this cast here (looks like a GCC bug to me); cast would cause an error with clang though
525                    #endif
526                {
527                  .value = (expr->isConstExpr()) ? expr->evalReal() : vmfloat(0),                  .value = (expr->isConstExpr()) ? expr->evalReal() : vmfloat(0),
528                  .unitFactor = (expr->isConstExpr()) ? expr->unitFactor() : VM_NO_FACTOR,                  .unitFactor = (expr->isConstExpr()) ? expr->unitFactor() : VM_NO_FACTOR,
529                  .unitType = expr->unitType(),                  .unitType = expr->unitType(),
# Line 534  statement: Line 538  statement:
538              if (!expr->isConstExpr()) {              if (!expr->isConstExpr()) {
539                  PARSE_ERR(@5, (String("Assignment to const integer variable '") + name + "' requires const expression.").c_str());                  PARSE_ERR(@5, (String("Assignment to const integer variable '") + name + "' requires const expression.").c_str());
540              }              }
541              ConstIntVariableRef var = new ConstIntVariable({              ConstIntVariableRef var = new ConstIntVariable(
542                    #if defined(__GNUC__) && !defined(__clang__)
543                    (const IntVarDef&) // GCC 8.x requires this cast here (looks like a GCC bug to me); cast would cause an error with clang though
544                    #endif
545                {
546                  .value = (expr->isConstExpr()) ? expr->evalInt() : 0,                  .value = (expr->isConstExpr()) ? expr->evalInt() : 0,
547                  .unitFactor = (expr->isConstExpr()) ? expr->unitFactor() : VM_NO_FACTOR,                  .unitFactor = (expr->isConstExpr()) ? expr->unitFactor() : VM_NO_FACTOR,
548                  .unitType = expr->unitType(),                  .unitType = expr->unitType(),

Legend:
Removed from v.3592  
changed lines
  Added in v.3595

  ViewVC Help
Powered by ViewVC