Ticket #4014: boost_gil_gcc_warning_cleanup.diff

File boost_gil_gcc_warning_cleanup.diff, 18.2 KB (added by Tatu Kilappa <tatu.kilappa@…>, 13 years ago)
  • boost/gil/locator.hpp

     
    309309
    310310private:
    311311    template <typename X> friend class memory_based_2d_locator;
    312     std::ptrdiff_t offset(x_coord_t x, y_coord_t y)        const { return y*row_size() + x*pixel_size(); }
     312    std::ptrdiff_t offset(x_coord_t p_x, y_coord_t p_y)        const { return p_y*row_size() + p_x*pixel_size(); }
    313313    StepIterator _p;
    314314};
    315315
  • boost/gil/virtual_locator.hpp

     
    5353        }
    5454    };
    5555
    56     virtual_2d_locator(const point_t& p=point_t(0,0), const point_t& step=point_t(1,1), const deref_fn_t& d=deref_fn_t()) : _p(p,step,d) {}
     56    virtual_2d_locator(const point_t& p=point_t(0,0), const point_t& p_step=point_t(1,1), const deref_fn_t& d=deref_fn_t()) : _p(p,p_step,d) {}
    5757    template <typename D, bool TR> virtual_2d_locator(const virtual_2d_locator<D,TR>& loc, coord_t y_step)
    5858        : _p(loc.pos(), point_t(loc.step().x,loc.step().y*y_step),     loc.deref_fn()) {}
    5959    template <typename D, bool TR> virtual_2d_locator(const virtual_2d_locator<D,TR>& loc, coord_t x_step, coord_t y_step, bool transpose=false)
  • boost/gil/image_view.hpp

     
    101101    template <typename View> image_view(const View& iv)                                    : _dimensions(iv.dimensions()), _pixels(iv.pixels()) {}
    102102
    103103    template <typename L2> image_view(const point_t& sz            , const L2& loc)        : _dimensions(sz),          _pixels(loc) {}
    104     template <typename L2> image_view(coord_t width, coord_t height, const L2& loc)        : _dimensions(x_coord_t(width),y_coord_t(height)), _pixels(loc) {}
     104    template <typename L2> image_view(coord_t p_width, coord_t p_height, const L2& loc)        : _dimensions(x_coord_t(p_width),y_coord_t(p_height)), _pixels(loc) {}
    105105
    106106    template <typename View> image_view& operator=(const View& iv)  { _pixels=iv.pixels(); _dimensions=iv.dimensions(); return *this; }
    107107    image_view& operator=(const image_view& iv)                     { _pixels=iv.pixels(); _dimensions=iv.dimensions(); return *this; }
  • boost/gil/position_iterator.hpp

     
    5252    typedef typename Deref::argument_type      point_t;
    5353
    5454    position_iterator() {}
    55     position_iterator(const point_t& p, const point_t& step, const Deref& d) : _p(p), _step(step), _d(d) {}
     55    position_iterator(const point_t& p, const point_t& p_step, const Deref& d) : _p(p), _step(p_step), _d(d) {}
    5656
    5757    position_iterator(const position_iterator& p) : _p(p._p), _step(p._step), _d(p._d) {}
    5858    template <typename D> position_iterator(const position_iterator<D,Dim>& p) : _p(p._p), _step(p._step), _d(p._d) {}
  • boost/gil/iterator_from_2d.hpp

     
    7878    x_iterator&     x()                   { return _p.x(); }
    7979
    8080    iterator_from_2d(){}
    81     iterator_from_2d(const Loc2& p, std::ptrdiff_t width, std::ptrdiff_t x=0, std::ptrdiff_t y=0) : _coords(x,y), _width(width), _p(p) {}
     81    iterator_from_2d(const Loc2& p, std::ptrdiff_t p_width, std::ptrdiff_t p_x=0, std::ptrdiff_t p_y=0) : _coords(p_x,p_y), _width(p_width), _p(p) {}
    8282    iterator_from_2d(const iterator_from_2d& pit) : _coords(pit._coords), _width(pit._width), _p(pit._p) {}
    8383    template <typename Loc> iterator_from_2d(const iterator_from_2d<Loc>& pit) : _coords(pit._coords), _width(pit._width), _p(pit._p) {}
    8484
  • boost/gil/pixel_iterator_adaptor.hpp

     
    6262    dereference_iterator_adaptor() {}
    6363    template <typename Iterator1>
    6464    dereference_iterator_adaptor(const dereference_iterator_adaptor<Iterator1,DFn>& dit) : parent_t(dit.base()), _deref_fn(dit._deref_fn) {}
    65     dereference_iterator_adaptor(Iterator it, DFn deref_fn=DFn()) : parent_t(it), _deref_fn(deref_fn) {}
     65    dereference_iterator_adaptor(Iterator it, DFn p_deref_fn=DFn()) : parent_t(it), _deref_fn(p_deref_fn) {}
    6666    template <typename Iterator1, typename DFn1>
    6767    dereference_iterator_adaptor(const dereference_iterator_adaptor<Iterator1,DFn1>& it) : parent_t(it.base()), _deref_fn(it._deref_fn) {}
    6868    /// For some reason operator[] provided by iterator_facade returns a custom class that is convertible to reference
  • boost/gil/channel.hpp

     
    482482    typedef const packed_dynamic_channel_reference<BitField,NumBits,true>  mutable_reference;
    483483    typedef typename parent_t::integer_t                          integer_t;
    484484
    485     packed_dynamic_channel_reference(const void* data_ptr, unsigned first_bit) : parent_t(data_ptr), _first_bit(first_bit) {}
     485    packed_dynamic_channel_reference(const void* data_ptr, unsigned p_first_bit) : parent_t(data_ptr), _first_bit(p_first_bit) {}
    486486    packed_dynamic_channel_reference(const const_reference&   ref) : parent_t(ref._data_ptr), _first_bit(ref._first_bit) {}
    487487    packed_dynamic_channel_reference(const mutable_reference& ref) : parent_t(ref._data_ptr), _first_bit(ref._first_bit) {}
    488488
     
    510510    typedef const packed_dynamic_channel_reference<BitField,NumBits,true>  mutable_reference;
    511511    typedef typename parent_t::integer_t                          integer_t;
    512512
    513     packed_dynamic_channel_reference(void* data_ptr, unsigned first_bit) : parent_t(data_ptr), _first_bit(first_bit) {}
     513    packed_dynamic_channel_reference(void* data_ptr, unsigned p_first_bit) : parent_t(data_ptr), _first_bit(p_first_bit) {}
    514514    packed_dynamic_channel_reference(const packed_dynamic_channel_reference& ref) : parent_t(ref._data_ptr), _first_bit(ref._first_bit) {}
    515515
    516516    const packed_dynamic_channel_reference& operator=(integer_t value) const { assert(value<=parent_t::max_val); set_unsafe(value); return *this; }
  • boost/gil/bit_aligned_pixel_reference.hpp

     
    5454
    5555public:
    5656    bit_range() : _current_byte(NULL), _bit_offset(0) {}
    57     bit_range(byte_t* current_byte, int bit_offset) : _current_byte(current_byte), _bit_offset(bit_offset) { assert(bit_offset>=0 && bit_offset<8); }
     57    bit_range(byte_t* p_current_byte, int p_bit_offset) : _current_byte(p_current_byte), _bit_offset(p_bit_offset) { assert(p_bit_offset>=0 && p_bit_offset<8); }
    5858
    5959    bit_range(const bit_range& br) : _current_byte(br._current_byte), _bit_offset(br._bit_offset) {}
    6060    template <bool M> bit_range(const bit_range<RangeSize,M>& br) : _current_byte(br._current_byte), _bit_offset(br._bit_offset) {}
     
    135135
    136136    bit_aligned_pixel_reference(){}
    137137    bit_aligned_pixel_reference(data_ptr_t data_ptr, int bit_offset)   : _bit_range(data_ptr, bit_offset) {}
    138     explicit bit_aligned_pixel_reference(const bit_range_t& bit_range) : _bit_range(bit_range) {}
     138    explicit bit_aligned_pixel_reference(const bit_range_t& p_bit_range) : _bit_range(p_bit_range) {}
    139139    template <bool IsMutable2> bit_aligned_pixel_reference(const bit_aligned_pixel_reference<BitField,ChannelBitSizes,Layout,IsMutable2>& p) : _bit_range(p._bit_range) {}
    140140
    141141    // Grayscale references can be constructed from the channel reference
  • boost/gil/image.hpp

     
    6868        _memory(0), _align_in_bytes(alignment), _alloc(alloc_in) {}
    6969
    7070    // Create with dimensions and optional initial value and alignment
    71     image(const point_t& dimensions,
     71    image(const point_t& p_dimensions,
    7272          std::size_t alignment=0,
    7373          const Alloc alloc_in = Alloc()) : _memory(0), _align_in_bytes(alignment), _alloc(alloc_in) {
    74         allocate_and_default_construct(dimensions);
     74        allocate_and_default_construct(p_dimensions);
    7575    }
    76     image(x_coord_t width, y_coord_t height,
     76    image(x_coord_t p_width, y_coord_t p_height,
    7777          std::size_t alignment=0,
    7878          const Alloc alloc_in = Alloc()) : _memory(0), _align_in_bytes(alignment), _alloc(alloc_in) {
    79         allocate_and_default_construct(point_t(width,height));
     79        allocate_and_default_construct(point_t(p_width,p_height));
    8080    }
    81     image(const point_t& dimensions,
     81    image(const point_t& p_dimensions,
    8282          const Pixel& p_in,
    8383          std::size_t alignment,
    8484          const Alloc alloc_in = Alloc())  :
    8585        _memory(0), _align_in_bytes(alignment), _alloc(alloc_in) {
    86         allocate_and_fill(dimensions, p_in);
     86        allocate_and_fill(p_dimensions, p_in);
    8787    }
    88     image(x_coord_t width, y_coord_t height,
     88    image(x_coord_t p_width, y_coord_t p_height,
    8989          const Pixel& p_in,
    9090          std::size_t alignment,
    9191          const Alloc alloc_in = Alloc())  :
    9292        _memory(0), _align_in_bytes(alignment), _alloc(alloc_in) {
    93         allocate_and_fill(point_t(width,height),p_in);
     93        allocate_and_fill(point_t(p_width,p_height),p_in);
    9494    }
    9595
    9696    image(const image& img) :
     
    146146            swap(tmp);
    147147        }
    148148    }
    149     void recreate(x_coord_t width, y_coord_t height, std::size_t alignment=0, const Alloc alloc_in = Alloc()) {
    150         recreate(point_t(width,height),alignment,alloc_in);
     149    void recreate(x_coord_t p_width, y_coord_t p_height, std::size_t alignment=0, const Alloc alloc_in = Alloc()) {
     150        recreate(point_t(p_width,p_height),alignment,alloc_in);
    151151    }
    152152    void recreate(const point_t& dims,
    153153                  const Pixel& p_in, std::size_t alignment, const Alloc alloc_in = Alloc()) {
     
    156156            swap(tmp);
    157157        }
    158158    }
    159     void recreate(x_coord_t width, y_coord_t height,
     159    void recreate(x_coord_t p_width, y_coord_t p_height,
    160160                  const Pixel& p_in, std::size_t alignment, const Alloc alloc_in = Alloc()) {
    161         recreate(point_t(width,height),p_in,alignment,alloc_in);
     161        recreate(point_t(p_width,p_height),p_in,alignment,alloc_in);
    162162    }
    163163
    164164    view_t       _view;      // contains pointer to the pixels, the image size and ways to navigate pixels
     
    167167    std::size_t    _align_in_bytes;
    168168    allocator_type _alloc;
    169169
    170     void allocate_and_default_construct(const point_t& dimensions) {
     170    void allocate_and_default_construct(const point_t& p_dimensions) {
    171171        try {
    172             allocate_(dimensions,mpl::bool_<IsPlanar>());
     172            allocate_(p_dimensions,mpl::bool_<IsPlanar>());
    173173            default_construct_pixels(_view);
    174         } catch(...) { deallocate(dimensions); throw; }
     174        } catch(...) { deallocate(p_dimensions); throw; }
    175175    }
    176176
    177     void allocate_and_fill(const point_t& dimensions, const Pixel& p_in) {
     177    void allocate_and_fill(const point_t& p_dimensions, const Pixel& p_in) {
    178178        try {
    179             allocate_(dimensions,mpl::bool_<IsPlanar>());
     179            allocate_(p_dimensions,mpl::bool_<IsPlanar>());
    180180            uninitialized_fill_pixels(_view, p_in);
    181         } catch(...) { deallocate(dimensions); throw; }
     181        } catch(...) { deallocate(p_dimensions); throw; }
    182182    }
    183183
    184184    template <typename View>
    185     void allocate_and_copy(const point_t& dimensions, const View& v) {
     185    void allocate_and_copy(const point_t& p_dimensions, const View& v) {
    186186        try {
    187             allocate_(dimensions,mpl::bool_<IsPlanar>());
     187            allocate_(p_dimensions,mpl::bool_<IsPlanar>());
    188188            uninitialized_copy_pixels(v,_view);
    189         } catch(...) { deallocate(dimensions); throw; }
     189        } catch(...) { deallocate(p_dimensions); throw; }
    190190    }
    191191
    192     void deallocate(const point_t& dimensions) {
    193         if (_memory) _alloc.deallocate(_memory, total_allocated_size_in_bytes(dimensions));
     192    void deallocate(const point_t& p_dimensions) {
     193        if (_memory) _alloc.deallocate(_memory, total_allocated_size_in_bytes(p_dimensions));
    194194    }
    195195
    196     std::size_t total_allocated_size_in_bytes(const point_t& dimensions) const {
    197         std::size_t size_in_units = get_row_size_in_memunits(dimensions.x)*dimensions.y;
     196    std::size_t total_allocated_size_in_bytes(const point_t& p_dimensions) const {
     197        std::size_t size_in_units = get_row_size_in_memunits(p_dimensions.x)*p_dimensions.y;
    198198        if (IsPlanar)
    199199            size_in_units = size_in_units*num_channels<view_t>::value;
    200200
     
    203203            + (_align_in_bytes>0 ? _align_in_bytes-1:0);    // add extra padding in case we need to align the first image pixel
    204204    }
    205205
    206     std::size_t get_row_size_in_memunits(x_coord_t width) const {   // number of units per row
    207         std::size_t size_in_memunits = width*memunit_step(typename view_t::x_iterator());
     206    std::size_t get_row_size_in_memunits(x_coord_t p_width) const {   // number of units per row
     207        std::size_t size_in_memunits = p_width*memunit_step(typename view_t::x_iterator());
    208208        if (_align_in_bytes>0) {
    209209            std::size_t alignment_in_memunits=_align_in_bytes*byte_to_memunit<typename view_t::x_iterator>::value;
    210210            return align(size_in_memunits, alignment_in_memunits);
     
    212212        return size_in_memunits;
    213213    }
    214214   
    215     void allocate_(const point_t& dimensions, mpl::false_) {  // if it throws and _memory!=0 the client must deallocate _memory
    216         _memory=_alloc.allocate(total_allocated_size_in_bytes(dimensions));
     215    void allocate_(const point_t& p_dimensions, mpl::false_) {  // if it throws and _memory!=0 the client must deallocate _memory
     216        _memory=_alloc.allocate(total_allocated_size_in_bytes(p_dimensions));
    217217        unsigned char* tmp=(_align_in_bytes>0) ? (unsigned char*)align((std::size_t)_memory,_align_in_bytes) : _memory;
    218         _view=view_t(dimensions,typename view_t::locator(typename view_t::x_iterator(tmp),get_row_size_in_memunits(dimensions.x)));
     218        _view=view_t(p_dimensions,typename view_t::locator(typename view_t::x_iterator(tmp),get_row_size_in_memunits(p_dimensions.x)));
    219219    }
    220220
    221     void allocate_(const point_t& dimensions, mpl::true_) {   // if it throws and _memory!=0 the client must deallocate _memory
    222         std::size_t row_size=get_row_size_in_memunits(dimensions.x);
    223         std::size_t plane_size=row_size*dimensions.y;
    224         _memory=_alloc.allocate(total_allocated_size_in_bytes(dimensions));
     221    void allocate_(const point_t& p_dimensions, mpl::true_) {   // if it throws and _memory!=0 the client must deallocate _memory
     222        std::size_t row_size=get_row_size_in_memunits(p_dimensions.x);
     223        std::size_t plane_size=row_size*p_dimensions.y;
     224        _memory=_alloc.allocate(total_allocated_size_in_bytes(p_dimensions));
    225225        unsigned char* tmp=(_align_in_bytes>0) ? (unsigned char*)align((std::size_t)_memory,_align_in_bytes) : _memory;
    226226        typename view_t::x_iterator first;
    227227        for (int i=0; i<num_channels<view_t>::value; ++i) {
    228228            dynamic_at_c(first,i) = (typename channel_type<view_t>::type*)tmp;
    229229            memunit_advance(dynamic_at_c(first,i), plane_size*i);
    230230        }
    231         _view=view_t(dimensions, typename view_t::locator(first, row_size));
     231        _view=view_t(p_dimensions, typename view_t::locator(first, row_size));
    232232    }
    233233};
    234234
  • boost/gil/step_iterator.hpp

     
    133133struct memunit_step_fn {
    134134    typedef std::ptrdiff_t difference_type;
    135135
    136     memunit_step_fn(difference_type step=memunit_step(Iterator())) : _step(step) {}
     136    memunit_step_fn(difference_type p_step=memunit_step(Iterator())) : _step(p_step) {}
    137137
    138138    difference_type difference(const Iterator& it1, const Iterator& it2) const { return memunit_distance(it1,it2)/_step; }
    139139    void            advance(Iterator& it, difference_type d)             const { memunit_advance(it,d*_step); }
    140140    difference_type step()                                               const { return _step; }
    141141
    142     void            set_step(std::ptrdiff_t step) { _step=step; }
     142    void            set_step(std::ptrdiff_t p_step) { _step=p_step; }
    143143private:
    144144    GIL_CLASS_REQUIRE(Iterator, boost::gil, MemoryBasedIteratorConcept)
    145145    difference_type _step;
  • boost/gil/extension/io/io_error.hpp

     
    2424
    2525namespace boost { namespace gil {
    2626
     27#if BOOST_WORKAROUND(__GNUC__, >= 3)
     28inline void io_error(const char* descr) __attribute__((noreturn));
     29#endif
    2730inline void io_error(const char* descr) { throw std::ios_base::failure(descr); }
    2831inline void io_error_if(bool expr, const char* descr="") { if (expr) io_error(descr); }
    2932
  • boost/gil/algorithm.hpp

     
    197197        gil_function_requires<PixelLocatorConcept<IL> >();
    198198        gil_function_requires<MutablePixelIteratorConcept<O> >();
    199199        while (n>0) {
    200             typedef typename iterator_from_2d<IL>::difference_type diff_t;
    201             diff_t l=src.width()-src.x_pos();
    202             diff_t numToCopy=(n<l ? n:l);
     200            typedef typename iterator_from_2d<IL>::difference_type iter_diff_t;
     201            iter_diff_t l=src.width()-src.x_pos();
     202            iter_diff_t numToCopy=(n<l ? n:l);
    203203            detail::copy_n(src.x(), numToCopy, dst);
    204204            dst+=numToCopy;
    205205            src+=numToCopy;