From 5f716d78234dca18120a90f2f8ebe222718c197f Mon Sep 17 00:00:00 2001 From: mamborambo <36679886+mamborambo@users.noreply.github.com> Date: Thu, 22 Nov 2018 00:00:00 +0000 Subject: [PATCH] Fix warnings MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit gpio.cpp:119:39: warning: format ‘%lld’ expects argument of type ‘long long int’, but argument 3 has type ‘uint64_t {aka long unsigned int}’ [-Wformat=] mailbox.c:66:33: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast] --- src/gpio.cpp | 2 +- src/mailbox.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gpio.cpp b/src/gpio.cpp index 7689acf..00160d6 100644 --- a/src/gpio.cpp +++ b/src/gpio.cpp @@ -116,7 +116,7 @@ uint64_t clkgpio::GetPllFrequency(int PllNo) Freq = XOSC_FREQUENCY * ((uint64_t)gpioreg[PLLH_CTRL] & 0x3ff) + XOSC_FREQUENCY * (uint64_t)gpioreg[PLLH_FRAC] / (1 << 20); break; } - fprintf(stderr, "Freq = %lld\n", Freq); + fprintf(stderr, "Freq = %lu\n", Freq); return Freq; } diff --git a/src/mailbox.c b/src/mailbox.c index 4ef05ca..e172615 100644 --- a/src/mailbox.c +++ b/src/mailbox.c @@ -63,7 +63,7 @@ void *mapmem(unsigned base, unsigned size) printf("base=0x%x, mem=%p\n", base, mem); #endif if (mem == MAP_FAILED) { - printf("mmap error %d\n", (int)mem); + printf("mmap error %p\n", mem); exit (-1); } close(mem_fd);