pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/time/xchrono Quieten some more warnings which gcc4 gri...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/bf69ad561498
branches:  trunk
changeset: 521966:bf69ad561498
user:      agc <agc%pkgsrc.org@localhost>
date:      Tue Nov 28 23:04:54 2006 +0000

description:
Quieten some more warnings which gcc4 gripes about

diffstat:

 time/xchrono/distinfo         |   6 +-
 time/xchrono/patches/patch-ab |  94 +++++++++++++++++++++++++++++++++++++++---
 time/xchrono/patches/patch-ac |  21 ++++++++-
 3 files changed, 109 insertions(+), 12 deletions(-)

diffs (189 lines):

diff -r a637573c37e8 -r bf69ad561498 time/xchrono/distinfo
--- a/time/xchrono/distinfo     Tue Nov 28 22:31:21 2006 +0000
+++ b/time/xchrono/distinfo     Tue Nov 28 23:04:54 2006 +0000
@@ -1,8 +1,8 @@
-$NetBSD: distinfo,v 1.4 2005/02/23 19:14:56 wiz Exp $
+$NetBSD: distinfo,v 1.5 2006/11/28 23:04:54 agc Exp $
 
 SHA1 (xchrono.shar) = 8cc61b949ff4c1972cfa810831d562d058fa9e2f
 RMD160 (xchrono.shar) = 8d599f4e594cc0a43c3425841ac8a6670daeaf7e
 Size (xchrono.shar) = 56292 bytes
 SHA1 (patch-aa) = 59c5946422c0ac76907e1d512dd64b9a1899029d
-SHA1 (patch-ab) = 414ed2bfc2aa0aeafaf50c4980bb8394ca3e1407
-SHA1 (patch-ac) = e2da170e8509caed02e4ab7eda8737767aa7ebbb
+SHA1 (patch-ab) = 73c54769d4c915e1d19f0c94e84731d65a5c5ec4
+SHA1 (patch-ac) = af11c1aeb2cd507896082573756f85522e885bd2
diff -r a637573c37e8 -r bf69ad561498 time/xchrono/patches/patch-ab
--- a/time/xchrono/patches/patch-ab     Tue Nov 28 22:31:21 2006 +0000
+++ b/time/xchrono/patches/patch-ab     Tue Nov 28 23:04:54 2006 +0000
@@ -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 @@
                                  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 @@
         (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 @@
    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 @@
        {
          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));
diff -r a637573c37e8 -r bf69ad561498 time/xchrono/patches/patch-ac
--- a/time/xchrono/patches/patch-ac     Tue Nov 28 22:31:21 2006 +0000
+++ b/time/xchrono/patches/patch-ac     Tue Nov 28 23:04:54 2006 +0000
@@ -1,8 +1,16 @@
-$NetBSD: patch-ac,v 1.1 2003/01/30 22:37:27 simonb Exp $
+$NetBSD: patch-ac,v 1.2 2006/11/28 23:04:55 agc Exp $
 
 --- xchrono.c.orig     Fri Jan 31 09:23:44 2003
 +++ xchrono.c
-@@ -91,9 +91,7 @@ static struct {
+@@ -29,6 +29,7 @@
+  * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+  */
+ 
++#include <stdio.h>
+ 
+ #include <X11/Xatom.h>
+ #include <X11/Intrinsic.h>
+@@ -91,9 +92,7 @@
  #define TOKYO (HAWAII+1)
    { "Japan", "Tokyo" },
  #define SYDNEY (TOKYO+1)
@@ -13,3 +21,12 @@
  #define LONDON (SYDNEY+1)
    { "GB-Eire", "London" },
  #define PARIS (LONDON+1)
+@@ -231,7 +230,7 @@
+   { XtNheight, (XtArgVal) 0 },
+ };
+ 
+-void main(argc, argv)
++int main(argc, argv)
+     int argc;
+     char **argv;
+ {



Home | Main Index | Thread Index | Old Index