From 53220741423db98d89dd99e7443f5f7108ef2505 Mon Sep 17 00:00:00 2001 From: Tomi Valkeinen Date: Sat, 3 Oct 2015 21:23:44 +0300 Subject: card: use string for get_prop() --- libkms++/card.cpp | 4 ++-- libkms++/card.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'libkms++') 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(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(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; } -- cgit v1.2.3