From owner-freebsd-ports Tue May 30 13:50:14 2000 Delivered-To: freebsd-ports@freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.ORG [204.216.27.21]) by hub.freebsd.org (Postfix) with ESMTP id A573737B64E for ; Tue, 30 May 2000 13:50:00 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.9.3/8.9.2) id NAA27646; Tue, 30 May 2000 13:50:00 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: from mail.surf1.de (mail.surf1.de [194.25.165.21]) by hub.freebsd.org (Postfix) with ESMTP id 71F0437B6DC for ; Tue, 30 May 2000 13:41:33 -0700 (PDT) (envelope-from root@big.endian.de) Received: from cichlids.com (p3E9C1129.dip0.t-ipconnect.de [62.156.17.41]) by mail.surf1.de (8.9.3/8.9.3) with ESMTP id WAA23893 for ; Tue, 30 May 2000 22:41:57 +0200 Received: from cichlids.cichlids.com (cichlids.cichlids.com [192.168.0.10]) by cichlids.com (Postfix) with ESMTP id 6B9BEAC30 for ; Tue, 30 May 2000 22:41:54 +0200 (CEST) Received: by cichlids.cichlids.com (Postfix, from userid 0) id D105814AA4; Tue, 30 May 2000 22:41:32 +0200 (CEST) Message-Id: <20000530204132.D105814AA4@cichlids.cichlids.com> Date: Tue, 30 May 2000 22:41:32 +0200 (CEST) From: alex@big.endian.de Reply-To: alex@big.endian.de To: FreeBSD-gnats-submit@freebsd.org X-Send-Pr-Version: 3.2 Subject: ports/18908: fix astro/xplanet on alpha Sender: owner-freebsd-ports@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org >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