Closed Bug 14708 Opened 25 years ago Closed 25 years ago

Fix small compiler warning in nsScriptableDateFormat.cpp

Categories

(Core :: Internationalization, defect, P3)

defect

Tracking

()

VERIFIED FIXED

People

(Reporter: colin, Assigned: colin)

Details

mktime returns (time_t)-1 in the event of an error, so the -1 in the attached needs casting to time_t. Index: nsScriptableDateFormat.cpp =================================================================== RCS file: /cvsroot/mozilla/intl/locale/src/nsScriptableDateFormat.cpp,v retrieving revision 1.6 diff -u -r1.6 nsScriptableDateFormat.cpp --- nsScriptableDateFormat.cpp 1999/09/08 20:08:15 1.6 +++ nsScriptableDateFormat.cpp 1999/09/23 14:00:57 @@ -115,7 +115,7 @@ tmTime.tm_yday = tmTime.tm_wday = 0; tmTime.tm_isdst = -1; timetTime = mktime(&tmTime); - if (-1 != timetTime) { + if ((time_t)-1 != timetTime) { rv = aDateTimeFormat->FormatTime(aLocale, dateFormatSelector, timeFormatSelector, timetTime, mStringOut); if (NS_SUCCEEDED(rv)) {
I can check this fix in (assuming I get approval from Chris H) if you want to give me the go-ahead.
Assignee: ftang → nhotta
nhotta, please review this . This is your code.
Assignee: nhotta → colin
The patch looks fine to me.
Status: NEW → RESOLVED
Closed: 25 years ago
Resolution: --- → FIXED
I just checked this in (rev 1.7) with Chris' permission.
QA Contact: teruko → nhotta
Changed QA contact to nhotta@netscape.com. Hotta san, please just mark this bug to verified.
Status: RESOLVED → VERIFIED
Verified, I checked the rev 1.7.
You need to log in before you can comment on or make changes to this bug.