[MacPorts] #29196: boost-gil-numeric @1.0 (devel), gil examples which come with the boost package fail to compile
MacPorts
noreply at macports.org
Mon Apr 18 05:11:17 PDT 2011
#29196: boost-gil-numeric @1.0 (devel), gil examples which come with the boost
package fail to compile
--------------------------------+-------------------------------------------
Reporter: macdev@… | Owner: macports-tickets@…
Type: defect | Status: new
Priority: Not set | Milestone:
Component: ports | Version: 1.9.2
Keywords: | Port: boost-gil-numeric
--------------------------------+-------------------------------------------
Dear maintainer of boost-gil-numeric,
the gil examples which come with the boost package failed to compile on my
system. Problems are caused by 2 lines in file
/opt/local/include/boost/gil/extension/numeric/sampler.hpp
The functions iround() and ifloor() are defined to return
point2<std::ptrdiff_t> which is a long int on my system. That causes
problems with related template definitions.
You might want to conference the prototye definitions to be found in
file
/opt/local/include/boost/gil/utilities.hpp
I created a diff:[[BR]]
===========================================================[[BR]]
{{{
--- old_sampler.hpp 2011-04-18 12:58:09.000000000 +0200
+++ new_sampler.hpp 2011-04-18 12:57:08.000000000 +0200
@@ -45,7 +45,7 @@
template <typename DstP, typename SrcView, typename F>
bool sample(nearest_neighbor_sampler, const SrcView& src, const
point2<F>& p, DstP& result) {
- point2<int> center(iround(p));
+ point2<std::ptrdiff_t> center(iround(p));
if (center.x>=0 && center.y>=0 && center.x<src.width() &&
center.y<src.height()) {
result=src(center.x,center.y);
return true;
@@ -101,7 +101,7 @@
template <typename DstP, typename SrcView, typename F>
bool sample(bilinear_sampler, const SrcView& src, const point2<F>& p,
DstP& result) {
typedef typename SrcView::value_type SrcP;
- point2<int> p0(ifloor(p)); // the closest integer coordinate top left
from p
+ point2<std::ptrdiff_t> p0(ifloor(p)); // the closest integer
coordinate top left from p
point2<F> frac(p.x-p0.x, p.y-p0.y);
if (p0.x < 0 || p0.y < 0 || p0.x>=src.width() || p0.y>=src.height())
return false;
}}}
[[BR]]
===========================================================[[BR]]
Best regards, macdev
--
Ticket URL: <https://trac.macports.org/ticket/29196>
MacPorts <http://www.macports.org/>
Ports system for Mac OS
More information about the macports-tickets
mailing list