This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
pp_goto: Call get-magic before choosing goto type
[perl5.git] / time64.c
old mode 100755 (executable)
new mode 100644 (file)
index ca31acf..7b08d41
--- a/time64.c
+++ b/time64.c
@@ -303,7 +303,9 @@ static void S_copy_little_tm_to_big_TM(const struct tm *src, struct TM *dest) {
 #ifndef HAS_LOCALTIME_R
 /* Simulate localtime_r() to the best of our ability */
 static struct tm * S_localtime_r(const time_t *clock, struct tm *result) {
+#ifdef VMS
     dTHX;    /* in case the following is defined as Perl_my_localtime(aTHX_ ...) */
+#endif
     const struct tm *static_result = localtime(clock);
 
     assert(result != NULL);
@@ -368,7 +370,7 @@ static struct TM *S_gmtime64_r (const Time64_T *in_time, struct TM *p)
     p->tm_isdst  = 0;
 
 #ifdef HAS_TM_TM_ZONE
-    p->tm_zone   = "UTC";
+    p->tm_zone   = (char *)"UTC";
 #endif
 
     v_tm_sec  = (int)fmod(time, 60.0);
@@ -377,7 +379,7 @@ static struct TM *S_gmtime64_r (const Time64_T *in_time, struct TM *p)
     time      = time >= 0 ? floor(time / 60.0) : ceil(time / 60.0);
     v_tm_hour = (int)fmod(time, 24.0);
     time      = time >= 0 ? floor(time / 24.0) : ceil(time / 24.0);
-    v_tm_tday = (int)time;
+    v_tm_tday = time;
 
     WRAP (v_tm_sec, v_tm_min, 60);
     WRAP (v_tm_min, v_tm_hour, 60);
@@ -543,7 +545,7 @@ static struct TM *S_localtime64_r (const Time64_T *time, struct TM *local_tm)
     /* GMT is Jan 1st, xx01 year, but localtime is still Dec 31st
        in a non-leap xx00.  There is one point in the cycle
        we can't account for which the safe xx00 year is a leap
-       year.  So we need to correct for Dec 31st comming out as
+       year.  So we need to correct for Dec 31st coming out as
        the 366th day of the year.
     */
     if( !IS_LEAP(local_tm->tm_year) && local_tm->tm_yday == 365 )