diff options
author | 2025-05-19 14:08:11 +0600 | |
---|---|---|
committer | 2025-05-19 14:08:11 +0600 | |
commit | ff1ba1e770b4205c2cc367ff513325e5f22c73e8 (patch) | |
tree | 8bef720b23626dc8945d6da9897020766ec61274 /src/main.c | |
parent | 815eca3e8f367a6fed50be59b10316b5028773aa (diff) | |
download | c-obp-example-ff1ba1e770b4205c2cc367ff513325e5f22c73e8.tar.gz c-obp-example-ff1ba1e770b4205c2cc367ff513325e5f22c73e8.zip |
Code cleanup and reuse
Signed-off-by: Mubashshir <ahmubashshir@gmail.com>
Diffstat (limited to 'src/main.c')
-rw-r--r-- | src/main.c | 12 |
1 files changed, 6 insertions, 6 deletions
@@ -13,19 +13,19 @@ void process(ref(char) line, unsigned idx, team obj) unsigned s; switch(idx) { case 1: - set(team, obj, name, line); + set(obj, name, line); break; case 2: - set(team, obj, institution, line); + set(obj, institution, line); break; case 3: sscanf(line, "%u", &s); - set(team, obj, solved, s); + set(obj, solved, s); break; case 4: // falls through case 5: // falls through case 6: - set(team, obj, member_name, idx - 3, line); + set(obj, member_name, idx - 3, line); break; default: break; @@ -56,8 +56,8 @@ int main() } } - team champion = ask(team, find_champion, NULL, teams, num); - ask(team, printf, champion); + team champion = call(dref(teams), find_champion, teams, num); + call(champion, printf); while(num --) del(team, teams[num]); free(teams); |