| 505 | }; |
| 506 | |
| 507 | static float parseFloatExpr(const std::string& str, bool zeroNan) { |
| 508 | // BZDB.eval() can't take expressions directly |
| 509 | BZDB.set("tmp", str); |
| 510 | BZDB.setPersistent("tmp", false); |
| 511 | float value = BZDB.eval("tmp"); |
| 512 | if (!zeroNan || !isnan(value)) { |
| 513 | return value; |
| 514 | } |
| 515 | else { |
| 516 | if (!isnan(value)) { |
| 517 | return value; |
| 518 | } |
| 519 | else { |
| 520 | return 0.0f; |
| 521 | } |
| 522 | } |
| 523 | } |
| 524 | |
| 525 | static bool varIsEqual(const std::string& name) { |
| 526 | // only looking for standard server variables |
no test coverage detected