Skip to content

Commit

Permalink
fix compilation with old GCC
Browse files Browse the repository at this point in the history
vamas.cpp:156: error: call of overloaded 'abs(int&)' is ambiguous
/usr/lib/gcc/i686-redhat-linux/4.4.7/../../../../include/c++/4.4.7/cmath:94:
note: candidates are: double std::abs(double)
/usr/lib/gcc/i686-redhat-linux/4.4.7/../../../../include/c++/4.4.7/cmath:98:
note:                 float std::abs(float)
/usr/lib/gcc/i686-redhat-linux/4.4.7/../../../../include/c++/4.4.7/cmath:102:
note:                 long double std::abs(long double)
  • Loading branch information
wojdyr committed Dec 17, 2016
1 parent 63d3ffc commit f944b9d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion xylib/vamas.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ void VamasDataSet::load_data(std::istream &f)
all[i] = true;
inclusion_list[i] = (n <= 0);
}
for (int i = 0; i < abs(n); ++i) {
for (int i = 0; i < (n >= 0 ? n : -n); ++i) {
int idx = read_line_int(f) - 1; // "-1" because the input is 1-based
inclusion_list[idx] = !inclusion_list[idx];
}
Expand Down

0 comments on commit f944b9d

Please sign in to comment.