Skip to content

Commit

Permalink
Merge pull request #38 from pthariensflame/fix-bugs-1
Browse files Browse the repository at this point in the history
Fix a few random bugs and warnings.
  • Loading branch information
WAUthethird authored Jul 14, 2020
2 parents c498112 + e770402 commit a9157f8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion src/ExprParser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,7 @@ int ExprParser::getOperatorPrecedenceLevel(int op)
return 5;
else if (op == LBRACK)
return 6;
return !0; // impossible case
}

//get operator id from the token
Expand Down Expand Up @@ -418,7 +419,7 @@ void ExprParser::Parse(std::string expr)
float ExprParser::Evaluate(std::map<std::string, float> variable_map)
{
variable_map["pi"] = 3.141592653589f;
variable_map["e"] == 2.718281828459f;
variable_map["e"] = 2.718281828459f;

//code written in such a way to be compatible with OpenCL
float varstack[64];
Expand Down
4 changes: 2 additions & 2 deletions src/Shaders.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ std::string ComputeShader::PreprocessIncludes(const fs::path& filename, int leve
using namespace std;

//match regular expression
static const regex re("^[ ]*#include\s*[\"<](.*)[\">].*");
static const regex re("^[ ]*#include\\s*[\"<](.*)[\">].*");
stringstream input;
stringstream output;
input << LoadFileText(filename);
Expand Down Expand Up @@ -242,4 +242,4 @@ void ComputeShader::SaveErrors(const fs::path& filename, std::string code, std::

error_out << code << std::endl << errors;
error_out.close();
}
}

0 comments on commit a9157f8

Please sign in to comment.