susumu.yata
null+****@clear*****
Thu Jun 20 15:01:18 JST 2013
susumu.yata 2013-06-20 15:01:18 +0900 (Thu, 20 Jun 2013) New Revision: a86855b254199ca207e9dac78100a19cd5610e1f https://github.com/groonga/grnxx/commit/a86855b254199ca207e9dac78100a19cd5610e1f Message: Add const specifiers to suppress warnings. 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]". Modified files: lib/grnxx/alpha/map.hpp lib/grnxx/alpha/map_range.hpp lib/grnxx/duration.hpp lib/grnxx/map.hpp lib/grnxx/map_cursor_query.hpp lib/grnxx/mutex.hpp lib/grnxx/string_format.hpp lib/grnxx/time.hpp Modified: lib/grnxx/alpha/map.hpp (+1 -1) =================================================================== --- lib/grnxx/alpha/map.hpp 2013-06-18 19:09:30 +0900 (656d87b) +++ lib/grnxx/alpha/map.hpp 2013-06-20 15:01:18 +0900 (d9c5448) @@ -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. Modified: lib/grnxx/alpha/map_range.hpp (+8 -8) =================================================================== --- lib/grnxx/alpha/map_range.hpp 2013-06-18 19:09:30 +0900 (4e6d6b6) +++ lib/grnxx/alpha/map_range.hpp 2013-06-20 15:01:18 +0900 (eec0b27) @@ -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 { @@ -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 { @@ -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 { @@ -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 { @@ -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 { @@ -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 { @@ -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 { @@ -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 { Modified: lib/grnxx/duration.hpp (+1 -1) =================================================================== --- lib/grnxx/duration.hpp 2013-06-18 19:09:30 +0900 (8694891) +++ lib/grnxx/duration.hpp 2013-06-20 15:01:18 +0900 (f5391a1) @@ -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. Modified: lib/grnxx/map.hpp (+1 -1) =================================================================== --- lib/grnxx/map.hpp 2013-06-18 19:09:30 +0900 (3c1637e) +++ lib/grnxx/map.hpp 2013-06-20 15:01:18 +0900 (ec97f4e) @@ -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. Modified: lib/grnxx/map_cursor_query.hpp (+8 -8) =================================================================== --- lib/grnxx/map_cursor_query.hpp 2013-06-18 19:09:30 +0900 (8c11ffc) +++ lib/grnxx/map_cursor_query.hpp 2013-06-20 15:01:18 +0900 (9ebe771) @@ -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 { @@ -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 { @@ -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 { @@ -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 { @@ -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 { @@ -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 { @@ -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 { @@ -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 { Modified: lib/grnxx/mutex.hpp (+1 -1) =================================================================== --- lib/grnxx/mutex.hpp 2013-06-18 19:09:30 +0900 (e26d51c) +++ lib/grnxx/mutex.hpp 2013-06-20 15:01:18 +0900 (f753dff) @@ -69,7 +69,7 @@ class Mutex { return true; } - constexpr bool locked() { + constexpr bool locked() const { return status_ != MUTEX_UNLOCKED; } Modified: lib/grnxx/string_format.hpp (+4 -4) =================================================================== --- lib/grnxx/string_format.hpp 2013-06-18 19:09:30 +0900 (886a7b7) +++ lib/grnxx/string_format.hpp 2013-06-20 15:01:18 +0900 (a1272f0) @@ -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_; } Modified: lib/grnxx/time.hpp (+1 -1) =================================================================== --- lib/grnxx/time.hpp 2013-06-18 19:09:30 +0900 (c7a32c0) +++ lib/grnxx/time.hpp 2013-06-20 15:01:18 +0900 (b0f0fc6) @@ -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. -------------- next part -------------- HTML����������������������������...Download