Navigation Menu

Skip to content

Commit

Permalink
Add const specifiers to suppress warnings.
Browse files Browse the repository at this point in the history
clang-3.3 says "warning: 'constexpr' non-static member function will not be implicitly 'const' in C++1y; add 'const' to avoid a change in behavior [-Wconstexpr-not-const]".
  • Loading branch information
s-yata committed Jun 20, 2013
1 parent 1cf79e2 commit a86855b
Show file tree
Hide file tree
Showing 8 changed files with 25 additions and 25 deletions.
2 changes: 1 addition & 1 deletion lib/grnxx/alpha/map.hpp
Expand Up @@ -100,7 +100,7 @@ class Map {
virtual MapType type() const;

// Return the minimum key ID.
constexpr int64_t min_key_id() {
constexpr int64_t min_key_id() const {
return 0;
}
// Return the maximum key ID ever used.
Expand Down
16 changes: 8 additions & 8 deletions lib/grnxx/alpha/map_range.hpp
Expand Up @@ -42,7 +42,7 @@ struct MapIDRange {

struct MapIDLess {
int64_t max;
constexpr MapRangeFlags flags() {
constexpr MapRangeFlags flags() const {
return MAP_RANGE_LESS;
}
operator MapIDRange() const {
Expand All @@ -52,7 +52,7 @@ struct MapIDLess {

struct MapIDLessEqual {
int64_t max;
constexpr MapRangeFlags flags() {
constexpr MapRangeFlags flags() const {
return MAP_RANGE_LESS_EQUAL;
}
operator MapIDRange() const {
Expand All @@ -62,7 +62,7 @@ struct MapIDLessEqual {

struct MapIDGreater {
int64_t min;
constexpr MapRangeFlags flags() {
constexpr MapRangeFlags flags() const {
return MAP_RANGE_GREATER;
}
operator MapIDRange() const {
Expand All @@ -72,7 +72,7 @@ struct MapIDGreater {

struct MapIDGreaterEqual {
int64_t min;
constexpr MapRangeFlags flags() {
constexpr MapRangeFlags flags() const {
return MAP_RANGE_GREATER_EQUAL;
}
operator MapIDRange() const {
Expand Down Expand Up @@ -143,7 +143,7 @@ struct MapKeyRange {
template <typename T>
struct MapKeyLess {
T max;
constexpr MapRangeFlags flags() {
constexpr MapRangeFlags flags() const {
return MAP_RANGE_LESS;
}
operator MapKeyRange<T>() const {
Expand All @@ -154,7 +154,7 @@ struct MapKeyLess {
template <typename T>
struct MapKeyLessEqual {
T max;
constexpr MapRangeFlags flags() {
constexpr MapRangeFlags flags() const {
return MAP_RANGE_LESS_EQUAL;
}
operator MapKeyRange<T>() const {
Expand All @@ -165,7 +165,7 @@ struct MapKeyLessEqual {
template <typename T>
struct MapKeyGreater {
T min;
constexpr MapRangeFlags flags() {
constexpr MapRangeFlags flags() const {
return MAP_RANGE_GREATER;
}
operator MapKeyRange<T>() const {
Expand All @@ -176,7 +176,7 @@ struct MapKeyGreater {
template <typename T>
struct MapKeyGreaterEqual {
T min;
constexpr MapRangeFlags flags() {
constexpr MapRangeFlags flags() const {
return MAP_RANGE_GREATER_EQUAL;
}
operator MapKeyRange<T>() const {
Expand Down
2 changes: 1 addition & 1 deletion lib/grnxx/duration.hpp
Expand Up @@ -76,7 +76,7 @@ class Duration {
}

// Return the tick count.
constexpr int64_t count() {
constexpr int64_t count() const {
return count_;
}
// Set the tick count.
Expand Down
2 changes: 1 addition & 1 deletion lib/grnxx/map.hpp
Expand Up @@ -76,7 +76,7 @@ class Map {
virtual MapType type() const = 0;

// Return the minimum key ID.
constexpr int64_t min_key_id() {
constexpr int64_t min_key_id() const {
return MAP_MIN_KEY_ID;
}
// Return the maximum key ID ever used.
Expand Down
16 changes: 8 additions & 8 deletions lib/grnxx/map_cursor_query.hpp
Expand Up @@ -55,7 +55,7 @@ struct MapCursorKeyIDRange {
template <typename T>
struct MapCursorKeyIDLess {
int64_t max;
constexpr MapCursorKeyIDFlags flags() {
constexpr MapCursorKeyIDFlags flags() const {
return MAP_CURSOR_KEY_ID_LESS;
}
operator MapCursorKeyIDRange<T>() const {
Expand All @@ -66,7 +66,7 @@ struct MapCursorKeyIDLess {
template <typename T>
struct MapCursorKeyIDLessEqual {
int64_t max;
constexpr MapCursorKeyIDFlags flags() {
constexpr MapCursorKeyIDFlags flags() const {
return MAP_CURSOR_KEY_ID_LESS_EQUAL;
}
operator MapCursorKeyIDRange<T>() const {
Expand All @@ -77,7 +77,7 @@ struct MapCursorKeyIDLessEqual {
template <typename T>
struct MapCursorKeyIDGreater {
int64_t min;
constexpr MapCursorKeyIDFlags flags() {
constexpr MapCursorKeyIDFlags flags() const {
return MAP_CURSOR_KEY_ID_GREATER;
}
operator MapCursorKeyIDRange<T>() const {
Expand All @@ -88,7 +88,7 @@ struct MapCursorKeyIDGreater {
template <typename T>
struct MapCursorKeyIDGreaterEqual {
int64_t min;
constexpr MapCursorKeyIDFlags flags() {
constexpr MapCursorKeyIDFlags flags() const {
return MAP_CURSOR_KEY_ID_GREATER_EQUAL;
}
operator MapCursorKeyIDRange<T>() const {
Expand Down Expand Up @@ -201,7 +201,7 @@ struct MapCursorKeyRange {
template <typename T>
struct MapCursorKeyLess {
T max;
constexpr MapCursorKeyFlags flags() {
constexpr MapCursorKeyFlags flags() const {
return MAP_CURSOR_KEY_LESS;
}
operator MapCursorKeyRange<T>() const {
Expand All @@ -212,7 +212,7 @@ struct MapCursorKeyLess {
template <typename T>
struct MapCursorKeyLessEqual {
T max;
constexpr MapCursorKeyFlags flags() {
constexpr MapCursorKeyFlags flags() const {
return MAP_CURSOR_KEY_LESS_EQUAL;
}
operator MapCursorKeyRange<T>() const {
Expand All @@ -223,7 +223,7 @@ struct MapCursorKeyLessEqual {
template <typename T>
struct MapCursorKeyGreater {
T min;
constexpr MapCursorKeyFlags flags() {
constexpr MapCursorKeyFlags flags() const {
return MAP_CURSOR_KEY_GREATER;
}
operator MapCursorKeyRange<T>() const {
Expand All @@ -234,7 +234,7 @@ struct MapCursorKeyGreater {
template <typename T>
struct MapCursorKeyGreaterEqual {
T min;
constexpr MapCursorKeyFlags flags() {
constexpr MapCursorKeyFlags flags() const {
return MAP_CURSOR_KEY_GREATER_EQUAL;
}
operator MapCursorKeyRange<T>() const {
Expand Down
2 changes: 1 addition & 1 deletion lib/grnxx/mutex.hpp
Expand Up @@ -69,7 +69,7 @@ class Mutex {
return true;
}

constexpr bool locked() {
constexpr bool locked() const {
return status_ != MUTEX_UNLOCKED;
}

Expand Down
8 changes: 4 additions & 4 deletions lib/grnxx/string_format.hpp
Expand Up @@ -41,16 +41,16 @@ class StringFormatAlignment {
pad_(pad),
attribute_(attribute) {}

constexpr const T &value() {
constexpr const T &value() const {
return value_;
}
constexpr size_t width() {
constexpr size_t width() const {
return width_;
}
constexpr int pad() {
constexpr int pad() const {
return pad_;
}
constexpr StringFormatAlignmentAttribute attribute() {
constexpr StringFormatAlignmentAttribute attribute() const {
return attribute_;
}

Expand Down
2 changes: 1 addition & 1 deletion lib/grnxx/time.hpp
Expand Up @@ -52,7 +52,7 @@ class Time {
BrokenDownTime local_time() const;

// Return the tick count.
constexpr int64_t count() {
constexpr int64_t count() const {
return count_;
}
// Set the tick count.
Expand Down

0 comments on commit a86855b

Please sign in to comment.