Procházet zdrojové kódy

core: use PRIu64 macro to find out what format is needed for uint64_t

since it depends on architecture
Victor Seva před 2 roky
rodič
revize
8841257671
1 změnil soubory, kde provedl 6 přidání a 5 odebrání
  1. 6 5
      src/core/utils/tmrec.c

+ 6 - 5
src/core/utils/tmrec.c

@@ -32,6 +32,7 @@
 #include <string.h>
 #include <time.h>
 #include <stdint.h>
+#include <inttypes.h>
 
 #include "../../core/mem/mem.h"
 #include "tmrec.h"
@@ -272,7 +273,7 @@ int ac_print(ac_tm_t *_atp)
 		return -1;
 	}
 
-	printf("\nSys time: %lu\nTime: %02d:%02d:%02d\n", (uint64_t)_atp->time,
+	printf("\nSys time: %" PRIu64 "\nTime: %02d:%02d:%02d\n", (uint64_t)_atp->time,
 				_atp->t.tm_hour, _atp->t.tm_min, _atp->t.tm_sec);
 	printf("Date: %s, %04d-%02d-%02d\n", _wdays[_atp->t.tm_wday],
 				_atp->t.tm_year+1900, _atp->t.tm_mon+1, _atp->t.tm_mday);
@@ -512,15 +513,15 @@ int tr_print(tmrec_t *_trp)
 		return -1;
 	}
 	printf("Recurrence definition\n-- start time ---\n");
-	printf("Sys time: %lu\n", (uint64_t)_trp->dtstart);
+	printf("Sys time: %" PRIu64 "\n", (uint64_t)_trp->dtstart);
 	printf("Time: %02d:%02d:%02d\n", _trp->ts.tm_hour,
 				_trp->ts.tm_min, _trp->ts.tm_sec);
 	printf("Date: %s, %04d-%02d-%02d\n", _wdays[_trp->ts.tm_wday],
 				_trp->ts.tm_year+1900, _trp->ts.tm_mon+1, _trp->ts.tm_mday);
 	printf("---\n");
-	printf("End time: %lu\n", (uint64_t)_trp->dtend);
-	printf("Duration: %lu\n", (uint64_t)_trp->duration);
-	printf("Until: %lu\n", (uint64_t)_trp->until);
+	printf("End time: %" PRIu64 "\n", (uint64_t)_trp->dtend);
+	printf("Duration: %" PRIu64 "\n", (uint64_t)_trp->duration);
+	printf("Until: %" PRIu64 "\n", (uint64_t)_trp->until);
 	printf("Freq: %d\n", (int)_trp->freq);
 	printf("Interval: %d\n", (int)_trp->interval);
 	if(_trp->byday)