Miscellaneous patches from users
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@4654 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
f322d33c4c
commit
b416beb9e3
3 changed files with 8 additions and 6 deletions
|
|
@ -204,7 +204,7 @@ namespace std{
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
self->erase(first,end);
|
self->erase(first,end);
|
||||||
if (i+1 <= self->size())
|
if (i+1 <= int(self->size()))
|
||||||
{
|
{
|
||||||
first = self->begin();
|
first = self->begin();
|
||||||
for (int k=0;k<i;k++)
|
for (int k=0;k<i;k++)
|
||||||
|
|
|
||||||
|
|
@ -203,7 +203,7 @@ namespace std{
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
self->erase(first,end);
|
self->erase(first,end);
|
||||||
if (i+1 <= self->size())
|
if (i+1 <= int(self->size()))
|
||||||
{
|
{
|
||||||
first = self->begin();
|
first = self->begin();
|
||||||
for (int k=0;k<i;k++)
|
for (int k=0;k<i;k++)
|
||||||
|
|
|
||||||
|
|
@ -121,7 +121,8 @@ namespace std {
|
||||||
Py_DECREF(o);
|
Py_DECREF(o);
|
||||||
} else {
|
} else {
|
||||||
Py_DECREF(o);
|
Py_DECREF(o);
|
||||||
throw SWIG_DIRECTOR_TYPE_MISMATCH("vector<" #T "> expected");
|
throw SWIG_DIRECTOR_TYPE_MISMATCH(
|
||||||
|
"vector<" #T "> expected");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (SWIG_ConvertPtr($input,(void **) &v,
|
} else if (SWIG_ConvertPtr($input,(void **) &v,
|
||||||
|
|
@ -306,8 +307,9 @@ namespace std {
|
||||||
if (j<0) j = size+j;
|
if (j<0) j = size+j;
|
||||||
if (i<0) i = 0;
|
if (i<0) i = 0;
|
||||||
if (j>size) j = size;
|
if (j>size) j = size;
|
||||||
std::vector<T > tmp(j-i);
|
std::vector<T > tmp;
|
||||||
std::copy(self->begin()+i,self->begin()+j,tmp.begin());
|
tmp.reserve(j-i);
|
||||||
|
tmp.insert(tmp.begin(),self->begin()+i,self->begin()+j);
|
||||||
return tmp;
|
return tmp;
|
||||||
}
|
}
|
||||||
void __setitem__(int i, const T& x) {
|
void __setitem__(int i, const T& x) {
|
||||||
|
|
@ -902,7 +904,7 @@ namespace std {
|
||||||
specialize_std_vector(unsigned short,PyInt_Check,\
|
specialize_std_vector(unsigned short,PyInt_Check,\
|
||||||
PyInt_AsLong,PyInt_FromLong);
|
PyInt_AsLong,PyInt_FromLong);
|
||||||
specialize_std_vector(unsigned long,PyLong_Check,\
|
specialize_std_vector(unsigned long,PyLong_Check,\
|
||||||
PyLong_AsUnsignedLong,PyLong_UnsignedLong);
|
PyLong_AsUnsignedLong,PyLong_FromUnsignedLong);
|
||||||
specialize_std_vector(double,SwigNumber_Check,\
|
specialize_std_vector(double,SwigNumber_Check,\
|
||||||
SwigNumber_AsDouble,PyFloat_FromDouble);
|
SwigNumber_AsDouble,PyFloat_FromDouble);
|
||||||
specialize_std_vector(float,SwigNumber_Check,\
|
specialize_std_vector(float,SwigNumber_Check,\
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue