Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 30 May 2000 22:41:32 +0200 (CEST)
From:      alex@big.endian.de
To:        FreeBSD-gnats-submit@freebsd.org
Subject:   ports/18908: fix astro/xplanet on alpha
Message-ID:  <20000530204132.D105814AA4@cichlids.cichlids.com>

next in thread | raw e-mail | index | archive | help

>Number:         18908
>Category:       ports
>Synopsis:       fix astro/xplanet on alpha
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-ports
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Tue May 30 13:50:00 PDT 2000
>Closed-Date:
>Last-Modified:
>Originator:     Alexander Langer
>Release:        FreeBSD 5.0-CURRENT i386
>Organization:
none
>Environment:


>Description:

you should not try to give a 64bit pointer to a function which wants 32 bit.
That's why it's ok on i386.

>How-To-Repeat:

make on alpha

>Fix:

add these patches:

--- options.cc.old	Tue May 30 22:23:31 2000
+++ options.cc	Tue May 30 22:25:24 2000
@@ -195,7 +195,9 @@
 	case DATE:
 	  {
 #ifdef HAVE_STRPTIME
-	    struct tm *t = gmtime (&opts.time.tv_sec);
+	    time_t tmp = (time_t) opts.time.tv_sec;
+	    struct tm *t = gmtime (&tmp);
+	    opts.time.tv_sec = (long) tmp;
 	    strptime (optarg, "%d %b %Y %T", t);
 	    opts.time.tv_sec = mktime (t);
 #else

and

--- xroutines.cc.old	Tue May 30 22:33:50 2000
+++ xroutines.cc	Tue May 30 22:34:52 2000
@@ -390,9 +390,13 @@
   int y = opts.label_y;
   int dy;
 
+  time_t tmp;
+
   // Write the local time
+  tmp = (time_t) opts.time.tv_sec;
   strftime (date_label, sizeof(date_label), "%a %d %b %Y %H:%M %Z", 
-	    localtime (&opts.time.tv_sec));
+	    localtime (&tmp));
+  opts.time.tv_sec = tmp;
 
   // Write the sun's and observer's positions
   if (opts.body == 0 || opts.body == 3)

and 

--- xplanetbg.cc.old	Tue May 30 22:37:41 2000
+++ xplanetbg.cc	Tue May 30 22:40:05 2000
@@ -225,7 +225,10 @@
 	case DATE:
 	  {
 #ifdef HAVE_STRPTIME
-	    if (tm == NULL) tm = localtime (&tval.tv_sec);
+	    time_t tmp;
+	    tmp = tval.tv_sec;
+	    if (tm == NULL) tm = localtime (&tmp);
+	    tval.tv_sec = tmp;
 	    strptime (optarg, "%d %b %Y %T", tm);
 	    tval.tv_sec = mktime (tm);
 #else
@@ -393,18 +396,23 @@
 	  break;
 	case TIMEWARP:
 #ifdef HAVE_STRPTIME
-	  sscanf (optarg, "%f", &timewarp);
-	  if (timewarp == 0) 
-	    {
-	      cerr << "timewarp must be non-zero\n";
-	      exit (EXIT_FAILURE);
-	    }
-	  if (tm == NULL) tm = localtime (&tval.tv_sec);
+	  {
+	    time_t tmp;
+	    sscanf (optarg, "%f", &timewarp);
+	    if (timewarp == 0) 
+	      {
+	        cerr << "timewarp must be non-zero\n";
+	        exit (EXIT_FAILURE);
+	      }
+	    tmp = tval.tv_sec;
+	    if (tm == NULL) tm = localtime (&tmp);
+	    tval.tv_sec = tmp;
 #else
-	  cerr << "This system does not have the strptime function.\n";
-	  cerr << "The -timewarp option will be ignored.\n";
+	    cerr << "This system does not have the strptime function.\n";
+	    cerr << "The -timewarp option will be ignored.\n";
 #endif
-	  break;
+	    break;
+          }
 	case VERSION:
 	  cout << versionstring << endl;
 	  cout << "For more information, see " 
@@ -524,12 +532,15 @@
 #ifdef HAVE_STRPTIME
       if (tm != NULL) 
 	{
+	  time_t tmp;
 	  strftime (cbuffer, sizeof(cbuffer), "%d %b %Y %T", tm);
 	  strcat (dyn_command, " -date \"");
 	  strcat (dyn_command, cbuffer);
 	  strcat (dyn_command, "\" ");
 	  tval.tv_sec += (time_t) timewarp * wait;
-	  tm = localtime (&tval.tv_sec);
+	  tmp = tval.tv_sec;
+	  tm = localtime (&tmp);
+	  tval.tv_sec = tmp;
 	}
 #endif
       


>Release-Note:
>Audit-Trail:
>Unformatted:


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-ports" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20000530204132.D105814AA4>