Source-Changes-HG archive

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

[src/trunk]: src/dist/ntp fix some LP64 issues (ntp bug #233)



details:   https://anonhg.NetBSD.org/src/rev/b9d5b3c15846
branches:  trunk
changeset: 555929:b9d5b3c15846
user:      drochner <drochner%NetBSD.org@localhost>
date:      Thu Dec 04 17:10:34 2003 +0000

description:
fix some LP64 issues (ntp bug #233)

diffstat:

 dist/ntp/ntpd/refclock_oncore.c |   7 ++++---
 dist/ntp/ntpd/refclock_shm.c    |   6 ++++--
 dist/ntp/ntpdc/ntpdc_ops.c      |  12 ++++++------
 3 files changed, 14 insertions(+), 11 deletions(-)

diffs (94 lines):

diff -r e5e7f766623e -r b9d5b3c15846 dist/ntp/ntpd/refclock_oncore.c
--- a/dist/ntp/ntpd/refclock_oncore.c   Thu Dec 04 17:06:12 2003 +0000
+++ b/dist/ntp/ntpd/refclock_oncore.c   Thu Dec 04 17:10:34 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: refclock_oncore.c,v 1.3 2003/12/04 16:23:37 drochner Exp $     */
+/*     $NetBSD: refclock_oncore.c,v 1.4 2003/12/04 17:10:34 drochner Exp $     */
 
 /*
  * ----------------------------------------------------------------------------
@@ -1011,7 +1011,8 @@
                return;
        }
 
-       sprintf(Msg, "SHMEM (size = %d) is CONFIGURED and available as %s", shmem_length, instance->shmem_fname);
+       sprintf(Msg, "SHMEM (size = %ld) is CONFIGURED and available as %s",
+         (long)shmem_length, instance->shmem_fname);
        record_clock_stats(&(instance->peer->srcadr), Msg);
 }
 #endif /* ONCORE_SHMEM_STATUS */
@@ -3262,7 +3263,7 @@
                                kk = buf_w32(cp + 23);
 {
 char Msg[160];
-sprintf(Msg, "SHMEM posn = %d (%d, %d, %d)", cp-instance->shmem, ii, jj, kk);
+sprintf(Msg, "SHMEM posn = %ld (%d, %d, %d)", (long)(cp-instance->shmem), ii, jj, kk);
 record_clock_stats(&(instance->peer->srcadr), Msg);
 }
                                if (ii != 0 || jj != 0 || kk != 0) { /* phk asked for this test */
diff -r e5e7f766623e -r b9d5b3c15846 dist/ntp/ntpd/refclock_shm.c
--- a/dist/ntp/ntpd/refclock_shm.c      Thu Dec 04 17:06:12 2003 +0000
+++ b/dist/ntp/ntpd/refclock_shm.c      Thu Dec 04 17:10:34 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: refclock_shm.c,v 1.2 2003/12/04 16:23:37 drochner Exp $        */
+/*     $NetBSD: refclock_shm.c,v 1.3 2003/12/04 17:10:34 drochner Exp $        */
 
 /*
  * refclock_shm - clock driver for utc via shared memory 
@@ -268,11 +268,13 @@
                }
                up->valid=0;
                if (ok) {
+                       time_t help; /* XXX NetBSD has incompatible tv_sec */
                        TVTOTS(&tvr,&pp->lastrec);
                        pp->lastrec.l_ui += JAN_1970;
                        /* pp->lasttime = current_time; */
                        pp->polls++;
-                       t=gmtime (&tvt.tv_sec);
+                       help = tvt.tv_sec;
+                       t=gmtime (&help);
                        pp->day=t->tm_yday+1;
                        pp->hour=t->tm_hour;
                        pp->minute=t->tm_min;
diff -r e5e7f766623e -r b9d5b3c15846 dist/ntp/ntpdc/ntpdc_ops.c
--- a/dist/ntp/ntpdc/ntpdc_ops.c        Thu Dec 04 17:06:12 2003 +0000
+++ b/dist/ntp/ntpdc/ntpdc_ops.c        Thu Dec 04 17:10:34 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ntpdc_ops.c,v 1.3 2003/12/04 16:23:38 drochner Exp $   */
+/*     $NetBSD: ntpdc_ops.c,v 1.4 2003/12/04 17:10:34 drochner Exp $   */
 
 /*
  * ntpdc_ops.c - subroutines which are called to perform operations by xntpdc
@@ -864,10 +864,10 @@
                NTOHL_FP(&il->drift_comp, &temp2ts);
 
                (void) fprintf(fp,
-                              "offset %s, frequency %s, time_const %ld, watchdog %ld\n",
+                              "offset %s, frequency %s, time_const %d, watchdog %ld\n",
                               lfptoa(&tempts, 6),
                               lfptoa(&temp2ts, 3),
-                              (u_long)ntohl(il->compliance),
+                              (int)ntohl(il->compliance),
                               (u_long)ntohl(il->watchdog_timer));
        } else {
                NTOHL_FP(&il->last_offset, &tempts);
@@ -876,8 +876,8 @@
                NTOHL_FP(&il->drift_comp, &tempts);
                (void) fprintf(fp, "frequency:            %s ppm\n",
                               lfptoa(&tempts, 3));
-               (void) fprintf(fp, "poll adjust:          %ld\n",
-                              (u_long)ntohl(il->compliance));
+               (void) fprintf(fp, "poll adjust:          %d\n",
+                              (int)ntohl(il->compliance));
                (void) fprintf(fp, "watchdog timer:       %ld s\n",
                               (u_long)ntohl(il->watchdog_timer));
        }
@@ -2921,7 +2921,7 @@
                tscale = 1e-9;
 #endif
        (void)fprintf(fp, "pll offset:           %g s\n",
-           (long)ntohl(ik->offset) * tscale);
+           (int)ntohl(ik->offset) * tscale);
        (void)fprintf(fp, "pll frequency:        %s ppm\n",
            fptoa((s_fp)ntohl(ik->freq), 3));
        (void)fprintf(fp, "maximum error:        %g s\n",



Home | Main Index | Thread Index | Old Index