Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix a few random bugs and warnings. #38

Merged
merged 1 commit into from
Jul 14, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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();
}
}