pike.git / src / builtin_functions.c

version» Context lines:

pike.git/src/builtin_functions.c:5380:    *!    *! @seealso    *! @[localtime()], @[time()], @[ctime()], @[mktime()]    */   PMOD_EXPORT void f_gmtime(INT32 args)   {   #if defined (HAVE_GMTIME_R) || defined (HAVE_GMTIME_S)    struct tm tm_s;   #endif    struct tm *tm; -  LONGEST tt; +  INT64 tt;    time_t t;       get_all_args("gmtime", args, "%l", &tt);    - #if SIZEOF_TIME_T < SIZEOF_LONGEST + #if SIZEOF_TIME_T < SIZEOF_INT64    if (tt > MAX_TIME_T || tt < MIN_TIME_T)    SIMPLE_ARG_ERROR ("gmtime", 1, "Timestamp outside valid range.");   #endif    t = (time_t) tt;      #ifdef HAVE_GMTIME_R    tm = gmtime_r (&t, &tm_s);   #elif defined (HAVE_GMTIME_S)    if (!gmtime_s (&tm_s, &t)) tm = &tm_s; else tm = NULL;   #else    tm = gmtime(&t);   #endif    if (!tm) Pike_error ("gmtime() on this system cannot handle " -  "the timestamp %"PRINTLONGEST"d.\n", (LONGEST) t); +  "the timestamp %"PRINTINT64"d.\n", (INT64) t);    pop_n_elems(args);    encode_struct_tm(tm);       push_static_text("timezone");    push_int(0);    f_aggregate_mapping(20);   }      /*! @decl mapping(string:int) localtime(int timestamp)    *!
pike.git/src/builtin_functions.c:5451:    *! @note    *! Prior to Pike 7.5 the field @expr{"timezone"@} was sometimes not    *! present, and was sometimes not adjusted for daylight savings time.    *!    *! @seealso    *! @[Calendar], @[gmtime()], @[time()], @[ctime()], @[mktime()]    */   PMOD_EXPORT void f_localtime(INT32 args)   {    struct tm *tm; -  LONGEST tt; +  INT64 tt;    time_t t;       get_all_args("localtime", args, "%l", &tt);    - #if SIZEOF_TIME_T < SIZEOF_LONGEST + #if SIZEOF_TIME_T < SIZEOF_INT64    if (tt > MAX_TIME_T || tt < MIN_TIME_T)    SIMPLE_ARG_ERROR ("localtime", 1, "Timestamp outside valid range.");   #endif    t = (time_t) tt;       tm = localtime(&t);    if (!tm) Pike_error ("localtime() on this system cannot handle "    "the timestamp %ld.\n", (long) t);    pop_n_elems(args);    encode_struct_tm(tm);