From: Frank Mori Hess Date: Thu, 27 Mar 2008 20:44:15 +0000 (+0000) Subject: Added default constructors to from_physical and to_physical. Added X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=0f6494cfdc30f17add201a51d2d2a368baae7039;p=comedilib.git Added default constructors to from_physical and to_physical. Added missing const qualifier to hardcal_converter and softcal_converter methods. --- diff --git a/c++/include/comedilib.hpp b/c++/include/comedilib.hpp index e567787..b3fb775 100644 --- a/c++/include/comedilib.hpp +++ b/c++/include/comedilib.hpp @@ -22,6 +22,7 @@ #include #include +#include #include #include #include @@ -36,6 +37,10 @@ namespace comedi class to_physical { public: + to_physical() + { + memset(&_polynomial, 0, sizeof(_polynomial)); + } to_physical(const comedi_polynomial_t &polynomial): _polynomial(polynomial) {} @@ -51,6 +56,10 @@ namespace comedi class from_physical { public: + from_physical() + { + memset(&_polynomial, 0, sizeof(_polynomial)); + } from_physical(const comedi_polynomial_t &polynomial): _polynomial(polynomial) {} @@ -383,7 +392,7 @@ namespace comedi return retval; } comedi_polynomial_t hardcal_converter(unsigned channel, unsigned range, - enum comedi_conversion_direction direction) + enum comedi_conversion_direction direction) const { comedi_polynomial_t result; int retval = comedi_get_hardcal_converter(comedi_handle(), index(), @@ -486,7 +495,7 @@ namespace comedi } } comedi_polynomial_t softcal_converter(unsigned channel, unsigned range, - enum comedi_conversion_direction direction, const calibration &cal) + enum comedi_conversion_direction direction, const calibration &cal) const { if(cal.c_calibration() == 0) throw std::invalid_argument(__PRETTY_FUNCTION__); comedi_polynomial_t result;