Browse Source

Fix warnings

trunk
Shanti Chellaram 4 years ago
parent
commit
b6f2578b54
  1. 2
      c++/Makefile
  2. 2
      c++/problem2.cpp
  3. 2
      c++/problem3.cpp

2
c++/Makefile

@ -1,5 +1,5 @@
aoc-cpp: $(wildcard *.cpp)
g++ -std=c++20 -o aoc-cpp $^
g++ -std=c++20 -Wall -Wextra -o aoc-cpp $^
all: aoc-cpp

2
c++/problem2.cpp

@ -9,7 +9,7 @@ pair<string, string> solve2(istream& input) {
uint64_t part1 = 0, part2 = 0;
for (string line; getline(input, line); ) {
stringstream line_stream(line);
int64_t min_count, max_count;
uint64_t min_count, max_count;
char target;
string password;
line_stream >> min_count;

2
c++/problem3.cpp

@ -28,7 +28,7 @@ pair<string, string> solve3(istream& input) {
uint64_t part1;
for (auto slope : slopes) {
uint64_t total_trees = 0;
for (auto pos = pair(0, 0); pos.second < my_map.size(); ) {
for (auto pos = pair<uint64_t, uint64_t>(0, 0); pos.second < my_map.size(); ) {
total_trees += (int) my_map[pos.second][pos.first] == '#';
pos.first = (pos.first + slope.first) % width;
pos.second += slope.second;

Loading…
Cancel
Save