Use size_t in both path methods, to avoid warning C4267

develop
Japa 2016-10-15 10:17:38 +05:30
parent 2e290f4837
commit 98ab357df0
2 changed files with 6 additions and 6 deletions

@ -1,13 +1,13 @@
unsigned size() const { return x.size(); }
size_t size() const { return x.size(); }
coord2d operator[] (unsigned idx) const {
coord2d operator[] (size_t idx) const {
if (idx >= x.size())
return coord2d();
else
return coord2d(x[idx], y[idx]);
}
void erase(unsigned idx) {
void erase(size_t idx) {
if (idx < x.size()) {
x.erase(x.begin()+idx);
y.erase(y.begin()+idx);

@ -1,5 +1,5 @@
bool empty() const { return x.empty(); }
unsigned size() const { return x.size(); }
size_t size() const { return x.size(); }
void clear() {
x.clear();
@ -7,14 +7,14 @@ void clear() {
z.clear();
}
coord operator[] (unsigned idx) const {
coord operator[] (size_t idx) const {
if (idx >= x.size())
return coord();
else
return coord(x[idx], y[idx], z[idx]);
}
void erase(unsigned idx) {
void erase(size_t idx) {
if (idx < x.size()) {
x.erase(x.begin()+idx);
y.erase(y.begin()+idx);