Advent of Code

Check-in [107d9e9f4f]
Login

Check-in [107d9e9f4f]

Overview
Comment:use typedef for pointer too
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 107d9e9f4f28de4d283f9b70004ad2cd64fa3a9c981f83cb473515150e10763d
User & Date: nnz on 2024-12-02 21:05:09
Other Links: manifest | tags
Context
2024-12-02
22:38
avoid return from within switch check-in: d7feb2870d user: nnz tags: trunk
21:05
use typedef for pointer too check-in: 107d9e9f4f user: nnz tags: trunk
21:01
use the typedef check-in: bddfe2d324 user: nnz tags: trunk
Changes

Modified aocdailies.c from [9faf574fa1] to [d36c34688e].

1
2
3
4
5
6
7
8
9
10
11
12
#include <stddef.h>
#include "aocdailies.h"

aocfunc *select(int y, int d) {
    void (*p)(char *, size_t);
    switch (y * 100 + d) {
        default: return NULL;

        #if 0
        case 201501: p = aoc201501; break;
        case 201502: p = aoc201502; break;
        case 201503: p = aoc201503; break;




|







1
2
3
4
5
6
7
8
9
10
11
12
#include <stddef.h>
#include "aocdailies.h"

aocfunc *select(int y, int d) {
    aocfunc *p; // void (*p)(char *, size_t);
    switch (y * 100 + d) {
        default: return NULL;

        #if 0
        case 201501: p = aoc201501; break;
        case 201502: p = aoc201502; break;
        case 201503: p = aoc201503; break;