summaryrefslogtreecommitdiff
path: root/time/xchrono/patches/patch-ab
diff options
context:
space:
mode:
Diffstat (limited to 'time/xchrono/patches/patch-ab')
-rw-r--r--time/xchrono/patches/patch-ab94
1 files changed, 87 insertions, 7 deletions
diff --git a/time/xchrono/patches/patch-ab b/time/xchrono/patches/patch-ab
index 42ac45a99ad..60433f4e0bf 100644
--- a/time/xchrono/patches/patch-ab
+++ b/time/xchrono/patches/patch-ab
@@ -1,20 +1,24 @@
-$NetBSD: patch-ab,v 1.1 2002/06/15 20:40:26 dmcmahill Exp $
+$NetBSD: patch-ab,v 1.2 2006/11/28 23:04:55 agc Exp $
the time stuff is needed to compile on alpha, the other stuff kills
compiler warnings
--- MultiClock.c.orig Sat Jun 15 16:09:44 2002
+++ MultiClock.c
-@@ -33,7 +33,7 @@
+@@ -33,9 +33,10 @@
#include <X11/Xaw/XawInit.h>
#include "MultiClockP.h"
-extern long time();
++#include <stdio.h>
+#include <time.h>
static void clock_tic(), updateClocks(), DrawHand(), DrawSecond(), SetSeg(), DrawClockFace();
- static erase_hands(), round();
+-static erase_hands(), round();
++static erase_hands(), xchrono_round();
-@@ -177,7 +177,7 @@
+ /* Private Definitions */
+
+@@ -177,7 +178,7 @@
{
ClassField(numberOfSlots) += CLOCK_LIST_SIZE;
ClassField(clockList) =
@@ -23,7 +27,7 @@ compiler warnings
sizeof(ClockWidget)*ClassField(numberOfSlots));
}
-@@ -239,7 +239,7 @@
+@@ -239,7 +240,7 @@
if(!w->clock.analog) {
char *str;
struct tm tm, *localtime();
@@ -32,7 +36,7 @@ compiler warnings
(void) time(&time_value);
tm = *localtime(&time_value);
str = asctime(&tm);
-@@ -391,7 +391,7 @@
+@@ -391,7 +392,7 @@
XtIntervalId *id;
{
ClockWidget w = (ClockWidget) client_data;
@@ -41,7 +45,7 @@ compiler warnings
char localTimezone[TZ_BUFLEN];
char *tzenv = getenv("TZ");
struct tm *localtime();
-@@ -417,7 +417,7 @@
+@@ -417,11 +418,11 @@
{
(*list)->clock.show_second_hand =
(ClassField(updateInterval) <= SECOND_HAND_TIME);
@@ -50,3 +54,79 @@ compiler warnings
{
if ((*list)->clock.timezone)
{
+- sprintf (tzEnviron, "TZ=%s", (*list)->clock.timezone);
++ snprintf (tzEnviron, sizeof(tzEnviron), "TZ=%s", (*list)->clock.timezone);
+ putenv (tzEnviron);
+ tzset ();
+ }
+@@ -433,7 +434,7 @@
+
+ if (tzenv)
+ {
+- sprintf (tzEnviron, "TZ=%s", localTimezone);
++ snprintf (tzEnviron, sizeof(tzEnviron), "TZ=%s", localTimezone);
+ putenv (tzEnviron);
+ }
+ #ifndef SYSV
+@@ -525,7 +526,7 @@
+ }
+ else am_pm = "AM";
+
+- sprintf (time_string, "%d/%d", tm.tm_mon+1, tm.tm_mday);
++ snprintf (time_string, sizeof(time_string), "%d/%d", tm.tm_mon+1, tm.tm_mday);
+ {
+ int len = strlen (time_string);
+ int x = w->core.width -
+@@ -760,14 +761,14 @@
+ wc = width * cosangle;
+ ws = width * sinangle;
+ SetSeg(w,
+- x = w->clock.centerX + round(length * sinangle),
+- y = w->clock.centerY - round(length * cosangle),
+- x1 = w->clock.centerX - round(ws + wc),
+- y1 = w->clock.centerY + round(wc - ws)); /* 1 ---- 2 */
++ x = w->clock.centerX + xchrono_round(length * sinangle),
++ y = w->clock.centerY - xchrono_round(length * cosangle),
++ x1 = w->clock.centerX - xchrono_round(ws + wc),
++ y1 = w->clock.centerY + xchrono_round(wc - ws)); /* 1 ---- 2 */
+ /* 2 */
+ SetSeg(w, x1, y1,
+- x2 = w->clock.centerX - round(ws - wc),
+- y2 = w->clock.centerY + round(wc + ws)); /* 2 ----- 3 */
++ x2 = w->clock.centerX - xchrono_round(ws - wc),
++ y2 = w->clock.centerY + xchrono_round(wc + ws)); /* 2 ----- 3 */
+
+ SetSeg(w, x2, y2, x, y); /* 3 ----- 1(4) */
+ }
+@@ -834,14 +835,14 @@
+ ws = width * sinangle;
+ /*1 ---- 2 */
+ SetSeg(w,
+- x = w->clock.centerX + round(length * sinangle),
+- y = w->clock.centerY - round(length * cosangle),
+- w->clock.centerX + round(ms - wc),
+- w->clock.centerY - round(mc + ws) );
+- SetSeg(w, w->clock.centerX + round(offset *sinangle),
+- w->clock.centerY - round(offset * cosangle), /* 2-----3 */
+- w->clock.centerX + round(ms + wc),
+- w->clock.centerY - round(mc - ws));
++ x = w->clock.centerX + xchrono_round(length * sinangle),
++ y = w->clock.centerY - xchrono_round(length * cosangle),
++ w->clock.centerX + xchrono_round(ms - wc),
++ w->clock.centerY - xchrono_round(mc + ws) );
++ SetSeg(w, w->clock.centerX + xchrono_round(offset *sinangle),
++ w->clock.centerY - xchrono_round(offset * cosangle), /* 2-----3 */
++ w->clock.centerX + xchrono_round(ms + wc),
++ w->clock.centerY - xchrono_round(mc - ws));
+ w->clock.segbuffptr->x = x;
+ w->clock.segbuffptr++->y = y;
+ w->clock.numseg ++;
+@@ -886,7 +887,7 @@
+ w->clock.numseg = 0;
+ }
+
+-static int round(x)
++static int xchrono_round(x)
+ double x;
+ {
+ return(x >= 0.0 ? (int)(x + .5) : (int)(x - .5));