Commit 2d05db6f authored by Alexander Alekhin's avatar Alexander Alekhin

Merge pull request #8576 from terfendail:ovx_fixwrappers

parents 1c728258 d873fe66
...@@ -2508,10 +2508,10 @@ public: ...@@ -2508,10 +2508,10 @@ public:
{ {
if (!areTypesCompatible(TypeToEnum<T>::value, dataType())) if (!areTypesCompatible(TypeToEnum<T>::value, dataType()))
throw WrapperError(std::string(__func__) + "(): destination type is wrong"); throw WrapperError(std::string(__func__) + "(): destination type is wrong");
if (data.size() != size()) if (data.size()*sizeof(T) != size())
{ {
if (data.size() == 0) if (data.size() == 0)
data.resize(size()); data.resize(size()/sizeof(T));
else else
throw WrapperError(std::string(__func__) + "(): destination size is wrong"); throw WrapperError(std::string(__func__) + "(): destination size is wrong");
} }
...@@ -2522,7 +2522,7 @@ public: ...@@ -2522,7 +2522,7 @@ public:
{ {
if (!areTypesCompatible(TypeToEnum<T>::value, dataType())) if (!areTypesCompatible(TypeToEnum<T>::value, dataType()))
throw WrapperError(std::string(__func__) + "(): source type is wrong"); throw WrapperError(std::string(__func__) + "(): source type is wrong");
if (data.size() != size()) throw WrapperError(std::string(__func__) + "(): source size is wrong"); if (data.size()*sizeof(T) != size()) throw WrapperError(std::string(__func__) + "(): source size is wrong");
copyFrom(&data[0]); copyFrom(&data[0]);
} }
...@@ -2670,10 +2670,10 @@ public: ...@@ -2670,10 +2670,10 @@ public:
{ {
if (!areTypesCompatible(TypeToEnum<T>::value, dataType())) if (!areTypesCompatible(TypeToEnum<T>::value, dataType()))
throw WrapperError(std::string(__func__) + "(): destination type is wrong"); throw WrapperError(std::string(__func__) + "(): destination type is wrong");
if (data.size() != size()) if (data.size()*sizeof(T) != size())
{ {
if (data.size() == 0) if (data.size() == 0)
data.resize(size()); data.resize(size()/sizeof(T));
else else
throw WrapperError(std::string(__func__) + "(): destination size is wrong"); throw WrapperError(std::string(__func__) + "(): destination size is wrong");
} }
...@@ -2684,7 +2684,7 @@ public: ...@@ -2684,7 +2684,7 @@ public:
{ {
if (!areTypesCompatible(TypeToEnum<T>::value, dataType())) if (!areTypesCompatible(TypeToEnum<T>::value, dataType()))
throw WrapperError(std::string(__func__) + "(): source type is wrong"); throw WrapperError(std::string(__func__) + "(): source type is wrong");
if (data.size() != size()) throw WrapperError(std::string(__func__) + "(): source size is wrong"); if (data.size()*sizeof(T) != size()) throw WrapperError(std::string(__func__) + "(): source size is wrong");
copyFrom(&data[0]); copyFrom(&data[0]);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment