~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/calendar.cc

  • Committer: Stewart Smith
  • Date: 2010-11-03 03:29:48 UTC
  • mto: (1902.1.1 build) (1910.1.2 build)
  • mto: This revision was merged to the branch mainline in revision 1903.
  • Revision ID: stewart@flamingspork.com-20101103032948-ocaksrku0oqxw8aa
fix more docs warnings: underline/overline too short

Show diffs side-by-side

added added

removed removed

Lines of Context:
53
53
 * Private utility macro for enabling a switch between
54
54
 * Gregorian and Julian leap year date arrays.
55
55
 */
56
 
inline static const uint32_t* days_in_month(uint32_t y, enum calendar c) 
57
 
{
58
 
  if (is_leap_year(y, c))
59
 
    return __leap_days_in_month;
60
 
  else
61
 
    return __normal_days_in_month;
62
 
}
63
 
 
64
 
inline static const uint32_t* days_to_end_month(uint32_t y, enum calendar c) 
65
 
{
66
 
  if (is_leap_year(y, c))
67
 
    return __leap_days_to_end_month;
68
 
  else
69
 
    return __normal_days_to_end_month;
70
 
}
 
56
#define __DAYS_IN_MONTH(y, c) (const uint32_t *) (IS_LEAP_YEAR((y),(c)) ? __leap_days_in_month : __normal_days_in_month)
 
57
#define __DAYS_TO_END_MONTH(y, c) (const uint32_t *) (IS_LEAP_YEAR((y),(c)) ? __leap_days_to_end_month : __normal_days_to_end_month)
71
58
 
72
59
 
73
60
/**
302
289
    return (day <= __normal_days_in_month[month - 1]);
303
290
  else
304
291
  {
305
 
    const uint32_t *p_months= days_in_month(year, (enum calendar) GREGORIAN);
 
292
    const uint32_t *p_months= __DAYS_IN_MONTH(year, (enum calendar) GREGORIAN);
306
293
    return (day <= p_months[1]);
307
294
  }
308
295
}
316
303
 */
317
304
uint32_t days_in_gregorian_year_month(uint32_t year, uint32_t month)
318
305
{
319
 
  const uint32_t *p_months= days_in_month(year, GREGORIAN);
 
306
  const uint32_t *p_months= __DAYS_IN_MONTH(year, GREGORIAN);
320
307
  return p_months[month - 1];
321
308
}
322
309