git-svn-id: svn://db.shs.com.ru/pip@669 12ceb7fc-bf1f-11e4-8940-5bc7170c53b5
This commit is contained in:
@@ -228,7 +228,7 @@ public:
|
||||
alloc(piv_size + 1);
|
||||
if (index < piv_size - 1) {
|
||||
size_t os = piv_size - index - 1;
|
||||
memmove(&(piv_data[index + 1]), &(piv_data[index]), os * sizeof(T));
|
||||
memmove((void*)(&(piv_data[index + 1])), (const void*)(&(piv_data[index])), os * sizeof(T));
|
||||
}
|
||||
//zeroRaw(&(piv_data[index]), 1);
|
||||
elementNew(piv_data + index, v);
|
||||
@@ -239,7 +239,7 @@ public:
|
||||
ssize_t os = piv_size - index;
|
||||
alloc(piv_size + other.piv_size);
|
||||
if (os > 0)
|
||||
memmove(&(piv_data[index + other.piv_size]), &(piv_data[index]), os * sizeof(T));
|
||||
memmove((void*)(&(piv_data[index + other.piv_size])), (const void*)(&(piv_data[index])), os * sizeof(T));
|
||||
newT(piv_data + index, other.piv_data, other.piv_size);
|
||||
return *this;
|
||||
}
|
||||
@@ -252,7 +252,7 @@ public:
|
||||
}
|
||||
size_t os = piv_size - index - count;
|
||||
deleteT(&(piv_data[index]), count);
|
||||
memmove(&(piv_data[index]), &(piv_data[index + count]), os * sizeof(T));
|
||||
memmove((void*)(&(piv_data[index])), (const void*)(&(piv_data[index + count])), os * sizeof(T));
|
||||
piv_size -= count;
|
||||
return *this;
|
||||
}
|
||||
@@ -360,7 +360,7 @@ private:
|
||||
if (as == piv_rsize) return;
|
||||
|
||||
//cout << std::hex << " ![("<<this<<")realloc " << piv_data << " data ... <\n" << endl;
|
||||
T * p_d = (T*)(realloc(piv_data, as*sizeof(T)));
|
||||
T * p_d = (T*)(realloc((void*)(piv_data), as*sizeof(T)));
|
||||
assert(p_d);
|
||||
piv_data = p_d;
|
||||
//zeroRaw(&(piv_data[os]), as - os);
|
||||
@@ -432,7 +432,7 @@ __PIVECTOR_SIMPLE_FUNCTIONS__(float)
|
||||
__PIVECTOR_SIMPLE_FUNCTIONS__(double)
|
||||
__PIVECTOR_SIMPLE_FUNCTIONS__(ldouble)*/
|
||||
#define __PIVECTOR_SIMPLE_TYPE__(T) \
|
||||
template<> inline void PIVector<T>::newT(T * dst, const T * src, size_t s) {memcpy(dst, src, s * sizeof(T));} \
|
||||
template<> inline void PIVector<T>::newT(T * dst, const T * src, size_t s) {memcpy((void*)(dst), (const void*)(src), s * sizeof(T));} \
|
||||
template<> inline void PIVector<T>::deleteT(T * d, size_t sz) {;} \
|
||||
template<> inline void PIVector<T>::elementNew(T * to, const T & from) {(*to) = from;} \
|
||||
template<> inline void PIVector<T>::elementDelete(T & from) {;} \
|
||||
|
||||
Reference in New Issue
Block a user