[systemd-devel] [PATCH 1/7] calendar: add constant values

Lennart Poettering lennart at poettering.net
Mon Oct 27 05:37:55 PDT 2014


On Mon, 27.10.14 08:42, Daniele Medri (dmedri at gmail.com) wrote:

>  src/shared/calendarspec.c | 22 +++++++++++++++-------
>  1 file changed, 15 insertions(+), 7 deletions(-)
> 
> diff --git a/src/shared/calendarspec.c b/src/shared/calendarspec.c
> index 64d0dec..73f87c6 100644
> --- a/src/shared/calendarspec.c
> +++ b/src/shared/calendarspec.c
> @@ -24,6 +24,12 @@
>  
>  #include "calendarspec.h"
>  
> +#define CENTURY_ONE 1900
> +#define CENTURY_TWO 2000
> +#define CENTURY_GAP 70

Hmm, Idon't think these defines above are really useful. Years are
counted up in numbers, and there's really no reason to introduce new
#defines for them. It's a ton more readable if we actually mentioned
the years the same way as they are usually referred to: by their year
name.

> +#define BITS_WEEKDAYS	127

I figure this makes sense to introduce.

> +#define BITS_MONTHS	127

Hmm? There aren't only 7 months in the year, there are twelve! 

The patch doesn#t appear to make use of the latter two macros though?

Lennart

-- 
Lennart Poettering, Red Hat


More information about the systemd-devel mailing list