Skip to content

Commit

Permalink
small addition to avoid compiler warnings using Clang. C+=14 now
Browse files Browse the repository at this point in the history
  • Loading branch information
kosloot committed Dec 8, 2024
1 parent 1d9056d commit 08c92d4
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 11 deletions.
2 changes: 1 addition & 1 deletion include/patternmodel.h
Original file line number Diff line number Diff line change
Expand Up @@ -1502,7 +1502,7 @@ class PatternModel: public MapType, public PatternModelInterface {
/**
* Write the pattern model to output stream
*/
void write( std::ostream& out) {
void write( std::ostream& out) override {
const char null = 0;
out.write( (char*) &null, sizeof(char));
unsigned char t = this->getmodeltype();
Expand Down
23 changes: 14 additions & 9 deletions include/patternstore.h
Original file line number Diff line number Diff line change
Expand Up @@ -803,7 +803,7 @@ class HashOrderedPatternSet: public PatternStore<t_hashorderedpatternset,ReadWri
HashOrderedPatternSet(): PatternStore<t_hashorderedpatternset,ReadWriteSizeType>() {};
virtual ~HashOrderedPatternSet();

void insert(const Pattern& pattern) {
void insert(const Pattern& pattern) override {
data.insert(pattern);
}

Expand Down Expand Up @@ -878,7 +878,8 @@ class PatternMap: public PatternMapStore<std::unordered_map<Pattern,ValueType>,V
data[pattern] = value;
}

void insert(const Pattern & pattern) { data[pattern] = ValueType(); } //singular insert required by PatternStore, implies 'default' ValueType, usually 0
void insert(const Pattern & pattern) override {
data[pattern] = ValueType(); } //singular insert required by PatternStore, implies 'default' ValueType, usually 0

bool has(const Pattern & pattern) const override {
return data.count(pattern);
Expand Down Expand Up @@ -929,7 +930,8 @@ class PatternPointerMap: public PatternMapStore<std::unordered_map<PatternPointe
data[pattern] = value;
}

void insert(const PatternPointer & pattern) { data[pattern] = ValueType(); } //singular insert required by PatternStore, implies 'default' ValueType, usually 0
void insert(const PatternPointer & pattern) override
{ data[pattern] = ValueType(); } //singular insert required by PatternStore, implies 'default' ValueType, usually 0

bool has(const Pattern & pattern) const override {
return data.count(pattern);
Expand Down Expand Up @@ -978,11 +980,13 @@ class OrderedPatternPointerMap: public PatternMapStore<std::map<PatternPointer,V
explicit OrderedPatternPointerMap():
corpus( NULL){ }

void insert(const PatternPointer & pattern, const ValueType & value) {
void insert(const PatternPointer & pattern, const ValueType & value) override
{
data[pattern] = value;
}

void insert(const PatternPointer & pattern) { data[pattern] = ValueType(); } //singular insert required by PatternStore, implies 'default' ValueType, usually 0
void insert(const PatternPointer & pattern) override
{ data[pattern] = ValueType(); } //singular insert required by PatternStore, implies 'default' ValueType, usually 0

bool has(const Pattern & pattern) const override {
return data.count(pattern);
Expand Down Expand Up @@ -1026,11 +1030,12 @@ class HashOrderedPatternMap: public PatternMapStore<std::map<const Pattern,Value
HashOrderedPatternMap(): PatternMapStore<std::map<const Pattern, ValueType>,ValueType,ValueHandler,ReadWriteSizeType>() {};
virtual ~HashOrderedPatternMap() {};

void insert(const Pattern & pattern, const ValueType & value) {
data[pattern] = value;
}
void insert(const Pattern & pattern, const ValueType & value) override {
data[pattern] = value;
}

void insert(const Pattern & pattern) { data[pattern] = ValueType(); } //singular insert required by PatternStore, implies 'default' ValueType
void insert(const Pattern & pattern) override
{ data[pattern] = ValueType(); } //singular insert required by PatternStore, implies 'default' ValueType

bool has(const Pattern & pattern) const override { return data.count(pattern); }
bool has(const PatternPointer & pattern) const override { return data.count(pattern); }
Expand Down
2 changes: 1 addition & 1 deletion src/Makefile.am
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
AM_CXXFLAGS = -Wall -O3 -std=c++17 -Wno-vla -fPIC
AM_CXXFLAGS = -Wall -O3 -std=c++14 -Wno-vla -fPIC
AM_CPPFLAGS = -I@top_srcdir@/include
AM_LDFLAGS = -static -fPIC

Expand Down

0 comments on commit 08c92d4

Please sign in to comment.