diff --git a/phc2sys.c b/phc2sys.c index edf1907..d0c97ae 100644 --- a/phc2sys.c +++ b/phc2sys.c @@ -28,6 +28,7 @@ #include #include #include +#include #include #include @@ -141,7 +142,7 @@ static struct servo servo; static void show_servo(FILE *fp, const char *label, int64_t offset, uint64_t ts) { - fprintf(fp, "%s %9lld s%d %lld.%09llu drift %.2f\n", label, offset, + fprintf(fp, "%s %9" PRId64 " s%d %lld.%09llu drift %.2f\n", label, offset, servo.state, ts / NS_PER_SEC, ts % NS_PER_SEC, servo.drift); fflush(fp); } diff --git a/pmc.c b/pmc.c index b852b88..5efcbe5 100644 --- a/pmc.c +++ b/pmc.c @@ -23,6 +23,7 @@ #include #include #include +#include #include "ds.h" #include "fsm.h" @@ -282,12 +283,12 @@ static void pmc_show(struct ptp_message *msg, FILE *fp) case TIME_STATUS_NP: tsn = (struct time_status_np *) mgt->data; fprintf(fp, "TIME_STATUS_NP " - IFMT "master_offset %lld" - IFMT "ingress_time %lld" + IFMT "master_offset %" PRId64 + IFMT "ingress_time %" PRId64 IFMT "cumulativeScaledRateOffset %+.9f" IFMT "scaledLastGmPhaseChange %d" IFMT "gmTimeBaseIndicator %hu" - IFMT "lastGmPhaseChange 0x%04hx'%016llx.%04hx" + IFMT "lastGmPhaseChange 0x%04hx'%016" PRIx64 ".%04hx" IFMT "gmPresent %s" IFMT "gmIdentity %s", tsn->master_offset, @@ -310,7 +311,7 @@ static void pmc_show(struct ptp_message *msg, FILE *fp) IFMT "portIdentity %s" IFMT "portState %s" IFMT "logMinDelayReqInterval %hhd" - IFMT "peerMeanPathDelay %lld" + IFMT "peerMeanPathDelay %" PRId64 IFMT "logAnnounceInterval %hhd" IFMT "announceReceiptTimeout %hhu" IFMT "logSyncInterval %hhd"