[Pkg-shadow-commits] r2066 - in upstream/trunk: . libmisc
nekral-guest at alioth.debian.org
nekral-guest at alioth.debian.org
Mon May 26 08:59:57 UTC 2008
Author: nekral-guest
Date: 2008-05-26 08:59:54 +0000 (Mon, 26 May 2008)
New Revision: 2066
Modified:
upstream/trunk/ChangeLog
upstream/trunk/libmisc/getdate.y
Log:
* libmisc/getdate.y: abbrev is a bool.
* libmisc/getdate.y: Avoid implicit conversion of pointers / chars / integers to booleans.
Modified: upstream/trunk/ChangeLog
===================================================================
--- upstream/trunk/ChangeLog 2008-05-26 08:56:34 UTC (rev 2065)
+++ upstream/trunk/ChangeLog 2008-05-26 08:59:54 UTC (rev 2066)
@@ -1,5 +1,11 @@
2008-05-26 Nicolas François <nicolas.francois at centraliens.net>
+ * libmisc/getdate.y: abbrev is a bool.
+ * libmisc/getdate.y: Avoid implicit conversion of pointers / chars /
+ integers to booleans.
+
+2008-05-26 Nicolas François <nicolas.francois at centraliens.net>
+
* lib/prototypes.h: Fix prototypes according to earlier changes
(usage of the bool type).
* lib/prototypes.h: Add the arguments' name to the prototypes.
Modified: upstream/trunk/libmisc/getdate.y
===================================================================
--- upstream/trunk/libmisc/getdate.y 2008-05-26 08:56:34 UTC (rev 2065)
+++ upstream/trunk/libmisc/getdate.y 2008-05-26 08:59:54 UTC (rev 2066)
@@ -395,7 +395,7 @@
number : tUNUMBER
{
- if (yyHaveTime && yyHaveDate && !yyHaveRel)
+ if ((yyHaveTime != 0) && (yyHaveDate != 0) && (yyHaveRel == 0))
yyYear = $1;
else
{
@@ -647,10 +647,10 @@
register char *q;
register const TABLE *tp;
int i;
- int abbrev;
+ bool abbrev;
/* Make it lowercase. */
- for (p = buff; *p; p++)
+ for (p = buff; '\0' != *p; p++)
if (ISUPPER (*p))
*p = tolower (*p);
@@ -667,14 +667,14 @@
/* See if we have an abbreviation for a month. */
if (strlen (buff) == 3)
- abbrev = 1;
+ abbrev = true;
else if (strlen (buff) == 4 && buff[3] == '.')
{
- abbrev = 1;
+ abbrev = true;
buff[3] = '\0';
}
else
- abbrev = 0;
+ abbrev = false;
for (tp = MonthDayTable; tp->name; tp++)
{
@@ -743,14 +743,14 @@
}
/* Drop out any periods and try the timezone table again. */
- for (i = 0, p = q = buff; *q; q++)
+ for (i = 0, p = q = buff; '\0' != *q; q++)
if (*q != '.')
*p++ = *q;
else
i++;
*p = '\0';
- if (i)
- for (tp = TimezoneTable; tp->name; tp++)
+ if (0 != i)
+ for (tp = TimezoneTable; NULL != tp->name; tp++)
if (strcmp (buff, tp->name) == 0)
{
yylval.Number = tp->value;
@@ -790,7 +790,7 @@
yyInput--;
if (sign < 0)
yylval.Number = -yylval.Number;
- return sign ? tSNUMBER : tUNUMBER;
+ return (0 != sign) ? tSNUMBER : tUNUMBER;
}
if (ISALPHA (c))
{
@@ -874,7 +874,8 @@
tm.tm_year = ToYear (yyYear) - TM_YEAR_ORIGIN + yyRelYear;
tm.tm_mon = yyMonth - 1 + yyRelMonth;
tm.tm_mday = yyDay + yyRelDay;
- if (yyHaveTime || (yyHaveRel && !yyHaveDate && !yyHaveDay))
+ if ((yyHaveTime != 0) ||
+ ( (yyHaveRel != 0) && (yyHaveDate == 0) && (yyHaveDay == 0) ))
{
tm.tm_hour = ToHour (yyHour, yyMeridian);
if (tm.tm_hour < 0)
More information about the Pkg-shadow-commits
mailing list