Fix compilation with gcc-4.6.0, patch provided by Anton Gladky <gladky.anton@gmail.com>,

working on debian packaging.
This commit is contained in:
Thomas Capricelli 2011-05-05 00:44:24 +02:00
parent 012419166e
commit a18a1be42d
5 changed files with 7 additions and 7 deletions

View File

@ -70,7 +70,7 @@ template<> EIGEN_STRONG_INLINE Packet2cf pset1<Packet2cf>(const std::complex<flo
{ {
Packet2cf res; Packet2cf res;
/* On AltiVec we cannot load 64-bit registers, so wa have to take care of alignment */ /* On AltiVec we cannot load 64-bit registers, so wa have to take care of alignment */
if((ptrdiff_t(&from) % 16) == 0) if((std::ptrdiff_t(&from) % 16) == 0)
res.v = pload<Packet4f>((const float *)&from); res.v = pload<Packet4f>((const float *)&from);
else else
res.v = ploadu<Packet4f>((const float *)&from); res.v = ploadu<Packet4f>((const float *)&from);

View File

@ -296,14 +296,14 @@ template<> EIGEN_STRONG_INLINE Packet4i ploadu<Packet4i>(const int* from)
template<> EIGEN_STRONG_INLINE Packet4f ploaddup<Packet4f>(const float* from) template<> EIGEN_STRONG_INLINE Packet4f ploaddup<Packet4f>(const float* from)
{ {
Packet4f p; Packet4f p;
if((ptrdiff_t(&from) % 16) == 0) p = pload<Packet4f>(from); if((std::ptrdiff_t(&from) % 16) == 0) p = pload<Packet4f>(from);
else p = ploadu<Packet4f>(from); else p = ploadu<Packet4f>(from);
return vec_perm(p, p, p16uc_DUPLICATE); return vec_perm(p, p, p16uc_DUPLICATE);
} }
template<> EIGEN_STRONG_INLINE Packet4i ploaddup<Packet4i>(const int* from) template<> EIGEN_STRONG_INLINE Packet4i ploaddup<Packet4i>(const int* from)
{ {
Packet4i p; Packet4i p;
if((ptrdiff_t(&from) % 16) == 0) p = pload<Packet4i>(from); if((std::ptrdiff_t(&from) % 16) == 0) p = pload<Packet4i>(from);
else p = ploadu<Packet4i>(from); else p = ploadu<Packet4i>(from);
return vec_perm(p, p, p16uc_DUPLICATE); return vec_perm(p, p, p16uc_DUPLICATE);
} }

View File

@ -38,7 +38,7 @@ namespace Eigen {
{ {
public: public:
typedef size_t size_type; typedef size_t size_type;
typedef ptrdiff_t difference_type; typedef std::ptrdiff_t difference_type;
typedef T* pointer; typedef T* pointer;
typedef const T* const_pointer; typedef const T* const_pointer;
typedef T& reference; typedef T& reference;

View File

@ -38,7 +38,7 @@ template<int Alignment,typename VectorType> void map_class_vector(const VectorTy
Scalar* a_array = internal::aligned_new<Scalar>(arraysize+1); Scalar* a_array = internal::aligned_new<Scalar>(arraysize+1);
Scalar* array = a_array; Scalar* array = a_array;
if(Alignment!=Aligned) if(Alignment!=Aligned)
array = (Scalar*)(ptrdiff_t(a_array) + (internal::packet_traits<Scalar>::AlignedOnScalar?sizeof(Scalar):sizeof(typename NumTraits<Scalar>::Real))); array = (Scalar*)(std::ptrdiff_t(a_array) + (internal::packet_traits<Scalar>::AlignedOnScalar?sizeof(Scalar):sizeof(typename NumTraits<Scalar>::Real)));
{ {
Map<VectorType, Alignment, InnerStride<3> > map(array, size); Map<VectorType, Alignment, InnerStride<3> > map(array, size);
@ -77,7 +77,7 @@ template<int Alignment,typename MatrixType> void map_class_matrix(const MatrixTy
Scalar* a_array = internal::aligned_new<Scalar>(arraysize+1); Scalar* a_array = internal::aligned_new<Scalar>(arraysize+1);
Scalar* array = a_array; Scalar* array = a_array;
if(Alignment!=Aligned) if(Alignment!=Aligned)
array = (Scalar*)(ptrdiff_t(a_array) + (internal::packet_traits<Scalar>::AlignedOnScalar?sizeof(Scalar):sizeof(typename NumTraits<Scalar>::Real))); array = (Scalar*)(std::ptrdiff_t(a_array) + (internal::packet_traits<Scalar>::AlignedOnScalar?sizeof(Scalar):sizeof(typename NumTraits<Scalar>::Real)));
// test no inner stride and some dynamic outer stride // test no inner stride and some dynamic outer stride
{ {

View File

@ -393,7 +393,7 @@ class FFT
for (int k=0;k<nx;++k) for (int k=0;k<nx;++k)
*x++ *= s; *x++ *= s;
#else #else
if ( ((ptrdiff_t)x) & 15 ) if ( ((std::ptrdiff_t)x) & 15 )
Matrix<T_Data, Dynamic, 1>::Map(x,nx) *= s; Matrix<T_Data, Dynamic, 1>::Map(x,nx) *= s;
else else
Matrix<T_Data, Dynamic, 1>::MapAligned(x,nx) *= s; Matrix<T_Data, Dynamic, 1>::MapAligned(x,nx) *= s;