Overview
Comment: | use unsigned |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA3-256: |
fe9956e07dbde87a2e41be64478d0781 |
User & Date: | nnz on 2024-12-04 09:27:39 |
Other Links: | manifest | tags |
Context
2024-12-04
| ||
09:30 | _XOPEN_SOURCE removed check-in: 38646cdd7a user: nnz tags: trunk | |
09:27 | use unsigned check-in: fe9956e07d user: nnz tags: trunk | |
08:56 | reworked warning options and C standard check-in: 7965556304 user: nnz tags: trunk | |
Changes
Modified aoc.c from [c6fa85498d] to [fb51c0a099].
1 2 3 4 5 6 7 8 9 10 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 | - + - + - + - + | #include <stdio.h> #include <stdlib.h> #include <string.h> #include "aocutils.h" #include "aocdailies.h" // prototypes for all aocYYYYdd functions! #define MAX_YEAR 2024 int main(int argc, char **argv) { |
︙ |
Modified aoc2024.c from [57ed145cda] to [f495d3d009].
1 2 3 4 5 6 7 8 9 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | + + - + | #include <ctype.h> #include <stdbool.h> #include <stddef.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include "aocutils.h" void aoc202403(char *data, size_t len) { (void)len; // unused argument |
︙ | |||
25 26 27 28 29 30 31 | 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 | - + - + - - + + - + - - - + + + - + - + - + - - - - - - - - + + + + + + + + - + - - + + - + - - + + + + + + - + | while (dontrite && (mul > dontrite)) { dontleft = dontrite; dontrite = strstr(dontrite + 1, "don't()"); } rest = mul + 4; if (isdigit((unsigned char)rest[0])) { char *err; |
︙ | |||
136 137 138 139 140 141 142 | 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 | - - + + - + | for (size_t k = 0; k < n1; k++) { #if 1 // use the fact lists are sorted: complexity: O(n log n) unsigned leftcount = 1; // number of equal values in list1 while ((k + leftcount < n1) && (list1[k] == list1[k + leftcount])) leftcount++; // find list1 k'ths value in list2 unsigned *p = bsearch(list1 + k, list2, n2, sizeof *list2, delta); if (p) { |
︙ |
Modified aocdailies.c from [ffaafe2cdb] to [b62593c7a5].
1 2 3 | 1 2 3 4 5 6 7 8 9 10 11 | - + | #include <stddef.h> #include "aocdailies.h" |
︙ |
Modified aocdailies.h from [769a4a36e5] to [9b2b79b159].
1 2 3 4 5 6 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 | - + | #ifndef AOCDAILIES_H_INCLUDED #define AOCDAILIES_H_INCLUDED #include <stddef.h> typedef void aocfunc(char *, size_t); |
︙ |
Modified aocutils.c from [4e3d9f66a2] to [dc2d5534c7].
1 2 3 4 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 | - - - + + + - + + - + - + - + | #include <stdio.h> #include <stdlib.h> #include "aocutils.h" |
︙ | |||
37 38 39 40 41 42 43 | 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 | + - + - - + + - - + - - - + - - - + + - - - - - - - - - - - + - - - - - - - - - - - - - - - - - - - - - | int ch; char *tmp = malloc(512); size_t s = 512; size_t r = 0; while ((ch = fgetc(h)) != EOF) { if (r == s) { //grow tmp // 13/8 is within 0.5% of the golden ratio |
Modified aocutils.h from [c366e35210] to [b9fb3ba61b].
1 2 3 | 1 2 3 4 5 6 7 8 9 10 | - + - + - - - + + - - | #ifndef AOCUTILS_H_INCLUDED #define AOCUTILS_H_INCLUDED |