Fix integration of XS containers

This commit is contained in:
Alessandro Ranellucci 2013-07-16 17:13:01 +02:00
parent 9b582a11ff
commit 9458c7db97
34 changed files with 279 additions and 152 deletions

View file

@ -72,8 +72,8 @@ void
Point::from_SV(SV* point_sv)
{
AV* point_av = (AV*)SvRV(point_sv);
this->x = (unsigned long)SvIV(*av_fetch(point_av, 0, 0));
this->y = (unsigned long)SvIV(*av_fetch(point_av, 1, 0));
this->x = (long)SvIV(*av_fetch(point_av, 0, 0));
this->y = (long)SvIV(*av_fetch(point_av, 1, 0));
}
void

View file

@ -40,7 +40,7 @@ Polygon::split_at_index(int index)
for (int i = index; i < this->points.size(); i++) {
poly->points.push_back( this->points[i] );
}
for (int i = 0; i < index; i++) {
for (int i = 0; i <= index; i++) {
poly->points.push_back( this->points[i] );
}
return poly;