Index: boost/gil/locator.hpp =================================================================== --- boost/gil/locator.hpp (revision 60623) +++ boost/gil/locator.hpp (working copy) @@ -309,7 +309,7 @@ private: template friend class memory_based_2d_locator; - std::ptrdiff_t offset(x_coord_t x, y_coord_t y) const { return y*row_size() + x*pixel_size(); } + std::ptrdiff_t offset(x_coord_t p_x, y_coord_t p_y) const { return p_y*row_size() + p_x*pixel_size(); } StepIterator _p; }; Index: boost/gil/virtual_locator.hpp =================================================================== --- boost/gil/virtual_locator.hpp (revision 60623) +++ boost/gil/virtual_locator.hpp (working copy) @@ -53,7 +53,7 @@ } }; - 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) {} + 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) {} template virtual_2d_locator(const virtual_2d_locator& loc, coord_t y_step) : _p(loc.pos(), point_t(loc.step().x,loc.step().y*y_step), loc.deref_fn()) {} template virtual_2d_locator(const virtual_2d_locator& loc, coord_t x_step, coord_t y_step, bool transpose=false) Index: boost/gil/image_view.hpp =================================================================== --- boost/gil/image_view.hpp (revision 60623) +++ boost/gil/image_view.hpp (working copy) @@ -101,7 +101,7 @@ template image_view(const View& iv) : _dimensions(iv.dimensions()), _pixels(iv.pixels()) {} template image_view(const point_t& sz , const L2& loc) : _dimensions(sz), _pixels(loc) {} - template image_view(coord_t width, coord_t height, const L2& loc) : _dimensions(x_coord_t(width),y_coord_t(height)), _pixels(loc) {} + template 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) {} template image_view& operator=(const View& iv) { _pixels=iv.pixels(); _dimensions=iv.dimensions(); return *this; } image_view& operator=(const image_view& iv) { _pixels=iv.pixels(); _dimensions=iv.dimensions(); return *this; } Index: boost/gil/position_iterator.hpp =================================================================== --- boost/gil/position_iterator.hpp (revision 60623) +++ boost/gil/position_iterator.hpp (working copy) @@ -52,7 +52,7 @@ typedef typename Deref::argument_type point_t; position_iterator() {} - position_iterator(const point_t& p, const point_t& step, const Deref& d) : _p(p), _step(step), _d(d) {} + position_iterator(const point_t& p, const point_t& p_step, const Deref& d) : _p(p), _step(p_step), _d(d) {} position_iterator(const position_iterator& p) : _p(p._p), _step(p._step), _d(p._d) {} template position_iterator(const position_iterator& p) : _p(p._p), _step(p._step), _d(p._d) {} Index: boost/gil/iterator_from_2d.hpp =================================================================== --- boost/gil/iterator_from_2d.hpp (revision 60623) +++ boost/gil/iterator_from_2d.hpp (working copy) @@ -78,7 +78,7 @@ x_iterator& x() { return _p.x(); } iterator_from_2d(){} - 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) {} + 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) {} iterator_from_2d(const iterator_from_2d& pit) : _coords(pit._coords), _width(pit._width), _p(pit._p) {} template iterator_from_2d(const iterator_from_2d& pit) : _coords(pit._coords), _width(pit._width), _p(pit._p) {} Index: boost/gil/pixel_iterator_adaptor.hpp =================================================================== --- boost/gil/pixel_iterator_adaptor.hpp (revision 60623) +++ boost/gil/pixel_iterator_adaptor.hpp (working copy) @@ -62,7 +62,7 @@ dereference_iterator_adaptor() {} template dereference_iterator_adaptor(const dereference_iterator_adaptor& dit) : parent_t(dit.base()), _deref_fn(dit._deref_fn) {} - dereference_iterator_adaptor(Iterator it, DFn deref_fn=DFn()) : parent_t(it), _deref_fn(deref_fn) {} + dereference_iterator_adaptor(Iterator it, DFn p_deref_fn=DFn()) : parent_t(it), _deref_fn(p_deref_fn) {} template dereference_iterator_adaptor(const dereference_iterator_adaptor& it) : parent_t(it.base()), _deref_fn(it._deref_fn) {} /// For some reason operator[] provided by iterator_facade returns a custom class that is convertible to reference Index: boost/gil/channel.hpp =================================================================== --- boost/gil/channel.hpp (revision 60623) +++ boost/gil/channel.hpp (working copy) @@ -482,7 +482,7 @@ typedef const packed_dynamic_channel_reference mutable_reference; typedef typename parent_t::integer_t integer_t; - packed_dynamic_channel_reference(const void* data_ptr, unsigned first_bit) : parent_t(data_ptr), _first_bit(first_bit) {} + packed_dynamic_channel_reference(const void* data_ptr, unsigned p_first_bit) : parent_t(data_ptr), _first_bit(p_first_bit) {} packed_dynamic_channel_reference(const const_reference& ref) : parent_t(ref._data_ptr), _first_bit(ref._first_bit) {} packed_dynamic_channel_reference(const mutable_reference& ref) : parent_t(ref._data_ptr), _first_bit(ref._first_bit) {} @@ -510,7 +510,7 @@ typedef const packed_dynamic_channel_reference mutable_reference; typedef typename parent_t::integer_t integer_t; - packed_dynamic_channel_reference(void* data_ptr, unsigned first_bit) : parent_t(data_ptr), _first_bit(first_bit) {} + packed_dynamic_channel_reference(void* data_ptr, unsigned p_first_bit) : parent_t(data_ptr), _first_bit(p_first_bit) {} packed_dynamic_channel_reference(const packed_dynamic_channel_reference& ref) : parent_t(ref._data_ptr), _first_bit(ref._first_bit) {} const packed_dynamic_channel_reference& operator=(integer_t value) const { assert(value<=parent_t::max_val); set_unsafe(value); return *this; } Index: boost/gil/bit_aligned_pixel_reference.hpp =================================================================== --- boost/gil/bit_aligned_pixel_reference.hpp (revision 60623) +++ boost/gil/bit_aligned_pixel_reference.hpp (working copy) @@ -54,7 +54,7 @@ public: bit_range() : _current_byte(NULL), _bit_offset(0) {} - bit_range(byte_t* current_byte, int bit_offset) : _current_byte(current_byte), _bit_offset(bit_offset) { assert(bit_offset>=0 && bit_offset<8); } + 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); } bit_range(const bit_range& br) : _current_byte(br._current_byte), _bit_offset(br._bit_offset) {} template bit_range(const bit_range& br) : _current_byte(br._current_byte), _bit_offset(br._bit_offset) {} @@ -135,7 +135,7 @@ bit_aligned_pixel_reference(){} bit_aligned_pixel_reference(data_ptr_t data_ptr, int bit_offset) : _bit_range(data_ptr, bit_offset) {} - explicit bit_aligned_pixel_reference(const bit_range_t& bit_range) : _bit_range(bit_range) {} + explicit bit_aligned_pixel_reference(const bit_range_t& p_bit_range) : _bit_range(p_bit_range) {} template bit_aligned_pixel_reference(const bit_aligned_pixel_reference& p) : _bit_range(p._bit_range) {} // Grayscale references can be constructed from the channel reference Index: boost/gil/image.hpp =================================================================== --- boost/gil/image.hpp (revision 60623) +++ boost/gil/image.hpp (working copy) @@ -68,29 +68,29 @@ _memory(0), _align_in_bytes(alignment), _alloc(alloc_in) {} // Create with dimensions and optional initial value and alignment - image(const point_t& dimensions, + image(const point_t& p_dimensions, std::size_t alignment=0, const Alloc alloc_in = Alloc()) : _memory(0), _align_in_bytes(alignment), _alloc(alloc_in) { - allocate_and_default_construct(dimensions); + allocate_and_default_construct(p_dimensions); } - image(x_coord_t width, y_coord_t height, + image(x_coord_t p_width, y_coord_t p_height, std::size_t alignment=0, const Alloc alloc_in = Alloc()) : _memory(0), _align_in_bytes(alignment), _alloc(alloc_in) { - allocate_and_default_construct(point_t(width,height)); + allocate_and_default_construct(point_t(p_width,p_height)); } - image(const point_t& dimensions, + image(const point_t& p_dimensions, const Pixel& p_in, std::size_t alignment, const Alloc alloc_in = Alloc()) : _memory(0), _align_in_bytes(alignment), _alloc(alloc_in) { - allocate_and_fill(dimensions, p_in); + allocate_and_fill(p_dimensions, p_in); } - image(x_coord_t width, y_coord_t height, + image(x_coord_t p_width, y_coord_t p_height, const Pixel& p_in, std::size_t alignment, const Alloc alloc_in = Alloc()) : _memory(0), _align_in_bytes(alignment), _alloc(alloc_in) { - allocate_and_fill(point_t(width,height),p_in); + allocate_and_fill(point_t(p_width,p_height),p_in); } image(const image& img) : @@ -146,8 +146,8 @@ swap(tmp); } } - void recreate(x_coord_t width, y_coord_t height, std::size_t alignment=0, const Alloc alloc_in = Alloc()) { - recreate(point_t(width,height),alignment,alloc_in); + void recreate(x_coord_t p_width, y_coord_t p_height, std::size_t alignment=0, const Alloc alloc_in = Alloc()) { + recreate(point_t(p_width,p_height),alignment,alloc_in); } void recreate(const point_t& dims, const Pixel& p_in, std::size_t alignment, const Alloc alloc_in = Alloc()) { @@ -156,9 +156,9 @@ swap(tmp); } } - void recreate(x_coord_t width, y_coord_t height, + void recreate(x_coord_t p_width, y_coord_t p_height, const Pixel& p_in, std::size_t alignment, const Alloc alloc_in = Alloc()) { - recreate(point_t(width,height),p_in,alignment,alloc_in); + recreate(point_t(p_width,p_height),p_in,alignment,alloc_in); } view_t _view; // contains pointer to the pixels, the image size and ways to navigate pixels @@ -167,34 +167,34 @@ std::size_t _align_in_bytes; allocator_type _alloc; - void allocate_and_default_construct(const point_t& dimensions) { + void allocate_and_default_construct(const point_t& p_dimensions) { try { - allocate_(dimensions,mpl::bool_()); + allocate_(p_dimensions,mpl::bool_()); default_construct_pixels(_view); - } catch(...) { deallocate(dimensions); throw; } + } catch(...) { deallocate(p_dimensions); throw; } } - void allocate_and_fill(const point_t& dimensions, const Pixel& p_in) { + void allocate_and_fill(const point_t& p_dimensions, const Pixel& p_in) { try { - allocate_(dimensions,mpl::bool_()); + allocate_(p_dimensions,mpl::bool_()); uninitialized_fill_pixels(_view, p_in); - } catch(...) { deallocate(dimensions); throw; } + } catch(...) { deallocate(p_dimensions); throw; } } template - void allocate_and_copy(const point_t& dimensions, const View& v) { + void allocate_and_copy(const point_t& p_dimensions, const View& v) { try { - allocate_(dimensions,mpl::bool_()); + allocate_(p_dimensions,mpl::bool_()); uninitialized_copy_pixels(v,_view); - } catch(...) { deallocate(dimensions); throw; } + } catch(...) { deallocate(p_dimensions); throw; } } - void deallocate(const point_t& dimensions) { - if (_memory) _alloc.deallocate(_memory, total_allocated_size_in_bytes(dimensions)); + void deallocate(const point_t& p_dimensions) { + if (_memory) _alloc.deallocate(_memory, total_allocated_size_in_bytes(p_dimensions)); } - std::size_t total_allocated_size_in_bytes(const point_t& dimensions) const { - std::size_t size_in_units = get_row_size_in_memunits(dimensions.x)*dimensions.y; + std::size_t total_allocated_size_in_bytes(const point_t& p_dimensions) const { + std::size_t size_in_units = get_row_size_in_memunits(p_dimensions.x)*p_dimensions.y; if (IsPlanar) size_in_units = size_in_units*num_channels::value; @@ -203,8 +203,8 @@ + (_align_in_bytes>0 ? _align_in_bytes-1:0); // add extra padding in case we need to align the first image pixel } - std::size_t get_row_size_in_memunits(x_coord_t width) const { // number of units per row - std::size_t size_in_memunits = width*memunit_step(typename view_t::x_iterator()); + std::size_t get_row_size_in_memunits(x_coord_t p_width) const { // number of units per row + std::size_t size_in_memunits = p_width*memunit_step(typename view_t::x_iterator()); if (_align_in_bytes>0) { std::size_t alignment_in_memunits=_align_in_bytes*byte_to_memunit::value; return align(size_in_memunits, alignment_in_memunits); @@ -212,23 +212,23 @@ return size_in_memunits; } - void allocate_(const point_t& dimensions, mpl::false_) { // if it throws and _memory!=0 the client must deallocate _memory - _memory=_alloc.allocate(total_allocated_size_in_bytes(dimensions)); + void allocate_(const point_t& p_dimensions, mpl::false_) { // if it throws and _memory!=0 the client must deallocate _memory + _memory=_alloc.allocate(total_allocated_size_in_bytes(p_dimensions)); unsigned char* tmp=(_align_in_bytes>0) ? (unsigned char*)align((std::size_t)_memory,_align_in_bytes) : _memory; - _view=view_t(dimensions,typename view_t::locator(typename view_t::x_iterator(tmp),get_row_size_in_memunits(dimensions.x))); + _view=view_t(p_dimensions,typename view_t::locator(typename view_t::x_iterator(tmp),get_row_size_in_memunits(p_dimensions.x))); } - void allocate_(const point_t& dimensions, mpl::true_) { // if it throws and _memory!=0 the client must deallocate _memory - std::size_t row_size=get_row_size_in_memunits(dimensions.x); - std::size_t plane_size=row_size*dimensions.y; - _memory=_alloc.allocate(total_allocated_size_in_bytes(dimensions)); + void allocate_(const point_t& p_dimensions, mpl::true_) { // if it throws and _memory!=0 the client must deallocate _memory + std::size_t row_size=get_row_size_in_memunits(p_dimensions.x); + std::size_t plane_size=row_size*p_dimensions.y; + _memory=_alloc.allocate(total_allocated_size_in_bytes(p_dimensions)); unsigned char* tmp=(_align_in_bytes>0) ? (unsigned char*)align((std::size_t)_memory,_align_in_bytes) : _memory; typename view_t::x_iterator first; for (int i=0; i::value; ++i) { dynamic_at_c(first,i) = (typename channel_type::type*)tmp; memunit_advance(dynamic_at_c(first,i), plane_size*i); } - _view=view_t(dimensions, typename view_t::locator(first, row_size)); + _view=view_t(p_dimensions, typename view_t::locator(first, row_size)); } }; Index: boost/gil/step_iterator.hpp =================================================================== --- boost/gil/step_iterator.hpp (revision 60623) +++ boost/gil/step_iterator.hpp (working copy) @@ -133,13 +133,13 @@ struct memunit_step_fn { typedef std::ptrdiff_t difference_type; - memunit_step_fn(difference_type step=memunit_step(Iterator())) : _step(step) {} + memunit_step_fn(difference_type p_step=memunit_step(Iterator())) : _step(p_step) {} difference_type difference(const Iterator& it1, const Iterator& it2) const { return memunit_distance(it1,it2)/_step; } void advance(Iterator& it, difference_type d) const { memunit_advance(it,d*_step); } difference_type step() const { return _step; } - void set_step(std::ptrdiff_t step) { _step=step; } + void set_step(std::ptrdiff_t p_step) { _step=p_step; } private: GIL_CLASS_REQUIRE(Iterator, boost::gil, MemoryBasedIteratorConcept) difference_type _step; Index: boost/gil/extension/io/io_error.hpp =================================================================== --- boost/gil/extension/io/io_error.hpp (revision 60623) +++ boost/gil/extension/io/io_error.hpp (working copy) @@ -24,6 +24,9 @@ namespace boost { namespace gil { +#if BOOST_WORKAROUND(__GNUC__, >= 3) +inline void io_error(const char* descr) __attribute__((noreturn)); +#endif inline void io_error(const char* descr) { throw std::ios_base::failure(descr); } inline void io_error_if(bool expr, const char* descr="") { if (expr) io_error(descr); } Index: boost/gil/algorithm.hpp =================================================================== --- boost/gil/algorithm.hpp (revision 60623) +++ boost/gil/algorithm.hpp (working copy) @@ -197,9 +197,9 @@ gil_function_requires >(); gil_function_requires >(); while (n>0) { - typedef typename iterator_from_2d::difference_type diff_t; - diff_t l=src.width()-src.x_pos(); - diff_t numToCopy=(n::difference_type iter_diff_t; + iter_diff_t l=src.width()-src.x_pos(); + iter_diff_t numToCopy=(n