[PATCH 2/3] Use const when possible

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



---
 src/mjpeg-fallback.cpp | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/src/mjpeg-fallback.cpp b/src/mjpeg-fallback.cpp
index 1b263f2..ef7a13d 100644
--- a/src/mjpeg-fallback.cpp
+++ b/src/mjpeg-fallback.cpp
@@ -44,7 +44,7 @@ public:
     std::vector<DeviceDisplayInfo> get_device_display_info() const override;
 private:
     MjpegSettings settings;
-    Display *dpy;
+    Display *const dpy;
 
     std::vector<uint8_t> frame;
 
@@ -57,9 +57,8 @@ private:
 }
 
 MjpegFrameCapture::MjpegFrameCapture(const MjpegSettings& settings):
-    settings(settings)
+    settings(settings),dpy(XOpenDisplay(nullptr))
 {
-    dpy = XOpenDisplay(NULL);
     if (!dpy)
         throw std::runtime_error("Unable to initialize X11");
 }
-- 
2.20.1

_______________________________________________
Spice-devel mailing list
Spice-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/spice-devel




[Index of Archives]     [Linux Virtualization]     [Linux Virtualization]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]     [Monitors]