Provided by GNU Savannah

Savannah CVS Surfing - project gnulib - Diff of /gnulib/lib/mktime.c

[gnulib] / gnulib / lib / mktime.c
cvs -d:pserver:anonymous@cvs.sv.gnu.org:/sources/gnulib co gnulib/lib/mktime.c
(to check out web pages for a project, replace /sources with /web in the path above)

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.53, Sun Sep 18 12:30:04 2005 UTC revision 1.54, Fri Sep 8 22:48:25 2006 UTC
# Line 1  Line 1 
1  /* Convert a `struct tm' to a time_t value.  /* Convert a `struct tm' to a time_t value.
2     Copyright (C) 1993-1999, 2002-2004, 2005 Free Software Foundation, Inc.     Copyright (C) 1993-1999, 2002-2004, 2005, 2006 Free Software Foundation, Inc.
3     This file is part of the GNU C Library.     This file is part of the GNU C Library.
4     Contributed by Paul Eggert (eggert@twinsun.com).     Contributed by Paul Eggert (eggert@twinsun.com).
5    
# Line 215  Line 215 
215    /* Overflow occurred one way or another.  Return the nearest result    /* Overflow occurred one way or another.  Return the nearest result
216       that is actually in range, except don't report a zero difference       that is actually in range, except don't report a zero difference
217       if the actual difference is nonzero, as that would cause a false       if the actual difference is nonzero, as that would cause a false
218       match.  */       match; and don't oscillate between two values, as that would
219         confuse the spring-forward gap detector.  */
220    return (*t < TIME_T_MIDPOINT    return (*t < TIME_T_MIDPOINT
221            ? TIME_T_MIN + (*t == TIME_T_MIN)            ? (*t <= TIME_T_MIN + 1 ? *t + 1 : TIME_T_MIN)
222            : TIME_T_MAX - (*t == TIME_T_MAX));            : (TIME_T_MAX - 1 <= *t ? *t - 1 : TIME_T_MAX));
223  }  }
224    
225  /* Use CONVERT to convert *T to a broken down time in *TP.  /* Use CONVERT to convert *T to a broken down time in *TP.

Legend:
Removed from v.1.53  
changed lines
  Added in v.1.54

Send suggestions and report system problems to the Savannah Hackers.
ViewVC Help
Powered by ViewVC 1.0.7