[cpp] Add -Wall compiler option to root CMakeLists
+ Resolve all warnings
This commit is contained in:
@@ -15,9 +15,9 @@
|
||||
void BubbleSort(std::vector<int> &array)
|
||||
{
|
||||
// For each value within the set, starting at 0
|
||||
for (int sortedPivot = 0; sortedPivot < array.size(); sortedPivot++) {
|
||||
for (size_t sortedPivot = 0; sortedPivot < array.size(); sortedPivot++) {
|
||||
// Check every other remaining value in the set
|
||||
for (int j = array.size() - 1; j > sortedPivot; j--) {
|
||||
for (size_t j = array.size() - 1; j > sortedPivot; j--) {
|
||||
// Swap if the value at j is less than the value before it
|
||||
if (array[j] < array[j - 1]) {
|
||||
std::swap(array[j], array[j - 1]);
|
||||
|
||||
Reference in New Issue
Block a user