Hello Richard ! It's hard to come up with names but as it is on https://www.sqlite.org/src/info/1541607d458069f5 I think that's a good improvement to make the code easier to follow and DRY.
This approach has at least 2 benefits: 1- Is easy to see what parts of the code depend on PTRMAP_OVERFLOW1 value (by reading the code or searching) 2- If for some reason a change on the "struct CellInfo" is made that need a different value for PTRMAP_OVERFLOW1, only one place need to be changed. ? Also the macro OvflOffset(X) probably could be defined using the PTRMAP_OVERFLOW1. #define PTRMAP_OVERFLOW1 4 #define OvflOffset(X) ((X)->nSize-PTRMAP_OVERFLOW1) Cheers ! > Wed Dec 30 2015 9:51:52 pm CET CET from "Richard Hipp" <drh at sqlite.org> >Subject: Re: [sqlite] Magic number in sqlite source code > > On 12/30/15, Richard Hipp <drh at sqlite.org> wrote: > > >>I'll continue look for an alternative way to make the intent of the >> code clearer. >> >> > See https://www.sqlite.org/src/info/1541607d458069f5 for another > attempt at removing magic numbers. But I don't like it. It seems to > complicate more than it clarifies. My current thinking is that the > code should remain as it is on trunk..... > -- > D. Richard Hipp > drh at sqlite.org > _______________________________________________ > sqlite-users mailing list > sqlite-users at mailinglists.sqlite.org > http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users > > ?