diff options
author | Tomi Valkeinen <tomi.valkeinen@iki.fi> | 2015-10-03 21:23:44 +0300 |
---|---|---|
committer | Tomi Valkeinen <tomi.valkeinen@iki.fi> | 2015-10-03 21:23:44 +0300 |
commit | 53220741423db98d89dd99e7443f5f7108ef2505 (patch) | |
tree | e7f370b9c465981311ed2504ffe4e6b85ae98bea | |
parent | d0effe834f1600f233a772520c4eb3339f49571f (diff) |
card: use string for get_prop()
-rw-r--r-- | libkms++/card.cpp | 4 | ||||
-rw-r--r-- | libkms++/card.h | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/libkms++/card.cpp b/libkms++/card.cpp index 39a1fb6..ae41f10 100644 --- a/libkms++/card.cpp +++ b/libkms++/card.cpp @@ -140,14 +140,14 @@ void Card::print_short() const print_obs<Plane>(m_obmap); } -Property* Card::get_prop(const char *name) const +Property* Card::get_prop(const string& name) const { for (auto pair : m_obmap) { auto prop = dynamic_cast<Property*>(pair.second); if (!prop) continue; - if (strcmp(name, prop->name()) == 0) + if (name == prop->name()) return prop; } diff --git a/libkms++/card.h b/libkms++/card.h index ac0cba4..94e761a 100644 --- a/libkms++/card.h +++ b/libkms++/card.h @@ -27,7 +27,7 @@ public: Crtc* get_crtc_by_index(uint32_t idx) const; Encoder* get_encoder(uint32_t id) const; Property* get_prop(uint32_t id) const; - Property* get_prop(const char *name) const; + Property* get_prop(const std::string& name) const; bool master() const { return m_master; } bool has_atomic() const { return m_has_atomic; } |