mirror of
https://github.com/apache/nuttx.git
synced 2026-05-28 20:08:15 +08:00
fix misspelled names in locally scoped code
These misspelled words are used in strictly local scopes. Renaming these variables should not cause any problems.
This commit is contained in:
@@ -155,7 +155,7 @@ static void clock_utc2calendar(time_t days, FAR int *year, FAR int *month,
|
||||
int min;
|
||||
int max;
|
||||
int tmp;
|
||||
bool leapyear;
|
||||
bool leap_year;
|
||||
|
||||
/* There is one leap year every four years, so we can get close with the
|
||||
* following:
|
||||
@@ -170,11 +170,11 @@ static void clock_utc2calendar(time_t days, FAR int *year, FAR int *month,
|
||||
* Is this year a leap year? (we'll need this later too)
|
||||
*/
|
||||
|
||||
leapyear = clock_isleapyear(value + EPOCH_YEAR);
|
||||
leap_year = clock_isleapyear(value + EPOCH_YEAR);
|
||||
|
||||
/* Get the number of days in the year */
|
||||
|
||||
tmp = (leapyear ? DAYSPERLYEAR : DAYSPERNYEAR);
|
||||
tmp = (leap_year ? DAYSPERLYEAR : DAYSPERNYEAR);
|
||||
|
||||
/* Do we have that many days left to account for? */
|
||||
|
||||
@@ -187,15 +187,15 @@ static void clock_utc2calendar(time_t days, FAR int *year, FAR int *month,
|
||||
|
||||
/* Is the next year a leap year? */
|
||||
|
||||
leapyear = clock_isleapyear(value + EPOCH_YEAR);
|
||||
leap_year = clock_isleapyear(value + EPOCH_YEAR);
|
||||
|
||||
/* Get the number of days in the next year */
|
||||
|
||||
tmp = (leapyear ? DAYSPERLYEAR : DAYSPERNYEAR);
|
||||
tmp = (leap_year ? DAYSPERLYEAR : DAYSPERNYEAR);
|
||||
}
|
||||
|
||||
/* At this point, 'value' has the years since 1970 and 'days' has number
|
||||
* of days into that year. 'leapyear' is true if the year in 'value' is
|
||||
* of days into that year. 'leap_year' is true if the year in 'value' is
|
||||
* a leap year.
|
||||
*/
|
||||
|
||||
@@ -216,7 +216,7 @@ static void clock_utc2calendar(time_t days, FAR int *year, FAR int *month,
|
||||
* month following the midpoint.
|
||||
*/
|
||||
|
||||
tmp = clock_daysbeforemonth(value + 1, leapyear);
|
||||
tmp = clock_daysbeforemonth(value + 1, leap_year);
|
||||
|
||||
/* Does the number of days before this month that equal or exceed the
|
||||
* number of days we have remaining?
|
||||
@@ -228,7 +228,7 @@ static void clock_utc2calendar(time_t days, FAR int *year, FAR int *month,
|
||||
* midpoint, 'value'. Could it be the midpoint?
|
||||
*/
|
||||
|
||||
tmp = clock_daysbeforemonth(value, leapyear);
|
||||
tmp = clock_daysbeforemonth(value, leap_year);
|
||||
if (tmp > days)
|
||||
{
|
||||
/* No... The one we want is somewhere between min and value-1 */
|
||||
@@ -261,7 +261,7 @@ static void clock_utc2calendar(time_t days, FAR int *year, FAR int *month,
|
||||
* the selected month
|
||||
*/
|
||||
|
||||
days -= clock_daysbeforemonth(value, leapyear);
|
||||
days -= clock_daysbeforemonth(value, leap_year);
|
||||
|
||||
/* At this point, value has the month into this year (zero based) and days
|
||||
* has number of days into this month (zero based)
|
||||
|
||||
@@ -1389,7 +1389,7 @@ static int_fast32_t transtime(int year,
|
||||
FAR const struct rule_s *rulep,
|
||||
int_fast32_t offset)
|
||||
{
|
||||
int leapyear;
|
||||
int leap_year;
|
||||
int_fast32_t value;
|
||||
int i;
|
||||
int d;
|
||||
@@ -1400,7 +1400,7 @@ static int_fast32_t transtime(int year,
|
||||
int dow;
|
||||
|
||||
value = 0;
|
||||
leapyear = isleap(year);
|
||||
leap_year = isleap(year);
|
||||
switch (rulep->r_type)
|
||||
{
|
||||
case JULIAN_DAY:
|
||||
@@ -1413,7 +1413,7 @@ static int_fast32_t transtime(int year,
|
||||
*/
|
||||
|
||||
value = (rulep->r_day - 1) * SECSPERDAY;
|
||||
if (leapyear && rulep->r_day >= 60)
|
||||
if (leap_year && rulep->r_day >= 60)
|
||||
{
|
||||
value += SECSPERDAY;
|
||||
}
|
||||
@@ -1461,7 +1461,7 @@ static int_fast32_t transtime(int year,
|
||||
|
||||
for (i = 1; i < rulep->r_week; ++i)
|
||||
{
|
||||
if (d + DAYSPERWEEK >= g_mon_lengths[leapyear][rulep->r_mon - 1])
|
||||
if (d + DAYSPERWEEK >= g_mon_lengths[leap_year][rulep->r_mon - 1])
|
||||
{
|
||||
break;
|
||||
}
|
||||
@@ -1474,7 +1474,7 @@ static int_fast32_t transtime(int year,
|
||||
value = d * SECSPERDAY;
|
||||
for (i = 0; i < rulep->r_mon - 1; ++i)
|
||||
{
|
||||
value += g_mon_lengths[leapyear][i] * SECSPERDAY;
|
||||
value += g_mon_lengths[leap_year][i] * SECSPERDAY;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -82,7 +82,7 @@ static void adjust(FAR int *tenx, FAR int *x, int base)
|
||||
|
||||
static void normalize(FAR struct tm *tm)
|
||||
{
|
||||
bool leapyear = false;
|
||||
bool leap_year = false;
|
||||
int year;
|
||||
|
||||
for (; ; )
|
||||
@@ -97,7 +97,7 @@ static void normalize(FAR struct tm *tm)
|
||||
|
||||
/* Is this a leap year? */
|
||||
|
||||
leapyear = clock_isleapyear(year);
|
||||
leap_year = clock_isleapyear(year);
|
||||
|
||||
/* Adjust mday field */
|
||||
|
||||
@@ -106,11 +106,11 @@ static void normalize(FAR struct tm *tm)
|
||||
tm->tm_mon--;
|
||||
if (tm->tm_mon < 0)
|
||||
{
|
||||
tm->tm_mday += g_mon_lengths[leapyear][TM_DECEMBER];
|
||||
tm->tm_mday += g_mon_lengths[leap_year][TM_DECEMBER];
|
||||
break;
|
||||
}
|
||||
|
||||
tm->tm_mday += g_mon_lengths[leapyear][tm->tm_mon];
|
||||
tm->tm_mday += g_mon_lengths[leap_year][tm->tm_mon];
|
||||
}
|
||||
|
||||
if (tm->tm_mon < 0)
|
||||
@@ -118,9 +118,9 @@ static void normalize(FAR struct tm *tm)
|
||||
continue;
|
||||
}
|
||||
|
||||
while (tm->tm_mday > g_mon_lengths[leapyear][tm->tm_mon])
|
||||
while (tm->tm_mday > g_mon_lengths[leap_year][tm->tm_mon])
|
||||
{
|
||||
tm->tm_mday -= g_mon_lengths[leapyear][tm->tm_mon];
|
||||
tm->tm_mday -= g_mon_lengths[leap_year][tm->tm_mon];
|
||||
tm->tm_mon++;
|
||||
if (tm->tm_mon > (MONSPERYEAR - 1))
|
||||
{
|
||||
@@ -164,13 +164,13 @@ static void normalize(FAR struct tm *tm)
|
||||
tm->tm_hour -= HOURSPERDAY;
|
||||
tm->tm_mday++;
|
||||
|
||||
if (tm->tm_mday > g_mon_lengths[leapyear][tm->tm_mon])
|
||||
if (tm->tm_mday > g_mon_lengths[leap_year][tm->tm_mon])
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (tm->tm_mday > g_mon_lengths[leapyear][tm->tm_mon])
|
||||
if (tm->tm_mday > g_mon_lengths[leap_year][tm->tm_mon])
|
||||
{
|
||||
continue;
|
||||
}
|
||||
@@ -185,7 +185,7 @@ static void normalize(FAR struct tm *tm)
|
||||
/* Determine the day of the year; -1 because the mday is 1-indexed */
|
||||
|
||||
tm->tm_yday = tm->tm_mday - 1 + clock_daysbeforemonth(tm->tm_mon,
|
||||
leapyear);
|
||||
leap_year);
|
||||
|
||||
/* Finally calculate the weekday */
|
||||
|
||||
|
||||
Reference in New Issue
Block a user