diff options
author | Yuta Doi <yuta-d@witz-inc.co.jp> | 2017-10-27 22:57:49 +0900 |
---|---|---|
committer | Yuta Doi <yuta-d@witz-inc.co.jp> | 2017-11-02 00:45:18 +0000 |
commit | 1d45ed97751d447b451d0f629e0ec2a4358cb9ea (patch) | |
tree | b4a578a32ec0425c9ee7da252b59cdb743992438 /src | |
parent | 120dce3074fe0a6a070be3f759869652d45e237d (diff) |
Replace 'constexpr' with 'const char*'
'constexpr' causes the warning [-Wwrite-strings].
So replace 'constexpr' with 'const char*'.
Change-Id: I03e2c7b53e4db6cb5b804c66cb88ae15e2387eb8
Signed-off-by: Yuta Doi <yuta-d@witz-inc.co.jp>
Diffstat (limited to 'src')
-rw-r--r-- | src/libwindowmanager.cpp | 8 | ||||
-rw-r--r-- | src/libwindowmanager.h | 4 |
2 files changed, 8 insertions, 4 deletions
diff --git a/src/libwindowmanager.cpp b/src/libwindowmanager.cpp index 770d248..84a091f 100644 --- a/src/libwindowmanager.cpp +++ b/src/libwindowmanager.cpp @@ -57,6 +57,10 @@ class LibWindowmanager::Impl { std::string("flushdraw") }; + /* Key for json obejct */ + const char *kKeyDrawingName = "drawing_name"; + const char *kKeyDrawingArea = "drawing_area"; + // This is the LibWindowmanager interface impl int init(int port, char const *token); @@ -229,7 +233,7 @@ int LibWindowmanager::Impl::requestSurface(json_object *object) { TRACE(); const char *tmp_label = json_object_get_string( - json_object_object_get(object, LibWindowmanager::kKeyDrawingName)); + json_object_object_get(object, this->kKeyDrawingName)); // DrawingName in "object" is overwrited in api_call("RequestSurface") // So it is neccesary to copy it. @@ -444,7 +448,7 @@ void LibWindowmanager::Impl::event(char const *et, json_object *object) { auto i = this->handlers.find(oet.second); if (i != this->handlers.end()) { const char *label = json_object_get_string( - json_object_object_get(object, LibWindowmanager::kKeyDrawingName)); + json_object_object_get(object, this->kKeyDrawingName)); if (this->labels.find(label) != this->labels.end()) { i->second(object); diff --git a/src/libwindowmanager.h b/src/libwindowmanager.h index 59c5ca5..83dff5f 100644 --- a/src/libwindowmanager.h +++ b/src/libwindowmanager.h @@ -38,8 +38,8 @@ public: const std::string kStrAreaSub = "sub"; /* Key for json obejct */ - constexpr static char *kKeyDrawingName = "drawing_name"; - constexpr static char *kKeyDrawingArea = "drawing_area"; + const char *kKeyDrawingName = "drawing_name"; + const char *kKeyDrawingArea = "drawing_area"; enum EventType { Event_Active = 0, |