From 0f6494cfdc30f17add201a51d2d2a368baae7039 Mon Sep 17 00:00:00 2001 From: Frank Mori Hess Date: Thu, 27 Mar 2008 20:44:15 +0000 Subject: [PATCH] Added default constructors to from_physical and to_physical. Added missing const qualifier to hardcal_converter and softcal_converter methods. --- c++/include/comedilib.hpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) 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; -- 2.26.2