Ignore:
Timestamp:
Mar 2, 2007, 11:55:21 AM (18 years ago)
Author:
aroben
Message:

Reviewed by Kevin M.

Try to fix the Qt build.

  • kjs/DateMath.cpp: (KJS::msToGregorianDateTime): Removed unnecessary "struct" keyword.
  • kjs/DateMath.h: Moved forward declarations to the top of the file before they are used.
  • kjs/date_object.cpp: (KJS::formatLocaleDate): Changed to take a const GregorianDateTime& since GregorianDateTime is Noncopyable.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/kjs/date_object.cpp

    r18658 r19945  
    159159enum LocaleDateTimeFormat { LocaleDateAndTime, LocaleDate, LocaleTime };
    160160 
    161 static JSCell* formatLocaleDate(GregorianDateTime gdt, const LocaleDateTimeFormat format)
     161static JSCell* formatLocaleDate(const GregorianDateTime& gdt, const LocaleDateTimeFormat format)
    162162{
    163163    static const char* formatStrings[] = {"%#c", "%#x", "%X"};
     
    165165    // Offset year if needed
    166166    struct tm localTM = gdt;
    167     gdt.year += 1900;
    168     bool yearNeedsOffset = gdt.year < 1900 || gdt.year > 2038;
     167    int year = gdt.year + 1900;
     168    bool yearNeedsOffset = year < 1900 || year > 2038;
    169169    if (yearNeedsOffset) {
    170         localTM.tm_year = equivalentYearForDST(gdt.year) - 1900;
     170        localTM.tm_year = equivalentYearForDST(year) - 1900;
    171171     }
    172172 
     
    186186        snprintf(yearString, yearLen, "%d", localTM.tm_year + 1900);
    187187        char* yearLocation = strstr(timebuffer, yearString);
    188         snprintf(yearString, yearLen, "%d", gdt.year);
     188        snprintf(yearString, yearLen, "%d", year);
    189189 
    190190        strncpy(yearLocation, yearString, yearLen - 1);
Note: See TracChangeset for help on using the changeset viewer.