There is no need to convert exception strings to .c_str().
authorJyri Sarha <jsarha@ti.com>
Tue, 29 Sep 2015 17:41:19 +0000 (20:41 +0300)
committerJyri Sarha <jsarha@ti.com>
Wed, 30 Sep 2015 11:37:07 +0000 (14:37 +0300)
libkms++/card.cpp
libkms++/connector.cpp
libkms++/drmobject.cpp

index 7aa8bdbfe90d3923f78b76ead8d099d55581c0d9..52a0f7a1008aa57368b8dcebe738c7538562c734 100644 (file)
@@ -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<kms::Pipeline> 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 });
index b045b8bdc21284df118bc360de0798724fada686..0731f2be71b15b4b448e62e7d81f4036e88eb3b7 100644 (file)
@@ -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
index a79370ff37d9f4e1e166c57949e546fcb3f3d1c5..f48153adc2089259f8b84721dbe8db7ff185c9dc 100644 (file)
@@ -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");
 }
 }