From 31d4f2632f23021fa4c27edf6855bc06cd4fb417 Mon Sep 17 00:00:00 2001 From: Christoffer Lerno Date: Mon, 20 Mar 2023 22:49:19 +0100 Subject: [PATCH] Prefer typedef --- day12.c3 | 2 +- day13.c3 | 6 +++--- day14.c3 | 2 +- day15.c3 | 2 +- day16.c3 | 4 ++-- day17.c3 | 4 ++-- day19.c3 | 2 +- day20.c3 | 2 +- day21.c3 | 6 +++--- day23.c3 | 2 +- day24.c3 | 2 +- day3.c3 | 2 +- day5.c3 | 2 +- day7.c3 | 2 +- day8.c3 | 2 +- 15 files changed, 21 insertions(+), 21 deletions(-) diff --git a/day12.c3 b/day12.c3 index 2a5954f..03807a1 100644 --- a/day12.c3 +++ b/day12.c3 @@ -3,7 +3,7 @@ import std::io; import std::math; import std::collections::list; -define MapList = List; +typedef MapList = List; struct Map { diff --git a/day13.c3 b/day13.c3 index db87874..f0a09c8 100644 --- a/day13.c3 +++ b/day13.c3 @@ -9,11 +9,11 @@ struct PacketPair Packet* p2; } -define PacketList = List; +typedef PacketList = List; -define Packet = List; +typedef Packet = List; -define PacketPairs = List; +typedef PacketPairs = List; struct PacketElement { diff --git a/day14.c3 b/day14.c3 index 447e9fc..66bf514 100644 --- a/day14.c3 +++ b/day14.c3 @@ -3,7 +3,7 @@ import std::io; import std::math; const ENV_SIDE = 1000; -define Environment = int[ENV_SIDE][ENV_SIDE]; +typedef Environment = int[ENV_SIDE][ENV_SIDE]; enum Result { diff --git a/day15.c3 b/day15.c3 index fab9d56..810ca4e 100644 --- a/day15.c3 +++ b/day15.c3 @@ -4,7 +4,7 @@ import std::math; import std::collections::list; import std::collections::priorityqueue; -define CoordPairList = List][2]>; +typedef CoordPairList = List][2]>; fn int[<2>]! parse_coord(String s) { diff --git a/day16.c3 b/day16.c3 index 3c4d07e..22d1698 100644 --- a/day16.c3 +++ b/day16.c3 @@ -4,8 +4,8 @@ import std::math; import std::collections::map; import std::collections::list; -define ValveMap = HashMap; -define IntPairList = List]>; +typedef ValveMap = HashMap; +typedef IntPairList = List]>; ValveMap v; struct Valve diff --git a/day17.c3 b/day17.c3 index 150eb6d..71a389e 100644 --- a/day17.c3 +++ b/day17.c3 @@ -4,7 +4,7 @@ import std::math; import std::collections::map; import std::collections::list; -define StateCacheMap = HashMap; +typedef StateCacheMap = HashMap; struct StateCache { @@ -85,7 +85,7 @@ Shape[5] shapes = { } }; -define GameRow = distinct char; +typedef GameRow = distinct char; GameRow[1000] game; macro bool GameRow.is_full(GameRow row) diff --git a/day19.c3 b/day19.c3 index 8c00e75..bd70fd1 100644 --- a/day19.c3 +++ b/day19.c3 @@ -4,7 +4,7 @@ import std::math; import std::collections::map; import std::collections::list; -define BlueprintList = List; +typedef BlueprintList = List; const usz ORE = 0; const usz CLAY = 1; diff --git a/day20.c3 b/day20.c3 index 8432b89..ff83a1a 100644 --- a/day20.c3 +++ b/day20.c3 @@ -4,7 +4,7 @@ import std::math; import std::collections::map; import std::collections::list; -define LongList = List; +typedef LongList = List; fn void load_crypto(LongList* list, LongList* pos, long key) { diff --git a/day21.c3 b/day21.c3 index 389ea8b..0f11b21 100644 --- a/day21.c3 +++ b/day21.c3 @@ -4,8 +4,8 @@ import std::math; import std::collections::map; import std::collections::list; -define MonkeyList = List; -define NameMap = HashMap; +typedef MonkeyList = List; +typedef NameMap = HashMap; enum Action { @@ -16,7 +16,7 @@ enum Action MINUS, } -define MonkeyId = distinct int; +typedef MonkeyId = distinct int; struct Monkey { diff --git a/day23.c3 b/day23.c3 index 3b21fea..5789678 100644 --- a/day23.c3 +++ b/day23.c3 @@ -3,7 +3,7 @@ import std::io; import std::math; import std::collections::list; -define CharsArray = List; +typedef CharsArray = List; // Pick a padding that doesn't hit the asserts. const int PADDING = 100; diff --git a/day24.c3 b/day24.c3 index 8c1f1b5..e0dbf9d 100644 --- a/day24.c3 +++ b/day24.c3 @@ -3,7 +3,7 @@ import std::io; import std::math; import std::collections::list; -define CharsArray = List; +typedef CharsArray = List; const int PADDING = 100; diff --git a/day3.c3 b/day3.c3 index 9c29c81..1139c0b 100644 --- a/day3.c3 +++ b/day3.c3 @@ -2,7 +2,7 @@ module day3; import std::io; import std::collections::map; -define CharSet = HashMap; +typedef CharSet = HashMap; fn int evaluate(char c) { diff --git a/day5.c3 b/day5.c3 index 8a7ede0..e0b8ea7 100644 --- a/day5.c3 +++ b/day5.c3 @@ -2,7 +2,7 @@ module day5; import std::io; import std::collections::list; -define CharList = list::List; +typedef CharList = list::List; const MAX_PILES = 20; diff --git a/day7.c3 b/day7.c3 index 8dd558b..17c5e96 100644 --- a/day7.c3 +++ b/day7.c3 @@ -2,7 +2,7 @@ module day7; import std::collections::list; import std::io; -define DirList = List; +typedef DirList = List; struct Directory { diff --git a/day8.c3 b/day8.c3 index 8c4c0f7..77670bb 100644 --- a/day8.c3 +++ b/day8.c3 @@ -2,7 +2,7 @@ module day8; import std::collections::list; import std::io; -define Forest = distinct List; +typedef Forest = distinct List; fn Forest* parse_forest() { File f = file::open("forest.txt", "rb")!!;