--- - branch: MAIN date: Sat Aug 29 09:30:10 UTC 2020 files: - new: '1.103' old: '1.102' path: src/usr.bin/make/arch.c pathrev: src/usr.bin/make/arch.c@1.103 type: modified - new: '1.104' old: '1.103' path: src/usr.bin/make/cond.c pathrev: src/usr.bin/make/cond.c@1.104 type: modified - new: '1.121' old: '1.120' path: src/usr.bin/make/dir.c pathrev: src/usr.bin/make/dir.c@1.121 type: modified - new: '1.53' old: '1.52' path: src/usr.bin/make/lst.c pathrev: src/usr.bin/make/lst.c@1.53 type: modified - new: '1.54' old: '1.53' path: src/usr.bin/make/lst.h pathrev: src/usr.bin/make/lst.h@1.54 type: modified - new: '1.325' old: '1.324' path: src/usr.bin/make/main.c pathrev: src/usr.bin/make/main.c@1.325 type: modified id: 20200829T093010Z.8f4d50c357aa2e4ad77be530023aa704b980ad01 log: | make(1): start replacing Lst_Find with Lst_FindB Lst_Find is called with a "comparison" function that returns the integer 0 if the desired node is found. This leads to confusion since there are so many different return value conventions for int, such as 0/1 for mimicking false/true, -1/0 as in close(2), and the sign as in strcmp(3). This API is much easier to understand if the "comparison" function is not called a comparison function (since that is too close to strcmp), but a "match" function that just returns a boolean. In Lst_FindFromB, the node argument may be null. This deviates from the other Lst functions, which require Lst and LstNode to generally be non-null. In this case it is useful though to make the calling code simpler. In arch.c, this makes a lot of the previous documentation redundant. In cond.c, the documentation is reduced a little bit since it had already been cleaned up before. It also removes the strange negation from CondFindStrMatch. In dir.c, the documentation collapses as well. In main.c, separating the ReadMakefile function from the callbacks for Lst_FindB allows the former to get back its natural function signature, with proper types and no unused parameters. To catch any accidental mistakes during the migration from Lst_Find to Lst_FindB, the code can be compiled with -DUSE_DOUBLE_BOOLEAN, which will complain about incompatible function pointer types. module: src subject: 'CVS commit: src/usr.bin/make' unixtime: '1598693410' user: rillig