mesa icon indicating copy to clipboard operation
mesa copied to clipboard

added const secday, which is useful for binary stuff

Open matthiasfabry opened this issue 2 years ago • 4 comments

as the title says.

matthiasfabry avatar Aug 10 '22 18:08 matthiasfabry

On balance, I think this is a sensible change. I expect most people recognise factors like 24*60*60 and 86400 as the number of seconds in a day but using secday is just that little bit clearer and slightly less error prone (e.g. .../24*60*60 instead of .../(24*60*60)). I'd suggest we wait until early next week to give other devs a chance to respond.

If this is worth changing, you might want to make some substitutions now. Grepping for "\*60\*" or "\*60d0\*" in the source (including test cases) turns up some easy replacements.

warrickball avatar Aug 11 '22 09:08 warrickball

A bit of a tangential thing, but how would people feel about changing secyer to secyear? Guess it would break a bit of external code, but in a pretty trivial way that compilers should be able to suggest how to fix.

orlox avatar Aug 11 '22 16:08 orlox

or even the more obvious second_per_year. neither here nor there, but the secyer naming is from ~2005.

fxt44 avatar Aug 11 '22 17:08 fxt44

Personally, I feel like a "fix" like secyear will just get us into bikeshedding territory, so I'd prefer just to leave it.

(But I fully approve of secday.)

evbauer avatar Aug 11 '22 18:08 evbauer