On 05.11.2019 19:54, Don Lewis wrote:
> I don't understand what this strange little bit of code (line 611 of
> basebmp/inc/basebmp/packedpixeliterator.hxx) is supposed to do:
>
>     value_type get(difference_type const & d) const
>     {
>         const int remainder( x(d.x) % num_intraword_positions );
>                              ^^^^^^
>         return (unsigned_cast<value_type>(*current(d.x,d.y) &
>                                           get_mask<value_type, 
> bits_per_pixel, MsbFirst>(remainder))
>                 >> get_shift<num_intraword_positions, bits_per_pixel, 
> MsbFirst>(remainder));
>     }
>
> I've never seen any compiler complaints about it before, but gcc 9
> throws an error:
>
> ../inc/basebmp/packedpixeliterator.hxx: In member function 
> 'basebmp::PackedPixel
> Iterator<Valuetype, bits_per_pixel, MsbFirst>::value_type 
> basebmp::PackedPixelIt
> erator<Valuetype, bits_per_pixel, MsbFirst>::get(const difference_type&) 
> const':
> ../inc/basebmp/packedpixeliterator.hxx:611:35: error: expression cannot be 
> used
> as a function
>   611 |         const int remainder( x(d.x) % num_intraword_positions );
>       |                                   ^


Gcc 9 is right, 'x' is a MoveX which is an integer as far as I can see.
I have no idea what this means either, or how it can be valid code.
Unless there's some really heavy macro magic going on behind the scenes,
but that doesn't make much sense given the rest of the code in that class.

-- Brane

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to