Source-Changes-HG archive

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

[xsrc/xorg]: xsrc/external/mit/xclock/dist initial import of xclock-1.0.8



details:   https://anonhg.NetBSD.org/xsrc/rev/31dc71618ec2
branches:  xorg
changeset: 10125:31dc71618ec2
user:      mrg <mrg%NetBSD.org@localhost>
date:      Sun Mar 03 08:16:14 2019 +0000

description:
initial import of xclock-1.0.8

diffstat:

 external/mit/xclock/dist/ChangeLog       |   129 +
 external/mit/xclock/dist/Clock.c         |   177 +-
 external/mit/xclock/dist/ClockP.h        |     3 +-
 external/mit/xclock/dist/INSTALL         |   119 +-
 external/mit/xclock/dist/Makefile.am     |     1 +
 external/mit/xclock/dist/Makefile.in     |    57 +-
 external/mit/xclock/dist/README.md       |    19 +
 external/mit/xclock/dist/aclocal.m4      |  3383 +++++++++++++++++------------
 external/mit/xclock/dist/compile         |     2 +-
 external/mit/xclock/dist/config.guess    |   854 +++----
 external/mit/xclock/dist/config.h.in     |     5 +-
 external/mit/xclock/dist/config.sub      |   345 +-
 external/mit/xclock/dist/configure       |  1194 ++++++---
 external/mit/xclock/dist/configure.ac    |    16 +-
 external/mit/xclock/dist/depcomp         |     2 +-
 external/mit/xclock/dist/install-sh      |   354 +-
 external/mit/xclock/dist/man/Makefile.in |    31 +-
 external/mit/xclock/dist/missing         |     6 +-
 18 files changed, 3876 insertions(+), 2821 deletions(-)

diffs (truncated from 10485 to 300 lines):

diff -r 50c7e212baae -r 31dc71618ec2 external/mit/xclock/dist/ChangeLog
--- a/external/mit/xclock/dist/ChangeLog        Sun Mar 03 08:16:13 2019 +0000
+++ b/external/mit/xclock/dist/ChangeLog        Sun Mar 03 08:16:14 2019 +0000
@@ -1,3 +1,132 @@
+commit 9af0790d71fc321d97486aa40b055656d99050c2
+Author: Alan Coopersmith <alan.coopersmith%oracle.com@localhost>
+Date:   Tue Feb 19 14:12:54 2019 -0800
+
+    xclock 1.0.8
+    
+    Signed-off-by: Alan Coopersmith <alan.coopersmith%oracle.com@localhost>
+
+commit a646aa84a8892b091bc7b7b24cfa89f8e628ec0e
+Author: Alan Coopersmith <alan.coopersmith%oracle.com@localhost>
+Date:   Sun Jan 6 15:05:13 2019 -0800
+
+    Replace remaining sprintf calls with snprintf
+    
+    Signed-off-by: Alan Coopersmith <alan.coopersmith%oracle.com@localhost>
+
+commit 62a8e169e13c218dd43e245eea959562769d9ffa
+Author: Alan Coopersmith <alan.coopersmith%oracle.com@localhost>
+Date:   Wed Nov 21 16:59:51 2018 -0800
+
+    Update configure.ac bug URL for gitlab migration
+    
+    Signed-off-by: Alan Coopersmith <alan.coopersmith%oracle.com@localhost>
+
+commit 1297c089414cb17e684803739f47d9dd9ff5dbe6
+Author: Alan Coopersmith <alan.coopersmith%oracle.com@localhost>
+Date:   Fri Nov 16 21:14:58 2018 -0800
+
+    Update README for gitlab migration
+    
+    Signed-off-by: Alan Coopersmith <alan.coopersmith%oracle.com@localhost>
+
+commit 7ad730d892c899df3bb0b51a757ff2c55b6dc6d1
+Author: Keith Packard <keithp%keithp.com@localhost>
+Date:   Sat May 13 23:48:55 2017 -0700
+
+    Allow sub-second updates.
+    
+    Lets you run the clock at whatever tick rate you like.
+    
+    Note that this changes the behaviour of the clock when the update
+    isn't a divisor of the number of seconds in a day. In the old code,
+    the time to display was an integer number of intervals from the start
+    of the year, in the new code, it is an integer number of intervals
+    from the start of the day.
+    
+    I like that better as it makes the seconds consistent from day to day,
+    even if it means an uneven tick at local midnight. Given that I
+    suspect no-one has ever done this in practice, I doubt it really
+    matters.
+    
+    At least the code is simpler now, while supporting updates at the
+    level of the Xt timers, which are milliseconds.
+    
+    Signed-off-by: Keith Packard <keithp%keithp.com@localhost>
+
+commit 9fa28e7fe8dc5e883211b29031446b42cbffe31f
+Author: Mihail Konev <k.mvc%ya.ru@localhost>
+Date:   Thu Jan 26 14:00:20 2017 +1000
+
+    autogen: add default patch prefix
+    
+    Signed-off-by: Mihail Konev <k.mvc%ya.ru@localhost>
+
+commit 436544737f6a2e4f9669517207db62578cf2917c
+Author: Emil Velikov <emil.l.velikov%gmail.com@localhost>
+Date:   Mon Mar 9 12:00:52 2015 +0000
+
+    autogen.sh: use quoted string variables
+    
+    Place quotes around the $srcdir, $ORIGDIR and $0 variables to prevent
+    fall-outs, when they contain space.
+    
+    Signed-off-by: Emil Velikov <emil.l.velikov%gmail.com@localhost>
+    Reviewed-by: Peter Hutterer <peter.hutterer%who-t.net@localhost>
+    Signed-off-by: Peter Hutterer <peter.hutterer%who-t.net@localhost>
+
+commit 6773417208468060d57c90225009f6f3fab4e244
+Author: Peter Hutterer <peter.hutterer%who-t.net@localhost>
+Date:   Tue Jan 24 10:32:07 2017 +1000
+
+    autogen.sh: use exec instead of waiting for configure to finish
+    
+    Syncs the invocation of configure with the one from the server.
+    
+    Signed-off-by: Peter Hutterer <peter.hutterer%who-t.net@localhost>
+    Reviewed-by: Emil Velikov <emil.velikov%collabora.com@localhost>
+
+commit 4697248c5a3e2aa505eceadd45f17554d4424aff
+Author: Jon TURNEY <jon.turney%dronecode.org.uk@localhost>
+Date:   Sun Sep 14 18:08:55 2014 +0100
+
+    No point in trying to use iconv if we don't have nl_langinfo
+    
+    This fixes the build for MinGW
+    
+    Signed-off-by: Jon TURNEY <jon.turney%dronecode.org.uk@localhost>
+    Reviewed-by: Alan Coopersmith <alan.coopersmith%oracle.com@localhost>
+    Reviewed-by: David Macek <david.macek.0%gmail.com@localhost>
+
+commit 67382af06d38fdfd7f08c2bae30a7d5f1bb3fe89
+Author: Alan Coopersmith <alan.coopersmith%oracle.com@localhost>
+Date:   Mon Jun 2 22:12:53 2014 -0700
+
+    autogen.sh: Honor NOCONFIGURE=1
+    
+    See http://people.gnome.org/~walters/docs/build-api.txt
+    
+    Signed-off-by: Alan Coopersmith <alan.coopersmith%oracle.com@localhost>
+
+commit a135ec20812ae83c8afc0d7ce6d8f3f15c4aeafe
+Author: Alan Coopersmith <alan.coopersmith%oracle.com@localhost>
+Date:   Mon Jun 2 22:12:53 2014 -0700
+
+    configure: Drop AM_MAINTAINER_MODE
+    
+    Signed-off-by: Alan Coopersmith <alan.coopersmith%oracle.com@localhost>
+
+commit 0574c56ea9107eab2597b830bc95e3d62e876060
+Author: Alan Coopersmith <alan.coopersmith%oracle.com@localhost>
+Date:   Mon Jun 2 22:12:48 2014 -0700
+
+    config: Add missing AC_CONFIG_SRCDIR
+    
+    Regroup AC statements under the Autoconf initialization section.
+    Regroup AM statements under the Automake initialization section.
+    
+    Signed-off-by: Alan Coopersmith <alan.coopersmith%oracle.com@localhost>
+
 commit 66a2f29e7c649d1eb4079910b0211ffdf7dbbd4d
 Author: Alan Coopersmith <alan.coopersmith%oracle.com@localhost>
 Date:   Sat Sep 7 23:33:09 2013 -0700
diff -r 50c7e212baae -r 31dc71618ec2 external/mit/xclock/dist/Clock.c
--- a/external/mit/xclock/dist/Clock.c  Sun Mar 03 08:16:13 2019 +0000
+++ b/external/mit/xclock/dist/Clock.c  Sun Mar 03 08:16:14 2019 +0000
@@ -87,7 +87,7 @@
 #include <stdio.h>
 #include <X11/Xos.h>
 #include <X11/Xaw/XawInit.h>
-#if !defined(NO_I18N) && defined(HAVE_ICONV)
+#if !defined(NO_I18N) && defined(HAVE_ICONV) && defined(HAVE_NL_LANGINFO)
 #include <iconv.h>
 #include <langinfo.h>
 #include <errno.h>
@@ -145,8 +145,8 @@
        goffset(width), XtRImmediate, (XtPointer) 0},
     {XtNheight, XtCHeight, XtRDimension, sizeof(Dimension),
        goffset(height), XtRImmediate, (XtPointer) 0},
-    {XtNupdate, XtCInterval, XtRInt, sizeof(int),
-        offset(update), XtRImmediate, (XtPointer) 60 },
+    {XtNupdate, XtCInterval, XtRFloat, sizeof(float),
+        offset(update), XtRString, "60.0" },
 #ifndef XRENDER
     {XtNforeground, XtCForeground, XtRPixel, sizeof(Pixel),
         offset(fgpixel), XtRString, XtDefaultForeground},
@@ -226,7 +226,7 @@
 static int clock_round ( double x );
 static Boolean SetValues ( Widget gcurrent, Widget grequest, Widget gnew,
                           ArgList args, Cardinal *num_args );
-#if !defined(NO_I18N) && defined(HAVE_ICONV)
+#if !defined(NO_I18N) && defined(HAVE_ICONV) && defined(HAVE_NL_LANGINFO)
 static char *clock_to_utf8(const char *str, int in_len);
 #endif
 
@@ -521,7 +521,7 @@
       if (w->clock.twentyfour)
       {
          static char brief[6];
-         sprintf (brief, "%02d:%02d", tm->tm_hour, tm->tm_min);
+         snprintf (brief, sizeof(brief), "%02d:%02d", tm->tm_hour, tm->tm_min);
          return brief;
       }
       else
@@ -529,7 +529,7 @@
         static char brief[9];
         int hour = tm->tm_hour % 12;
         if (!hour) hour = 12;
-        sprintf (brief, "%02d:%02d %cM", hour, tm->tm_min,
+        snprintf (brief, sizeof(brief), "%02d:%02d %cM", hour, tm->tm_min,
            tm->tm_hour >= 12 ? 'P' : 'A');
         return brief;
       }
@@ -539,7 +539,8 @@
       static char utime[35];
       Time_t tsec;
       tsec = time(NULL);
-      sprintf (utime, "%10lu seconds since Epoch", (unsigned long)tsec);
+      snprintf (utime, sizeof(utime), "%10lu seconds since Epoch",
+                (unsigned long)tsec);
       return utime;
    } else if (*w->clock.strftime) {
      /*Note: this code is probably excessively paranoid
@@ -584,7 +585,7 @@
     if(!w->clock.analog) {
        char *str;
        struct tm tm;
-       Time_t time_value;
+       struct timeval tv;
        int len;
 
 #ifndef NO_I18N
@@ -612,8 +613,8 @@
        }
 #endif /* NO_I18N */
 
-       (void) time(&time_value);
-       tm = *localtime(&time_value);
+       (void) gettimeofday(&tv, NULL);
+       tm = *localtime(&tv.tv_sec);
        str = TimeString (w, &tm);
        len = strlen(str);
        if (len && str[len - 1] == '\n') str[--len] = '\0';
@@ -623,13 +624,13 @@
        {
        XGlyphInfo  extents;
 #ifndef NO_I18N
-# ifdef HAVE_ICONV
+# if defined(HAVE_ICONV) && defined(HAVE_NL_LANGINFO)
        char *utf8_str;
 # endif
        if (w->clock.utf8)
            XftTextExtentsUtf8 (XtDisplay (w), w->clock.face,
                                (FcChar8 *) str, len, &extents);
-# ifdef HAVE_ICONV
+# if defined(HAVE_ICONV) && defined(HAVE_NL_LANGINFO)
        else if ((utf8_str = clock_to_utf8(str, len)) != NULL) {
                XftTextExtentsUtf8 (XtDisplay (w), w->clock.face,
                        (FcChar8 *)utf8_str, strlen(utf8_str), &extents);
@@ -724,7 +725,7 @@
 
     /* make invalid update's use a default */
     /*if (w->clock.update <= 0) w->clock.update = 60;*/
-    w->clock.show_second_hand = (abs(w->clock.update) <= SECOND_HAND_TIME);
+    w->clock.show_second_hand = (abs((int) w->clock.update) <= SECOND_HAND_TIME);
     w->clock.numseg = 0;
     w->clock.interval_id = 0;
     memset (&w->clock.otm, '\0', sizeof (w->clock.otm));
@@ -814,7 +815,7 @@
     int            x, y;
 
 #ifndef NO_I18N
-# ifdef HAVE_ICONV
+# if defined(HAVE_ICONV) && defined(HAVE_NL_LANGINFO)
     char *utf8_str;
 # endif
     if (w->clock.utf8)
@@ -824,7 +825,7 @@
        XftTextExtentsUtf8 (XtDisplay (w), w->clock.face,
                            (FcChar8 *) str + off, len - off, &tail);
     }
-# ifdef HAVE_ICONV
+# if defined(HAVE_ICONV) && defined(HAVE_NL_LANGINFO)
     else if ((utf8_str = clock_to_utf8(str, off)) != NULL)
     {
        XftTextExtentsUtf8 (XtDisplay (w), w->clock.face,
@@ -1089,15 +1090,21 @@
 }
 
 static void
-RenderSec (ClockWidget w, struct tm *tm, Boolean draw)
+RenderSec (ClockWidget w, struct tm *tm, struct timeval *tv, Boolean draw)
 {
     double         c, s;
     XPointDouble    poly[10];
     double         inner_x, middle_x, outer_x, far_x;
     double         middle_y;
     double         line_y;
+    double         sec;
 
-    ClockAngle (tm->tm_sec * 60, &c, &s);
+    sec = tm->tm_sec;
+
+    if (w->clock.update < 1.0)
+       sec += tv->tv_usec / 1000000.0;
+
+    ClockAngle ((int) (sec * 60.0), &c, &s);
 
     s = -s;
 
@@ -1248,6 +1255,69 @@
     clock_tic((XtPointer)w, (XtIntervalId *)NULL);
 }
 
+#define USEC_MILLIS(us)        ((unsigned long) (us) / 1000)
+#define SEC_MILLIS(s)  ((unsigned long) (s) * 1000)
+#define MIN_MILLIS(m)  SEC_MILLIS((unsigned long) (m) * 60)
+#define HOUR_MILLIS(h) MIN_MILLIS((unsigned long) (h) * 60)
+#define DAY_MILLIS     HOUR_MILLIS((unsigned long) 24)
+
+#define MIN_SECS(m)    ((unsigned long) (m) * 60)
+#define HOUR_SECS(h)   MIN_SECS((unsigned long) (h) * 60)
+
+/* Seconds since midnight */
+static unsigned long
+time_seconds(struct tm *tm)
+{



Home | Main Index | Thread Index | Old Index