From ef7fa369385fc99be4c861e5b3d444e32c5c101b Mon Sep 17 00:00:00 2001 From: Jyri Sarha Date: Tue, 29 Sep 2015 20:41:19 +0300 Subject: There is no need to convert exception strings to .c_str(). --- libkms++/card.cpp | 6 +++--- libkms++/connector.cpp | 2 +- libkms++/drmobject.cpp | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/libkms++/card.cpp b/libkms++/card.cpp index 7aa8bdb..52a0f7a 100644 --- a/libkms++/card.cpp +++ b/libkms++/card.cpp @@ -26,8 +26,8 @@ Card::Card() int fd = open(card, O_RDWR | O_CLOEXEC); if (fd < 0) - throw invalid_argument((string(strerror(errno)) + - " opening " + card).c_str()); + throw invalid_argument(string(strerror(errno)) + " opening " + + card); m_fd = fd; int r; @@ -222,7 +222,7 @@ std::vector Card::get_connected_pipelines() if (!crtc) throw invalid_argument(string("Connector #") + - to_string(conn->idx()) + + to_string(conn->idx()) + " has no possible crtcs"); outputs.push_back(Pipeline { crtc, conn }); diff --git a/libkms++/connector.cpp b/libkms++/connector.cpp index b045b8b..0731f2b 100644 --- a/libkms++/connector.cpp +++ b/libkms++/connector.cpp @@ -98,7 +98,7 @@ Videomode Connector::get_mode(const char *mode) const if (sMode == c->modes[i].name) return drm_mode_to_video_mode(c->modes[i]); - throw invalid_argument((sMode + ": mode not found").c_str()); + throw invalid_argument(sMode + ": mode not found"); } bool Connector::connected() const diff --git a/libkms++/drmobject.cpp b/libkms++/drmobject.cpp index a79370f..f48153a 100644 --- a/libkms++/drmobject.cpp +++ b/libkms++/drmobject.cpp @@ -64,6 +64,6 @@ uint64_t DrmObject::get_prop_value(const char *name) const return m_prop_values.at(prop->id()); } - throw invalid_argument((string(name) + ": property not found").c_str()); + throw invalid_argument(string(name) + ": property not found"); } } -- cgit v1.2.3