Skip to content

Commit

Permalink
Merge pull request #60 from mdaus/nrt-datetime-declarations
Browse files Browse the repository at this point in the history
place variable declarations at top of scope
  • Loading branch information
asylvest authored Nov 27, 2017
2 parents 590776b + b02f2ad commit 9e212fe
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions modules/c/nrt/source/DateTime.c
Original file line number Diff line number Diff line change
Expand Up @@ -96,18 +96,20 @@ NRTPRIV(NRT_BOOL) nrt_DateTime_setMonthInfoFromDayOfYear(int year,
int *month,
int *dayOfMonth)
{
int yearIndex;
int monthIndex;
int lastMonthDays = 0;

if (year < 1970 || year > 2037 || dayOfYear < 1 ||
dayOfYear > NRT_DAYS_PER_YEAR[nrtYearIndex(year)])
{
return NRT_FAILURE;
}

int yearIndex = nrtYearIndex(year);
yearIndex = nrtYearIndex(year);

/* Find the entry in cumulative days per month where the day of the
* year fits. */
int monthIndex;
int lastMonthDays = 0;
for (monthIndex = 0; monthIndex < 12; ++monthIndex)
{
int nextMonthDays =
Expand Down

0 comments on commit 9e212fe

Please sign in to comment.