[Git][NTPsec/ntpsec][master] Literal suffixes should be upper case
Matt Selsky
gitlab at mg.gitlab.com
Sat Jan 26 18:35:03 UTC 2019
Matt Selsky pushed to branch master at NTPsec / ntpsec
Commits:
8e770dce by Matt Selsky at 2019-01-26T18:31:34Z
Literal suffixes should be upper case
- - - - -
9 changed files:
- attic/sht.c
- libntp/clocktime.c
- libntp/prettydate.c
- ntpd/refclock_generic.c
- ntpd/refclock_gpsd.c
- ntpd/refclock_oncore.c
- tests/libntp/lfpfunc.c
- tests/libntp/strtolfp.c
- tests/ntpd/leapsec.c
Changes:
=====================================
attic/sht.c
=====================================
@@ -161,7 +161,7 @@ again:
else
{
time(&rcv_sec);
- rcv_frc = (unsigned int)ntp_random() % 1000000000u;
+ rcv_frc = (unsigned int)ntp_random() % 1000000000U;
}
/* add a wobble of ~3.5msec to the clock time */
clk_sec = rcv_sec;
=====================================
libntp/clocktime.c
=====================================
@@ -110,7 +110,7 @@ clocktime(
test[0] = (uint32_t)(*yearstart) + (unsigned int)tmp;
/* -- calc absolute difference to receive time */
diff[0] = test[0] - rec_ui;
- if (diff[0] >= 0x80000000u)
+ if (diff[0] >= 0x80000000U)
diff[0] = ~diff[0] + 1;
/* -- can't get closer if diff < NEARTIME */
if (diff[0] < NEARTIME) {
@@ -137,7 +137,7 @@ clocktime(
test[idx] = ystt[idx] + tmp;
/* -- calc absolute difference to receive time */
diff[idx] = test[idx] - rec_ui;
- if (diff[idx] >= 0x80000000u)
+ if (diff[idx] >= 0x80000000U)
diff[idx] = ~diff[idx] + 1;
}
/* -*- assume current year fits best, then search best fit */
=====================================
libntp/prettydate.c
=====================================
@@ -140,8 +140,8 @@ common_prettydate(
/* get & fix milliseconds */
ntps = lfpuint(ts);
msec = lfpfrac(ts) / 4294967; /* fract / (2 ** 32 / 1000) */
- if (msec >= 1000u) {
- msec -= 1000u;
+ if (msec >= 1000U) {
+ msec -= 1000U;
ntps++;
}
sec = ntpcal_ntp_to_time(ntps, prettypivot);
=====================================
ntpd/refclock_generic.c
=====================================
@@ -5066,7 +5066,7 @@ trimbletsip_message(
case CMD_RMESSAGE:
mkreadable(t, (int)BUFFER_SIZE(pbuffer, t),
(char *)&mb(0),
- (unsigned)(size - 2u -
+ (unsigned)(size - 2U -
(unsigned)(&mb(0) - buffer)),
0);
break;
=====================================
ntpd/refclock_gpsd.c
=====================================
@@ -1636,7 +1636,7 @@ process_pps(
* primary channel. Sanity checks are done in evaluation step.
*/
up->pps_stamp = up->pps_recvt;
- up->pps_stamp += 0x80000000u;
+ up->pps_stamp += 0x80000000U;
setlfpfrac(up->pps_stamp, 0);
if (NULL != up->pps_peer)
=====================================
ntpd/refclock_oncore.c
=====================================
@@ -3251,7 +3251,7 @@ oncore_msg_Gj(
oncore_log_f(instance, LOG_NOTICE,
"Leap second %s (%d) before %04u-%02u-%02u/%02u:%02u:%02u",
insrem[(dt > 0)], dt,
- 256u * buf[6] + buf[7], buf[8], buf[9],
+ 256U * buf[6] + buf[7], buf[8], buf[9],
buf[15], buf[16], buf[17]);
/* Only raise warning within a month of the leap second */
=====================================
tests/libntp/lfpfunc.c
=====================================
@@ -88,7 +88,7 @@ static l_fp l_fp_abs(const l_fp first)
static int l_fp_signum(const l_fp first)
{
- if (lfpuint(first) & 0x80000000u)
+ if (lfpuint(first) & 0x80000000U)
return -1;
return (lfpuint(first) || lfpfrac(first));
}
=====================================
tests/libntp/strtolfp.c
=====================================
@@ -121,7 +121,7 @@ atolfp(
if (isneg)
{
- (dec_f) = ~(dec_f) + 1u;
+ (dec_f) = ~(dec_f) + 1U;
(dec_i) = ~(dec_i) + ((dec_f) == 0);
}
=====================================
tests/ntpd/leapsec.c
=====================================
@@ -237,8 +237,8 @@ static const char leap_gthash [] = {
"#h 1151a8f e85a5069 9000fcdb 3d5e5365 1d505b37"
};
-static time_t lsec2009 = 3439756800u - JAN_1970; // 1 Jan 2009, 00:00:00 utc
-static time_t lsec2012 = 3550089600u - JAN_1970; // 1 Jul 2012, 00:00:00 utc
+static time_t lsec2009 = 3439756800U - JAN_1970; // 1 Jan 2009, 00:00:00 utc
+static time_t lsec2012 = 3550089600U - JAN_1970; // 1 Jul 2012, 00:00:00 utc
static int stringreader(void* farg)
{
@@ -393,9 +393,9 @@ TEST(leapsec, loadFileExpire) {
rc = leapsec_load(pt, stringreader, &cp)
&& leapsec_set_table(pt);
TEST_ASSERT_EQUAL(1, rc);
- rc = leapsec_expired(3439756800u - JAN_1970);
+ rc = leapsec_expired(3439756800U - JAN_1970);
TEST_ASSERT_EQUAL(0, rc);
- rc = leapsec_expired(3610569601u - JAN_1970);
+ rc = leapsec_expired(3610569601U - JAN_1970);
TEST_ASSERT_EQUAL(1, rc);
}
@@ -406,7 +406,7 @@ TEST(leapsec, loadFileTTL) {
int rc;
leap_table_t * pt = leapsec_get_table(0);
- const time_t limit = 3610569600u - JAN_1970;
+ const time_t limit = 3610569600U - JAN_1970;
rc = leapsec_load(pt, stringreader, &cp)
&& leapsec_set_table(pt);
View it on GitLab: https://gitlab.com/NTPsec/ntpsec/commit/8e770dce92a9c4a1771c046593b701377ee6c568
--
View it on GitLab: https://gitlab.com/NTPsec/ntpsec/commit/8e770dce92a9c4a1771c046593b701377ee6c568
You're receiving this email because of your account on gitlab.com.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ntpsec.org/pipermail/vc/attachments/20190126/90fbaf39/attachment-0001.html>
More information about the vc
mailing list