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

(#305) Remove occa::primitive::source #313

Closed
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
6 changes: 2 additions & 4 deletions 3rd_party/occa/include/occa/types/primitive.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ namespace occa {
class primitive {
public:
int type;
std::string source;

union {
bool bool_;
Expand All @@ -83,14 +82,13 @@ namespace occa {
}

inline primitive(const primitive &p) :
type(p.type),
source(p.source) {
type(p.type)
{
value.ptr = p.value.ptr;
}

inline primitive& operator = (const primitive &p) {
type = p.type;
source = p.source;
value.ptr = p.value.ptr;
return *this;
}
Expand Down
8 changes: 0 additions & 8 deletions 3rd_party/occa/src/types/primitive.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,12 @@ namespace occa {

if (strncmp(c, "true", 4) == 0) {
p = true;
p.source = "true";

c += 4;
return p;
}
if (strncmp(c, "false", 5) == 0) {
p = false;
p.source = "false";

c += 5;
return p;
Expand Down Expand Up @@ -90,7 +88,6 @@ namespace occa {

if (!loadedFormattedValue && !digits) {
c = c0;
p.source = std::string(c0, c - c0);
return p;
}

Expand Down Expand Up @@ -161,7 +158,6 @@ namespace occa {
}
}

p.source = std::string(c0, c - c0);
return p;
}

Expand Down Expand Up @@ -226,10 +222,6 @@ namespace occa {
}

std::string primitive::toString() const {
if (source.size()) {
return source;
}

std::string str;
switch (type) {
case primitiveType::bool_ : str = (value.bool_ ? "true" : "false"); break;
Expand Down