Changeset 11331 in webkit for trunk/JavaScriptCore/kjs/date_object.cpp
- Timestamp:
- Nov 29, 2005, 2:33:22 AM (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/kjs/date_object.cpp
r10932 r11331 470 470 } 471 471 472 static bool isTime_tSigned() 473 { 474 time_t minusOne = (time_t)(-1); 475 return minusOne < 0; 476 } 477 472 478 ValueImp *DateProtoFuncImp::callAsFunction(ExecState *exec, ObjectImp *thisObj, const List &args) 473 479 { … … 523 529 // check whether time value is outside time_t's usual range 524 530 // make the necessary transformations if necessary 531 static bool time_tIsSigned = isTime_tSigned(); 532 static double time_tMin = (time_tIsSigned ? - (double)(1ULL << (8 * sizeof(time_t) - 1)) : 0); 533 static double time_tMax = (time_tIsSigned ? (1ULL << 8 * sizeof(time_t) - 1) - 1 : 2 * (double)(1ULL << 8 * sizeof(time_t) - 1) - 1); 525 534 int realYearOffset = 0; 526 535 double milliOffset = 0.0; 527 536 double secs = floor(milli / msPerSecond); 528 537 529 if ( milli < 0 || milli >= timeFromYear(2038)) {538 if (secs < time_tMin || secs > time_tMax) { 530 539 // ### ugly and probably not very precise 531 540 int realYear = yearFromTime(milli);
Note:
See TracChangeset
for help on using the changeset viewer.