From 22f5e302beda9b7285a7a410b2bdc445aa5d7000 Mon Sep 17 00:00:00 2001 From: William Woodall Date: Mon, 28 Oct 2013 15:10:38 -0700 Subject: [PATCH] fix warnings about uninitialized class members --- include/serial/serial.h | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/include/serial/serial.h b/include/serial/serial.h index 0a141e0..f64886d 100644 --- a/include/serial/serial.h +++ b/include/serial/serial.h @@ -631,9 +631,7 @@ public: ss << "SerialException " << description << " failed."; e_what_ = ss.str(); } - SerialException (const SerialException& other) { - e_what_ = other.e_what_; - } + SerialException (const SerialException& other) : e_what_(other.e_what_) {} virtual ~SerialException() throw() {} virtual const char* what () const throw () { return e_what_.c_str(); @@ -670,9 +668,7 @@ public: e_what_ = ss.str(); } virtual ~IOException() throw() {} - IOException (const IOException& other) { - e_what_ = other.e_what_; - } + IOException (const IOException& other) : e_what_(other.e_what_), line_(other.line_), errno_(other.errno_) {} int getErrorNumber () { return errno_; } @@ -692,9 +688,7 @@ public: ss << "PortNotOpenedException " << description << " failed."; e_what_ = ss.str(); } - PortNotOpenedException (const PortNotOpenedException& other) { - e_what_ = other.e_what_; - } + PortNotOpenedException (const PortNotOpenedException& other) : e_what_(other.e_what_) {} virtual ~PortNotOpenedException() throw() {} virtual const char* what () const throw () { return e_what_.c_str();