card: use string for get_prop()
authorTomi Valkeinen <tomi.valkeinen@iki.fi>
Sat, 3 Oct 2015 18:23:44 +0000 (21:23 +0300)
committerTomi Valkeinen <tomi.valkeinen@iki.fi>
Sat, 3 Oct 2015 18:23:44 +0000 (21:23 +0300)
libkms++/card.cpp
libkms++/card.h

index 39a1fb678406b5ff0386e50bbfbcc1e7070a3e13..ae41f1070f59bbddd31a4b29c1b7c3ccfa3c1d89 100644 (file)
@@ -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;
        }
 
index ac0cba4455f09f11d829c41221dba484a7ed8f9e..94e761aadb22ae2bfd4476e252d8395607bbb78f 100644 (file)
@@ -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; }