Skip to content

Commit

Permalink
Remove unnecessary semicolons for gcc --pedantic mode
Browse files Browse the repository at this point in the history
  • Loading branch information
nigels-com authored and Nigel Stewart committed Jan 10, 2024
1 parent cb7df6b commit 70d02fe
Show file tree
Hide file tree
Showing 14 changed files with 230 additions and 230 deletions.
20 changes: 10 additions & 10 deletions include/boost/sort/block_indirect_sort/blk_detail/backbone.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ struct backbone
block_t get_block (size_t pos) const
{
return block_t (global_range.first + (pos * Block_size));
};
}
//-------------------------------------------------------------------------
// function : get_range
/// @brief obtain the range in the position pos
Expand All @@ -120,15 +120,15 @@ struct backbone
Iter_t it2 =
(pos == (nblock - 1)) ? global_range.last : it1 + Block_size;
return range_it (it1, it2);
};
}
//-------------------------------------------------------------------------
// function : get_range_buf
/// @brief obtain the auxiliary buffer of the thread
//-------------------------------------------------------------------------
range_buf get_range_buf ( ) const
{
return range_buf (buf, buf + Block_size);
};
}

//-------------------------------------------------------------------------
// function : exec
Expand All @@ -144,7 +144,7 @@ struct backbone
{
buf = ptr_buf;
exec (counter);
};
}

void exec (atomic_t &counter);

Expand Down Expand Up @@ -192,7 +192,7 @@ ::backbone (Iter_t first, Iter_t last, Compare comp)
range_tail.first =
(ntail == 0) ? last : (first + ((nblock - 1) * Block_size));
range_tail.last = last;
};
}
//
//-------------------------------------------------------------------------
// function : exec
Expand All @@ -208,12 +208,12 @@ void backbone< Block_size, Iter_t, Compare >::exec (atomic_t &counter)
{
if (works.pop_move_back (func_exec)) func_exec ( );
else std::this_thread::yield ( );
};
};
}
}
//
//****************************************************************************
}; // End namespace blk_detail
}; // End namespace sort
}; // End namespace boost
} // End namespace blk_detail
} // End namespace sort
} // End namespace boost
//****************************************************************************
#endif
28 changes: 14 additions & 14 deletions include/boost/sort/block_indirect_sort/blk_detail/block.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class block_pos

public:
//----------------------------- FUNCTIONS ------------------------------
block_pos (void) : num (0){};
block_pos (void) : num (0){}
//
//-------------------------------------------------------------------------
// function : block_pos
Expand All @@ -55,35 +55,35 @@ class block_pos
block_pos (size_t position, bool side = false)
{
num = (position << 1) + ((side) ? 1 : 0);
};
}
//
//-------------------------------------------------------------------------
// function : pos
/// @brief obtain the position stored inside the block_pos
/// @return position
//-------------------------------------------------------------------------
size_t pos (void) const { return (num >> 1); };
size_t pos (void) const { return (num >> 1); }
//
//-------------------------------------------------------------------------
// function : pos
/// @brief store a position inside the block_pos
/// @param position : value to store
//-------------------------------------------------------------------------
void set_pos (size_t position) { num = (position << 1) + (num & 1); };
void set_pos (size_t position) { num = (position << 1) + (num & 1); }
//
//-------------------------------------------------------------------------
// function : side
/// @brief obtain the side stored inside the block_pos
/// @return bool value
//-------------------------------------------------------------------------
bool side (void) const { return ((num & 1) != 0); };
bool side (void) const { return ((num & 1) != 0); }
//
//-------------------------------------------------------------------------
// function : side
/// @brief store a bool value the block_pos
/// @param sd : bool value to store
//-------------------------------------------------------------------------
void set_side (bool sd) { num = (num & ~1) + ((sd) ? 1 : 0); };
void set_side (bool sd) { num = (num & ~1) + ((sd) ? 1 : 0); }
}; // end struct block_pos

//
Expand All @@ -105,7 +105,7 @@ struct block
/// @brief constructor from an iterator to the first element of the block
/// @param it : iterator to the first element of the block
//-------------------------------------------------------------------------
block (Iter_t it) : first (it){};
block (Iter_t it) : first (it){}

//-------------------------------------------------------------------------
// function : get_range
Expand All @@ -115,7 +115,7 @@ struct block
range< Iter_t > get_range (void)
{
return range_it (first, first + Block_size);
};
}

}; // end struct block

Expand All @@ -133,7 +133,7 @@ bool compare_block (block< Block_size, Iter_t > block1,
Compare cmp = Compare ( ))
{
return cmp (*block1.first, *block2.first);
};
}
//
///---------------------------------------------------------------------------
/// @struct compare_block_pos
Expand All @@ -155,7 +155,7 @@ struct compare_block_pos
/// @param cmp : comparison operator
//-------------------------------------------------------------------------
compare_block_pos (Iter_t g_first, Compare cmp)
: global_first (g_first), comp (cmp){};
: global_first (g_first), comp (cmp){}
//
//-------------------------------------------------------------------------
// function : operator ()
Expand All @@ -168,14 +168,14 @@ struct compare_block_pos
{
return comp (*(global_first + (block_pos1.pos ( ) * Block_size)),
*(global_first + (block_pos2.pos ( ) * Block_size)));
};
}

}; // end struct compare_block_pos

//****************************************************************************
}; // End namespace blk_detail
}; // End namespace sort
}; // End namespace boost
} // End namespace blk_detail
} // End namespace sort
} // End namespace boost
//****************************************************************************
//
#endif
46 changes: 23 additions & 23 deletions include/boost/sort/block_indirect_sort/blk_detail/merge_blocks.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ struct merge_blocks
catch (std::bad_alloc &)
{
error = true;
};
}
}
bscu::atomic_sub (counter, 1);
};
Expand Down Expand Up @@ -143,7 +143,7 @@ struct merge_blocks
catch (std::bad_alloc &)
{
error = true;
};
}
}
bscu::atomic_sub (counter, 1);
};
Expand Down Expand Up @@ -195,12 +195,12 @@ ::merge_blocks( backbone_t &bkb, size_t pos_index1, size_t pos_index2,
for (size_t i = pos_index1; i < pos_index2; ++i)
{
vpos1.emplace_back(bk.index[i].pos(), true);
};
}

for (size_t i = pos_index2; i < pos_index3; ++i)
{
vpos2.emplace_back(bk.index[i].pos(), false);
};
}
//-------------------------------------------------------------------
// tail process
//-------------------------------------------------------------------
Expand All @@ -210,7 +210,7 @@ ::merge_blocks( backbone_t &bkb, size_t pos_index1, size_t pos_index2,
tail_process(vpos1, vpos2);
nblock1 = vpos1.size();
nblock2 = vpos2.size();
};
}

compare_block_pos_t cmp_blk(bk.global_range.first, bk.cmp);
if (bk.error) return;
Expand Down Expand Up @@ -256,9 +256,9 @@ ::tail_process( std::vector<block_pos> &vblkpos1,
{
vblkpos2.emplace_back(posback1, false);
vblkpos1.pop_back();
};
};
};
}
}
}
}

//
Expand All @@ -278,7 +278,7 @@ ::cut_range(range_pos rng_input)
{
merge_range_pos(rng_input);
return;
};
}

atomic_t counter(0);
size_t npart = (rng_input.size() + Group_size - 1) / Group_size;
Expand All @@ -294,7 +294,7 @@ ::cut_range(range_pos rng_input)
and bk.index[pos - 1].side() == bk.index[pos].side())
{
++pos;
};
}
if (pos < pos_last)
{
merge_uncontiguous(bk.get_range(bk.index[pos - 1].pos()),
Expand All @@ -306,9 +306,9 @@ ::cut_range(range_pos rng_input)
{
range_pos rng_aux(pos_ini, pos);
function_merge_range_pos(rng_aux, counter, bk.error);
};
}
pos_ini = pos;
};
}
bk.exec(counter); // wait until finish all the ranges
}

Expand Down Expand Up @@ -337,7 +337,7 @@ ::merge_range_pos(range_pos rng_input)
bsc::merge_flow(rng_prev, rbuf, rng_posx, bk.cmp);
rng_prev = rng_posx;

};
}
move_forward(rng_posx, rbuf);
}
//
Expand Down Expand Up @@ -384,7 +384,7 @@ ::extract_ranges(range_pos range_input)
side_posx = bp_posx.side();
mergeable = (side_max != side_posx
and is_mergeable(rng_max, rng_posx, bk.cmp));
};
}
if (bk.error) return;
if (final or not mergeable)
{
Expand All @@ -398,31 +398,31 @@ ::extract_ranges(range_pos range_input)
else
{
function_merge_range_pos(rp_final, counter, bk.error);
};
};
}
}
posx_ini = posx;
if (not final)
{
rng_max = rng_posx;
side_max = side_posx;
};
}
}
else
{
if (bk.cmp(*(rng_max.back()), *(rng_posx.back())))
{
rng_max = rng_posx;
side_max = side_posx;
};
};
};
}
}
}
bk.exec(counter);
}
//
//****************************************************************************
}; // End namespace blk_detail
}; // End namespace sort
}; // End namespace boost
} // End namespace blk_detail
} // End namespace sort
} // End namespace boost
//****************************************************************************
//
#endif
26 changes: 13 additions & 13 deletions include/boost/sort/block_indirect_sort/blk_detail/move_blocks.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ struct move_blocks
catch (std::bad_alloc &)
{
error = true;
};
}
}
bscu::atomic_sub (counter, 1);
};
Expand Down Expand Up @@ -130,13 +130,13 @@ struct move_blocks
catch (std::bad_alloc &)
{
error = true;
};
}
}
bscu::atomic_sub (counter, 1);
};
bk.works.emplace_back(f1);
}
;

//---------------------------------------------------------------------------
}; // end of struct move_blocks
//---------------------------------------------------------------------------
Expand Down Expand Up @@ -172,7 +172,7 @@ ::move_blocks(backbone_t &bkb) : bk(bkb)
and bk.index[pos_index_ini].pos() == pos_index_ini)
{
++pos_index_ini;
};
}

if (pos_index_ini == bk.index.size()) break;

Expand All @@ -187,7 +187,7 @@ ::move_blocks(backbone_t &bkb) : bk(bkb)

bk.index[pos_index_dest].set_pos(pos_index_dest);
pos_index_dest = pos_index_src;
};
}

bk.index[pos_index_dest].set_pos(pos_index_dest);
vsequence.push_back(sequence);
Expand All @@ -199,8 +199,8 @@ ::move_blocks(backbone_t &bkb) : bk(bkb)
else
{
function_move_long_sequence(vsequence.back(), counter, bk.error);
};
};
}
}
bk.exec(counter);
}
;
Expand Down Expand Up @@ -228,9 +228,9 @@ ::move_sequence(const std::vector<size_t> &init_sequence)
range_it range1(range2);
range2 = bk.get_range(pos_range2);
move_forward(range1, range2);
};
}
move_forward(range2, rbuf);
};
}
//
//-------------------------------------------------------------------------
// function : move_long_sequence
Expand Down Expand Up @@ -264,7 +264,7 @@ ::move_long_sequence(const std::vector<size_t> &init_sequence)
sequence.assign(it_pos, it_pos + size_part);
index_seq.emplace_back(*(it_pos + size_part - 1));
function_move_sequence(sequence, son_counter, bk.error);
};
}

sequence.assign(it_pos, init_sequence.end());
index_seq.emplace_back(init_sequence.back());
Expand All @@ -277,9 +277,9 @@ ::move_long_sequence(const std::vector<size_t> &init_sequence)

//
//****************************************************************************
}; // End namespace blk_detail
}; // End namespace sort
}; // End namespace boost
} // End namespace blk_detail
} // End namespace sort
} // End namespace boost
//****************************************************************************
//
#endif
Loading

0 comments on commit 70d02fe

Please sign in to comment.