[tz] [PROPOSED PATCH 2/3] Port 'bool' usage to Sun C 5.12.

Paul Eggert eggert at cs.ucla.edu
Tue Aug 26 00:16:48 UTC 2014


* zic.c (inzcont, inzone, is_alpha, yearistype):
Fix prototype to match function, as the C standard requires.
* NEWS: Mention the use of 'bool'.
---
 NEWS  | 2 ++
 zic.c | 8 ++++----
 2 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/NEWS b/NEWS
index a453ef6..0f4ff2e 100644
--- a/NEWS
+++ b/NEWS
@@ -104,6 +104,8 @@ Unreleased, experimental changes
     For easier maintenance later, some C code has been simplified
     and some lint has been removed.
 
+    The C type 'bool' is now used for boolean values, instead of 'int'.
+
     The long-obsolete LOCALE_HOME code has been removed.
 
     The long-obsolete 'gtime' function has been removed.
diff --git a/zic.c b/zic.c
index d622b80..5d0501d 100644
--- a/zic.c
+++ b/zic.c
@@ -114,11 +114,11 @@ static void	infile(const char * filename);
 static void	inleap(char ** fields, int nfields);
 static void	inlink(char ** fields, int nfields);
 static void	inrule(char ** fields, int nfields);
-static int	inzcont(char ** fields, int nfields);
-static int	inzone(char ** fields, int nfields);
+static bool	inzcont(char ** fields, int nfields);
+static bool	inzone(char ** fields, int nfields);
 static bool	inzsub(char **, int, bool);
 static int	itsdir(const char * name);
-static int	is_alpha(char a);
+static bool	is_alpha(char a);
 static char	lowerit(char);
 static bool	mkdirs(char *);
 static void	newabbr(const char * abbr);
@@ -130,7 +130,7 @@ static void	rulesub(struct rule * rp,
 			const char * typep, const char * monthp,
 			const char * dayp, const char * timep);
 static zic_t	tadd(zic_t t1, zic_t t2);
-static int	yearistype(int year, const char * type);
+static bool	yearistype(int year, const char * type);
 
 static int		charcnt;
 static bool		errors;
-- 
1.9.1



More information about the tz mailing list