~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/calendar.cc

  • Committer: Brian Aker
  • Date: 2009-02-02 23:10:18 UTC
  • mfrom: (779.3.40 devel)
  • Revision ID: brian@tangent.org-20090202231018-zlp0hka6kgwy1vfy
Merge from Monty

Show diffs side-by-side

added added

removed removed

Lines of Context:
429
429
 * @param Pointer to a uint32_t to hold the resulting year, which 
430
430
 *        may be incremented or decremented depending on flags
431
431
 */
432
 
uint32_t week_number_from_gregorian_date(uint32_t year
433
 
                                       , uint32_t month
434
 
                                       , uint32_t day
435
 
                                       , bool sunday_is_first_day_of_week
436
 
                                       , bool week_range_is_ordinal
437
 
                                       , bool use_iso_8601_1988
438
 
                                       , uint32_t *year_out)
 
432
int64_t week_number_from_gregorian_date(uint32_t year
 
433
                                        , uint32_t month
 
434
                                        , uint32_t day
 
435
                                        , bool sunday_is_first_day_of_week
 
436
                                        , bool week_range_is_ordinal
 
437
                                        , bool use_iso_8601_1988
 
438
                                        , uint32_t *year_out)
439
439
{
440
 
  uint32_t tmp_days;
441
 
  uint32_t day_number= julian_day_number_from_gregorian_date(year, month, day);
442
 
  uint32_t first_day_of_year= julian_day_number_from_gregorian_date(year, 1, 1);
 
440
  int64_t tmp_days;
 
441
  int64_t day_number= julian_day_number_from_gregorian_date(year, month, day);
 
442
  int64_t first_day_of_year= julian_day_number_from_gregorian_date(year, 1, 1);
443
443
  uint32_t tmp_years= year;
444
444
 
445
 
  uint32_t week_day= day_of_week(first_day_of_year, sunday_is_first_day_of_week);
 
445
  int64_t week_day= day_of_week(first_day_of_year, sunday_is_first_day_of_week);
446
446
 
447
447
  if (month == 1 && day <= (7 - week_day))
448
448
  {