[Git][NTPsec/ntpsec][master] 3 commits: Prevent compiler warning on systems with 32-but time.
Eric S. Raymond
gitlab at mg.gitlab.com
Tue Dec 13 13:19:14 UTC 2016
Eric S. Raymond pushed to branch master at NTPsec / ntpsec
Commits:
e881583b by Eric S. Raymond at 2016-12-13T07:48:49-05:00
Prevent compiler warning on systems with 32-but time.
- - - - -
437881ee by Eric S. Raymond at 2016-12-13T07:58:59-05:00
Revert an inadvertent part of a name change.
- - - - -
76aa3aeb by Eric S. Raymond at 2016-12-13T08:18:15-05:00
Simplify some signatures - gain possible because time64_t is now scalar.
- - - - -
11 changed files:
- include/ntp_calendar.h
- include/ntp_types.h
- include/timespecops.h
- libntp/clocktime.c
- libntp/ntp_calendar.c
- libntp/prettydate.c
- ntpd/ntp_leapsec.c
- ntpd/ntp_timer.c
- ntpd/refclock_nmea.c
- tests/libntp/calendar.c
- tests/libntp/vi64ops.c
Changes:
=====================================
include/ntp_calendar.h
=====================================
--- a/include/ntp_calendar.h
+++ b/include/ntp_calendar.h
@@ -96,8 +96,8 @@ extern systime_func_ptr ntpcal_set_timefunc(systime_func_ptr);
/*
* Convert between 'time_t' and 'time64_t'
*/
-extern time64_t time_to_time64_t(const time_t *);
-extern time_t time64_t_to_time(const time64_t *);
+extern time64_t time_to_time64(const time_t);
+extern time_t time64_to_time(const time64_t);
/*
* Get the build date & time. ATTENTION: The time zone is not specified!
@@ -130,7 +130,7 @@ ntpcal_ntp_to_ntp(uint32_t /* ntp */, const time_t * /* pivot */);
* since midnight.
*/
extern ntpcal_split
-ntpcal_daysplit(const time64_t *);
+ntpcal_daysplit(const time64_t);
/*
* Merge a number of days and a number of seconds into seconds,
@@ -284,14 +284,14 @@ ntpcal_daysplit_to_tm(struct tm * /* utm */, const ntpcal_split * /* ds */,
int32_t /* dof */);
extern int
-ntpcal_time_to_date(struct calendar * /* jd */, const time64_t * /* ts */);
+ntpcal_time_to_date(struct calendar * /* jd */, const time64_t /* ts */);
extern int32_t
ntpcal_periodic_extend(int32_t /* pivot */, int32_t /* value */,
int32_t /* cycle */);
extern int
-ntpcal_ntp64_to_date(struct calendar * /* jd */, const time64_t * /* ntp */);
+ntpcal_ntp64_to_date(struct calendar * /* jd */, const time64_t /* ntp */);
extern int
ntpcal_ntp_to_date(struct calendar * /* jd */, uint32_t /* ntp */,
@@ -316,7 +316,7 @@ extern ntpcal_split
isocal_split_eraweeks(int32_t /* weeks */);
extern int
-isocal_ntp64_to_date(struct isodate * /* id */, const time64_t * /* ntp */);
+isocal_ntp64_to_date(struct isodate * /* id */, const time64_t /* ntp */);
extern int
isocal_ntp_to_date(struct isodate * /* id */, uint32_t /* ntp */,
=====================================
include/ntp_types.h
=====================================
--- a/include/ntp_types.h
+++ b/include/ntp_types.h
@@ -53,17 +53,17 @@ typedef uint64_t time64_t;
#define SET32LAST(n, v) (n) = (((n) & FIRST32MASK) | ((v) & LAST32MASK))
#define GET32FIRST(n) ((n) >> 32)
#define SET32FIRST(n,v) (n) = ((((v) & LAST32MASK) << 32) | ((n) & LAST32MASK))
-#define time64_tlo(n) ((uint32_t)GET32LAST(n))
-#define settime64_tlo(n,v) SET32LAST(n,v)
-#define time64_this(n) ((int32_t)(GET32FIRST(n)))
-#define settime64_this(n,v) SET32FIRST(n,v)
-#define time64_thiu(n) ((uint32_t)(GET32FIRST(n)))
-#define settime64_thiu(n,v) SET32FIRST(n,v)
-#define time64_ts(n) ((int64_t)(n))
-#define settime64_ts(n,v) (n) = ((int64_t)(v))
-#define time64_tu(n) (n)
-#define settime64_tu(n,v) (n) = (v)
-#define negtime64_t(n) (n = ((uint64_t)((((int64_t)(n)) * -1))))
+#define time64lo(n) ((uint32_t)GET32LAST(n))
+#define settime64lo(n,v) SET32LAST(n,v)
+#define time64his(n) ((int32_t)(GET32FIRST(n)))
+#define settime64his(n,v) SET32FIRST(n,v)
+#define time64hiu(n) ((uint32_t)(GET32FIRST(n)))
+#define settime64hiu(n,v) SET32FIRST(n,v)
+#define time64s(n) ((int64_t)(n))
+#define settime64s(n,v) (n) = ((int64_t)(v))
+#define time64u(n) (n)
+#define settime64u(n,v) (n) = (v)
+#define negtime64(n) (n = ((uint64_t)((((int64_t)(n)) * -1))))
typedef uint16_t associd_t; /* association ID */
#define ASSOCID_MAX USHRT_MAX
=====================================
include/timespecops.h
=====================================
--- a/include/timespecops.h
+++ b/include/timespecops.h
@@ -379,9 +379,9 @@ lfp_stamp_to_tspec(
/* copying a time64_t to a time_t needs some care... */
#if NTP_SIZEOF_TIME_T <= 4
- out.tv_sec = (time_t)time64_tlo(sec);
+ out.tv_sec = (time_t)time64lo(sec);
#else
- out.tv_sec = (time_t)time64_ts(sec);
+ out.tv_sec = (time_t)time64s(sec);
#endif
return out;
=====================================
libntp/clocktime.c
=====================================
--- a/libntp/clocktime.c
+++ b/libntp/clocktime.c
@@ -133,7 +133,7 @@ ntp_to_year(
ntpcal_split s;
t = ntpcal_ntp_to_ntp(ntp, NULL);
- s = ntpcal_daysplit(&t);
+ s = ntpcal_daysplit(t);
s = ntpcal_split_eradays(s.hi + DAY_NTP_STARTS - 1, NULL);
return s.hi + 1;
}
=====================================
libntp/ntp_calendar.c
=====================================
--- a/libntp/ntp_calendar.c
+++ b/libntp/ntp_calendar.c
@@ -54,26 +54,23 @@ now(void)
*---------------------------------------------------------------------
*/
time64_t
-time_to_time64_t(
- const time_t * ptt
+time_to_time64(
+ const time_t tt
)
{
time64_t res;
- time_t tt;
-
- tt = *ptt;
#if NTP_SIZEOF_TIME_T <= 4
- settime64_thiu(res, 0);
+ settime64(res, 0);
if (tt < 0) {
- settime64_tlo(res, (uint32_t)-tt);
- negtime64_t(res);
+ settime64lo(res, (uint32_t)-tt);
+ negtime64(res);
} else {
- settime64_tlo(res, (uint32_t)tt);
+ settime64lo(res, (uint32_t)tt);
}
#else
- settime64_ts(res, tt);
+ settime64s(res, tt);
#endif
return res;
@@ -81,17 +78,17 @@ time_to_time64_t(
time_t
-time64_t_to_time(
- const time64_t *tv
+time64_to_time(
+ const time64_t tv
)
{
time_t res;
#if NTP_SIZEOF_TIME_T <= 4
- res = (time_t)time64_tlo(*tv);
+ res = (time_t)time64lo(tv);
#else
- res = (time_t)time64_ts(*tv);
+ res = (time_t)time64s(tv);
#endif
return res;
@@ -382,11 +379,11 @@ ntpcal_ntp_to_time(
{
time64_t res;
- settime64_ts(res, (pivot != NULL) ? *pivot : now());
- settime64_tu(res, time64_tu(res)-0x80000000); /* unshift of half range */
+ settime64s(res, (pivot != NULL) ? *pivot : now());
+ settime64u(res, time64u(res)-0x80000000); /* unshift of half range */
ntp -= (uint32_t)JAN_1970; /* warp into UN*X domain */
- ntp -= time64_tlo(res); /* cycle difference */
- settime64_tu(res, time64_tu(res)+(uint64_t)ntp); /* get expanded time */
+ ntp -= time64lo(res); /* cycle difference */
+ settime64u(res, time64u(res)+(uint64_t)ntp); /* get expanded time */
return res;
}
@@ -412,12 +409,12 @@ ntpcal_ntp_to_ntp(
{
time64_t res;
- settime64_ts(res, (pivot) ? *pivot : now());
- settime64_tu(res, time64_tu(res) - 0x80000000); /* unshift of half range */
- settime64_tu(res, time64_tu(res) + (uint32_t)JAN_1970); /* warp into NTP domain */
+ settime64s(res, (pivot) ? *pivot : now());
+ settime64u(res, time64u(res) - 0x80000000); /* unshift of half range */
+ settime64u(res, time64u(res) + (uint32_t)JAN_1970); /* warp into NTP domain */
- ntp -= time64_tlo(res); /* cycle difference */
- settime64_tu(res, time64_tu(res) + (uint64_t)ntp); /* get expanded time */
+ ntp -= time64lo(res); /* cycle difference */
+ settime64u(res, time64u(res) + (uint64_t)ntp); /* get expanded time */
return res;
}
@@ -441,14 +438,14 @@ ntpcal_ntp_to_ntp(
*/
ntpcal_split
ntpcal_daysplit(
- const time64_t *ts
+ const time64_t ts
)
{
ntpcal_split res;
/* manual floor division by SECSPERDAY */
- res.hi = (int32_t)(time64_ts(*ts) / SECSPERDAY);
- res.lo = (int32_t)(time64_ts(*ts) % SECSPERDAY);
+ res.hi = (int32_t)(time64s(ts) / SECSPERDAY);
+ res.lo = (int32_t)(time64s(ts) % SECSPERDAY);
if (res.lo < 0) {
res.hi -= 1;
res.lo += SECSPERDAY;
@@ -761,7 +758,7 @@ ntpcal_daysplit_to_tm(
int
ntpcal_time_to_date(
struct calendar *jd,
- const time64_t *ts
+ const time64_t ts
)
{
ntpcal_split ds;
@@ -796,9 +793,9 @@ ntpcal_dayjoin(
{
time64_t res;
- settime64_ts(res, days);
- settime64_ts(res, time64_ts(res) * SECSPERDAY);
- settime64_ts(res, time64_ts(res) + secs);
+ settime64s(res, days);
+ settime64s(res, time64s(res) * SECSPERDAY);
+ settime64s(res, time64s(res) + secs);
return res;
}
@@ -1102,14 +1099,14 @@ ntpcal_date_to_time(
secs = ntpcal_date_to_daysec(jd);
join = ntpcal_dayjoin(days, secs);
- return time64_t_to_time(&join);
+ return time64_to_time(join);
}
int
ntpcal_ntp64_to_date(
struct calendar *jd,
- const time64_t *ntp
+ const time64_t ntp
)
{
ntpcal_split ds;
@@ -1135,7 +1132,7 @@ ntpcal_ntp_to_date(
* process the parts.
*/
ntp64 = ntpcal_ntp_to_ntp(ntp, piv);
- return ntpcal_ntp64_to_date(jd, &ntp64);
+ return ntpcal_ntp64_to_date(jd, ntp64);
}
@@ -1160,7 +1157,7 @@ ntpcal_date_to_ntp(
/*
* Get lower half of 64-bit NTP timestamp from date/time.
*/
- return time64_tlo(ntpcal_date_to_ntp64(jd));
+ return time64lo(ntpcal_date_to_ntp64(jd));
}
@@ -1367,7 +1364,7 @@ isocal_split_eraweeks(
int
isocal_ntp64_to_date(
struct isodate *id,
- const time64_t *ntp
+ const time64_t ntp
)
{
ntpcal_split ds;
@@ -1416,7 +1413,7 @@ isocal_ntp_to_date(
* convert the full time stamp.
*/
ntp64 = ntpcal_ntp_to_ntp(ntp, piv);
- return isocal_ntp64_to_date(id, &ntp64);
+ return isocal_ntp64_to_date(id, ntp64);
}
/*
@@ -1447,7 +1444,7 @@ isocal_date_to_ntp(
/*
* Get lower half of 64-bit NTP timestamp from date/time.
*/
- return time64_tlo(isocal_date_to_ntp64(id));
+ return time64lo(isocal_date_to_ntp64(id));
}
/* -*-EOF-*- */
=====================================
libntp/prettydate.c
=====================================
--- a/libntp/prettydate.c
+++ b/libntp/prettydate.c
@@ -60,7 +60,7 @@ get_struct_tm(
time_t ts;
int64_t tl;
- ts = tl = time64_ts(*stamp);
+ ts = tl = time64s(*stamp);
/*
* If there is chance of truncation, try to fix it. Let the
@@ -146,7 +146,7 @@ common_prettydate(
* ntpcal_time_to_date()
*/
struct calendar jd;
- ntpcal_time_to_date(&jd, &sec);
+ ntpcal_time_to_date(&jd, sec);
snprintf(bp, LIB_BUFLENGTH, pfmt,
(u_long)ts->l_ui, (u_long)ts->l_uf,
jd.year, jd.month, jd.monthday,
=====================================
ntpd/ntp_leapsec.c
=====================================
--- a/ntpd/ntp_leapsec.c
+++ b/ntpd/ntp_leapsec.c
@@ -80,7 +80,7 @@ static bool betweenu32(uint32_t, uint32_t, uint32_t);
static void reset_times(leap_table_t*);
static bool leapsec_add(leap_table_t*, const time64_t, int);
static bool leapsec_raw(leap_table_t*, const time64_t, int, int);
-static char * lstostr(const time64_t * ts);
+static char * lstostr(const time64_t ts);
/* =====================================================================
* Get & Set the current leap table
@@ -185,18 +185,18 @@ leapsec_load(
cp++;
if (*cp == '@') {
cp = skipws(cp+1);
- settime64_tu(pt->head.expire, strtoull(cp, &ep, 10));
+ settime64u(pt->head.expire, strtoull(cp, &ep, 10));
if (parsefail(cp, ep))
goto fail_read;
- pt->lsig.etime = time64_tlo(pt->head.expire);
+ pt->lsig.etime = time64lo(pt->head.expire);
} else if (*cp == '$') {
cp = skipws(cp+1);
- settime64_tu(pt->head.update, strtoull(cp, &ep, 10));
+ settime64u(pt->head.update, strtoull(cp, &ep, 10));
if (parsefail(cp, ep))
goto fail_read;
}
} else if (isdigit((uint8_t)*cp)) {
- settime64_tu(ttime, strtoull(cp, &ep, 10));
+ settime64u(ttime, strtoull(cp, &ep, 10));
if (parsefail(cp, ep))
goto fail_read;
cp = skipws(ep);
@@ -211,7 +211,7 @@ leapsec_load(
} else {
pt->head.base_tai = (int16_t)taiof;
}
- pt->lsig.ttime = time64_tlo(ttime);
+ pt->lsig.ttime = time64lo(ttime);
pt->lsig.taiof = (int16_t)taiof;
}
}
@@ -238,16 +238,16 @@ leapsec_dump(
time64_t ts;
struct calendar atb, ttb;
- ntpcal_ntp64_to_date(&ttb, &pt->head.expire);
+ ntpcal_ntp64_to_date(&ttb, pt->head.expire);
(*func)(farg, "leap table (%u entries) expires at %04u-%02u-%02u:\n",
pt->head.size,
ttb.year, ttb.month, ttb.monthday);
idx = pt->head.size;
while (idx-- != 0) {
ts = pt->info[idx].ttime;
- ntpcal_ntp64_to_date(&ttb, &ts);
+ ntpcal_ntp64_to_date(&ttb, ts);
ts = ts - pt->info[idx].stime;
- ntpcal_ntp64_to_date(&atb, &ts);
+ ntpcal_ntp64_to_date(&atb, ts);
(*func)(farg, "%04u-%02u-%02u [%c] (%04u-%02u-%02u) - %d\n",
ttb.year, ttb.month, ttb.monthday,
@@ -294,14 +294,14 @@ leapsec_query(
* both modes is easier to maintain.
*/
last = pt->head.ttime;
- qr->warped = (int16_t)(time64_tlo(last) -
- time64_tlo(pt->head.dtime));
+ qr->warped = (int16_t)(time64lo(last) -
+ time64lo(pt->head.dtime));
next = ts64 + qr->warped;
reload_limits(pt, next);
fired = (pt->head.ebase == last);
if (fired) {
ts64 = next;
- ts32 = time64_tlo(next);
+ ts32 = time64lo(next);
} else {
qr->warped = 0;
}
@@ -314,7 +314,7 @@ leapsec_query(
return fired;
/* now start to collect the remaining data */
- due32 = time64_tlo(pt->head.dtime);
+ due32 = time64lo(pt->head.dtime);
qr->tai_diff = pt->head.next_tai - pt->head.this_tai;
qr->ttime = pt->head.ttime;
@@ -431,12 +431,12 @@ leapsec_load_stream(
if (pt->head.size)
msyslog(LOG_NOTICE, "%s ('%s'): loaded, expire=%s last=%s ofs=%d",
- logPrefix, fname, lstostr(&pt->head.expire),
- lstostr(&pt->info[0].ttime), pt->info[0].taiof);
+ logPrefix, fname, lstostr(pt->head.expire),
+ lstostr(pt->info[0].ttime), pt->info[0].taiof);
else
msyslog(LOG_NOTICE,
"%s ('%s'): loaded, expire=%s ofs=%d (no entries after build date)",
- logPrefix, fname, lstostr(&pt->head.expire),
+ logPrefix, fname, lstostr(pt->head.expire),
pt->head.base_tai);
return leapsec_set_table(pt);
@@ -543,7 +543,7 @@ leapsec_daystolive(
pt = leapsec_get_table(false);
limit = ntpcal_ntp_to_ntp(when, tpiv);
limit = pt->head.expire - limit;
- return ntpcal_daysplit(&limit).hi;
+ return ntpcal_daysplit(limit).hi;
}
/* ------------------------------------------------------------------ */
@@ -795,7 +795,7 @@ leapsec_add(
return false;
}
- ntpcal_ntp64_to_date(&fts, &now64);
+ ntpcal_ntp64_to_date(&fts, now64);
/* To guard against dangling leap flags: do not accept leap
* second request on the 1st hour of the 1st day of the month.
*/
@@ -814,7 +814,7 @@ leapsec_add(
ttime = ntpcal_date_to_ntp64(&fts);
li.ttime = ttime;
- li.stime = time64_tlo(ttime) - time64_tlo(starttime);
+ li.stime = time64lo(ttime) - time64lo(starttime);
li.taiof = (pt->head.size ? pt->info[0].taiof : pt->head.base_tai)
+ (insert ? 1 : -1);
li.dynls = 1;
@@ -843,7 +843,7 @@ leapsec_raw(
return false;
}
- ntpcal_ntp64_to_date(&fts, &ttime);
+ ntpcal_ntp64_to_date(&fts, ttime);
/* If this does not match the exact month start, bail out. */
if (fts.monthday != 1 || fts.hour || fts.minute || fts.second) {
errno = EINVAL;
@@ -852,7 +852,7 @@ leapsec_raw(
fts.month--; /* was in range 1..12, no overflow here! */
starttime = ntpcal_date_to_ntp64(&fts);
li.ttime = ttime;
- li.stime = time64_tlo(ttime) - time64_tlo(starttime);
+ li.stime = time64lo(ttime) - time64lo(starttime);
li.taiof = (int16_t)taiof;
li.dynls = (dynls != 0);
return add_range(pt, &li);
@@ -986,7 +986,7 @@ leapsec_validate(
* lstostr - prettyprint NTP seconds
*/
static char * lstostr(
- const time64_t * ts)
+ const time64_t ts)
{
char * buf;
struct calendar tm;
=====================================
ntpd/ntp_timer.c
=====================================
--- a/ntpd/ntp_timer.c
+++ b/ntpd/ntp_timer.c
@@ -426,7 +426,7 @@ check_leapsec(
if (lsdata.tai_diff) {
if (leap_smear.interval == 0) {
leap_smear.interval = leap_smear_intv;
- leap_smear.intv_end = time64_tu(lsdata.ttime);
+ leap_smear.intv_end = time64u(lsdata.ttime);
leap_smear.intv_start = leap_smear.intv_end - leap_smear.interval;
DPRINTF(1, ("*** leapsec_query: setting leap_smear interval %li, begin %.0f, end %.0f\n",
leap_smear.interval, leap_smear.intv_start, leap_smear.intv_end));
=====================================
ntpd/refclock_nmea.c
=====================================
--- a/ntpd/refclock_nmea.c
+++ b/ntpd/refclock_nmea.c
@@ -1651,7 +1651,7 @@ unfold_day(
* in split representation.
*/
rec_qw = ntpcal_ntp_to_ntp(rec_ui - SECSPERDAY/2, NULL);
- rec_ds = ntpcal_daysplit(&rec_qw);
+ rec_ds = ntpcal_daysplit(rec_qw);
rec_ds.lo = ntpcal_periodic_extend(rec_ds.lo,
ntpcal_date_to_daysec(jd),
SECSPERDAY);
@@ -1806,7 +1806,7 @@ eval_gps_time(
/* If we fully trust the GPS receiver, just combine days and
* seconds and be done. */
if (peer->ttl & NMEA_DATETRUST_MASK) {
- retv.l_ui = time64_tlo(ntpcal_dayjoin(gps_day, gps_sec));
+ retv.l_ui = time64lo(ntpcal_dayjoin(gps_day, gps_sec));
return retv;
}
@@ -1835,7 +1835,7 @@ eval_gps_time(
/* - get unfold base: day of full recv time - 512 weeks */
vi64 = ntpcal_ntp_to_ntp(xrecv->l_ui, NULL);
- rs64 = ntpcal_daysplit(&vi64);
+ rs64 = ntpcal_daysplit(vi64);
rcv_sec = rs64.lo;
rcv_day = rs64.hi - 512 * 7;
@@ -1864,7 +1864,7 @@ eval_gps_time(
}
/* - build result and be done */
- retv.l_ui = time64_tlo(ntpcal_dayjoin(adj_day, gps_sec));
+ retv.l_ui = time64lo(ntpcal_dayjoin(adj_day, gps_sec));
return retv;
}
=====================================
tests/libntp/calendar.c
=====================================
--- a/tests/libntp/calendar.c
+++ b/tests/libntp/calendar.c
@@ -130,7 +130,7 @@ TEST(calendar, DaySplitMerge) {
for (day = -1000000; day <= 1000000; day += 100) {
for (sec = -100000; sec <= 186400; sec += 10000) {
time64_t merge = ntpcal_dayjoin(day, sec);
- ntpcal_split split = ntpcal_daysplit(&merge);
+ ntpcal_split split = ntpcal_daysplit(merge);
int32_t eday = day;
int32_t esec = sec;
=====================================
tests/libntp/vi64ops.c
=====================================
--- a/tests/libntp/vi64ops.c
+++ b/tests/libntp/vi64ops.c
@@ -13,45 +13,45 @@ TEST_TEAR_DOWN(vi64ops) {}
TEST(vi64ops, HiLoVUI64uh) {
time64_t exp = 0;
- settime64_thiu(exp, 0x01234567);
- settime64_tlo(exp, 0x89ABCDEF);
- TEST_ASSERT_EQUAL(time64_thiu(exp), 0x01234567);
+ settime64hiu(exp, 0x01234567);
+ settime64lo(exp, 0x89ABCDEF);
+ TEST_ASSERT_EQUAL(time64hiu(exp), 0x01234567);
}
TEST(vi64ops, HiLoVUI64ul) {
time64_t exp = 0;
- settime64_thiu(exp, 0x01234567);
- settime64_tlo(exp, 0x89ABCDEF);
- TEST_ASSERT_EQUAL(time64_tlo(exp), 0x89ABCDEF);
+ settime64hiu(exp, 0x01234567);
+ settime64lo(exp, 0x89ABCDEF);
+ TEST_ASSERT_EQUAL(time64lo(exp), 0x89ABCDEF);
}
TEST(vi64ops, SetVUI64s_pos) {
time64_t exp = 0;
- settime64_ts(exp, 0x0123456789ABCDEF);
- TEST_ASSERT_EQUAL(time64_ts(exp), 81985529216486895);
+ settime64s(exp, 0x0123456789ABCDEF);
+ TEST_ASSERT_EQUAL(time64s(exp), 81985529216486895);
}
TEST(vi64ops, SetVUI64s_neg) {
time64_t exp = 0;
- settime64_ts(exp, 0xFEDCBA9876543210);
- TEST_ASSERT_EQUAL(time64_ts(exp), -81985529216486896);
+ settime64s(exp, 0xFEDCBA9876543210);
+ TEST_ASSERT_EQUAL(time64s(exp), -81985529216486896);
}
TEST(vi64ops, SetVUI64u) {
time64_t exp = 0;
- settime64_tu(exp, 0xFEDCBA9876543210); /* sign bit is on */
- TEST_ASSERT_EQUAL(time64_ts(exp), 18364758544493064720UL);
+ settime64u(exp, 0xFEDCBA9876543210); /* sign bit is on */
+ TEST_ASSERT_EQUAL(time64s(exp), 18364758544493064720UL);
}
TEST(vi64ops, NegVUI64) {
time64_t exp = 0;
- settime64_ts(exp, 71985529216486896);
- TEST_ASSERT_EQUAL(negtime64_t(exp), -71985529216486896);
+ settime64s(exp, 71985529216486896);
+ TEST_ASSERT_EQUAL(negtime64(exp), -71985529216486896);
}
TEST_GROUP_RUNNER(vi64ops) {
View it on GitLab: https://gitlab.com/NTPsec/ntpsec/compare/b901d4ac894b0168dbe4c2959514799b2cc34e3e...76aa3aebfbb8397cb5212df4034aaeac1b858c38
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ntpsec.org/pipermail/vc/attachments/20161213/9c49dbdd/attachment.html>
More information about the vc
mailing list