[Liblas-devel] Re: [otb-developers] small compilation fix
Amit Kulkarni
amitkulz at gmail.com
Mon Jan 17 19:03:50 EST 2011
Hi,
Can somebody please consider this patch for inclusion?
Thanks
---------- Forwarded message ----------
From: Emmanuel Christophe <emmanuel.christophe at gmail.com>
Date: Mon, Jan 17, 2011 at 5:41 PM
Subject: Re: [otb-developers] small compilation fix
To: otb-developers at googlegroups.com
Hi Amit,
Is it a patch that's already in liblas?
On Mon, Jan 17, 2011 at 15:18, Amit Kulkarni <amitkulz at gmail.com> wrote:
> Hi,
>
> The below diff fixes the usage of LIBLAS_SWAP_BYTES_N in
> indexoutput.hpp to be more consistent with other usages in files
> lasindex.hpp and in private_utility.hpp.
>
> This fixes a compilation error on OpenBSD 4.9beta with gcc 4.2.1
>
> lvalue required as unary '&' operand for LIBLAS_SWAP_BYTES_N in indexoutput.hpp
>
> Is it ok to commit?
>
> Thanks,
> amit
>
> diff -r f1903272130b
> Utilities/otbliblas/include/liblas/detail/index/indexoutput.hpp
> --- a/Utilities/otbliblas/include/liblas/detail/index/indexoutput.hpp
> Mon Jan 17 13:49:12 2011 -0800
> +++ b/Utilities/otbliblas/include/liblas/detail/index/indexoutput.hpp
> Mon Jan 17 17:03:25 2011 -0600
> @@ -71,10 +71,10 @@
> };
>
> template <typename T, typename Q>
> -inline void WriteVLRData_n(IndexVLRData& dest, T src, Q& pos)
> +inline void WriteVLRData_n(IndexVLRData& dest, T& src, Q& pos)
> {
> // Fix little-endian
> - LIBLAS_SWAP_BYTES_N(&src, sizeof(T));
> + LIBLAS_SWAP_BYTES_N(src, sizeof(T));
> // error if writing past array end
> if (static_cast<size_t>(pos) + sizeof(T) > dest.size())
> throw
> std::out_of_range("liblas::detail::WriteVLRData_n: array index out of
> range");
> @@ -85,10 +85,10 @@
> }
>
> template <typename T, typename Q>
> -inline void WriteVLRDataNoInc_n(IndexVLRData& dest, T src, Q const& pos)
> +inline void WriteVLRDataNoInc_n(IndexVLRData& dest, T& src, Q const& pos)
> {
> // Fix little-endian
> - LIBLAS_SWAP_BYTES_N(&src, sizeof(T));
> + LIBLAS_SWAP_BYTES_N(src, sizeof(T));
> // error if writing past array end
> if (static_cast<size_t>(pos) + sizeof(T) > dest.size())
> throw
> std::out_of_range("liblas::detail::WriteVLRDataNoInc_n: array index
> out of range");
>
More information about the Liblas-devel
mailing list