[cpp] Add -Wall compiler option to root CMakeLists

+ Resolve all warnings
This commit is contained in:
2022-03-31 17:35:47 -04:00
parent a97dfbe34b
commit fc1f247987
12 changed files with 15 additions and 14 deletions

View File

@@ -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]);