Subject: pkg/19720: dclock fix return type of time() for sparc64
To: None <gnats-bugs@gnats.netbsd.org>
From: john heasley <heas@shrubbery.net>
List: netbsd-bugs
Date: 01/07/2003 01:45:46
>Number: 19720
>Category: pkg
>Synopsis: wrong type variable for time() return
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: pkg-manager
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Mon Jan 06 17:46:00 PST 2003
>Closed-Date:
>Last-Modified:
>Originator: john heasley
>Release: NetBSD 1.6K
>Organization:
>Environment:
System: NetBSD guelah 1.6K NetBSD 1.6K (foad) #9: Mon Dec 30 19:01:40 UTC 2002 root@foad:/sys/arch/sparc64/compile/foad sparc64
Architecture: sparc64
Machine: sparc64
>Description:
probably a better way of fixing this. the type of the variable
accept the return value from time() in dclock is incorrect. it
should be time_t. without this, the dclock does not work at all.
>How-To-Repeat:
>Fix:
i did not go through the entire application looking for other instances.
--- Dclock.c.bak Mon Jan 6 17:30:47 2003
+++ Dclock.c Mon Jan 6 17:32:55 2003
@@ -625,7 +625,7 @@
{
Boolean save_scroll = w->dclock.scroll;
Boolean save_fade = w->dclock.fade;
- long t;
+ time_t t;
if (!XtIsRealized((Widget) w))
return;
@@ -661,7 +661,7 @@
{
char buf[11];
Boolean alarm_went_off = False;
- long t = time(0);
+ time_t t = time(0);
register struct tm *l_time = localtime(&t);
int digit_w = w->dclock.digit_w;
int digit_h = w->dclock.digit_h;
>Release-Note:
>Audit-Trail:
>Unformatted: