diff --git a/deps/agg/include/agg_array.h b/deps/agg/include/agg_array.h index 7c20271b2..80e02c205 100644 --- a/deps/agg/include/agg_array.h +++ b/deps/agg/include/agg_array.h @@ -516,10 +516,11 @@ namespace agg if(m_num_blocks) { T** blk = m_blocks + m_num_blocks - 1; - while(m_num_blocks--) + while(m_num_blocks > 0) { pod_allocator::deallocate(*blk, block_size); --blk; + --m_num_blocks; } } pod_allocator::deallocate(m_blocks, m_max_blocks); diff --git a/deps/agg/include/agg_rasterizer_cells_aa.h b/deps/agg/include/agg_rasterizer_cells_aa.h index 0997feeca..43be00cc9 100755 --- a/deps/agg/include/agg_rasterizer_cells_aa.h +++ b/deps/agg/include/agg_rasterizer_cells_aa.h @@ -131,10 +131,11 @@ namespace agg if(m_num_blocks) { cell_type** ptr = m_cells + m_num_blocks - 1; - while(m_num_blocks--) + while(m_num_blocks > 0) { pod_allocator::deallocate(*ptr, cell_block_size); ptr--; + --m_num_blocks; } pod_allocator::deallocate(m_cells, m_max_blocks); } @@ -663,23 +664,26 @@ namespace agg cell_type* cell_ptr; unsigned nb = m_num_cells >> cell_block_shift; unsigned i; - while(nb--) + while(nb > 0) { cell_ptr = *block_ptr++; i = cell_block_size; - while(i--) + while(i > 0) { m_sorted_y[cell_ptr->y - m_min_y].start++; ++cell_ptr; + --i; } + --nb; } cell_ptr = *block_ptr++; i = m_num_cells & cell_block_mask; - while(i--) + while(i > 0) { m_sorted_y[cell_ptr->y - m_min_y].start++; ++cell_ptr; + --i; } // Convert the Y-histogram into the array of starting indexes @@ -694,27 +698,30 @@ namespace agg // Fill the cell pointer array sorted by Y block_ptr = m_cells; nb = m_num_cells >> cell_block_shift; - while(nb--) + while(nb > 0) { cell_ptr = *block_ptr++; i = cell_block_size; - while(i--) + while(i > 0) { sorted_y& curr_y = m_sorted_y[cell_ptr->y - m_min_y]; m_sorted_cells[curr_y.start + curr_y.num] = cell_ptr; ++curr_y.num; ++cell_ptr; + --i; } + --nb; } cell_ptr = *block_ptr++; i = m_num_cells & cell_block_mask; - while(i--) + while(i > 0) { sorted_y& curr_y = m_sorted_y[cell_ptr->y - m_min_y]; m_sorted_cells[curr_y.start + curr_y.num] = cell_ptr; ++curr_y.num; ++cell_ptr; + --i; } // Finally arrange the X-arrays diff --git a/deps/agg/include/agg_rendering_buffer.h b/deps/agg/include/agg_rendering_buffer.h index e43899ecc..e9e278b90 100644 --- a/deps/agg/include/agg_rendering_buffer.h +++ b/deps/agg/include/agg_rendering_buffer.h @@ -186,10 +186,11 @@ namespace agg T** rows = &m_rows[0]; - while(height--) + while(height > 0) { *rows++ = row_ptr; row_ptr += stride; + --height; } }