From 5a33aec2b710e4d21377e5b82f4b0bdf6a13a408 Mon Sep 17 00:00:00 2001 From: Heikki Kallasjoki Date: Fri, 30 Nov 2018 16:50:28 +0000 Subject: Clean up compiler warnings. --- cpu.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'cpu.c') diff --git a/cpu.c b/cpu.c index 94dd4c5..4a058d7 100644 --- a/cpu.c +++ b/cpu.c @@ -26,6 +26,8 @@ struct cpu_context { }; void *cpu_init(int argc, char *argv[]) { + (void) argc; (void) argv; + long clock_tick = sysconf(_SC_CLK_TCK); if (clock_tick <= 0) { perror("sysconf(_SC_CLK_TCK)"); @@ -74,7 +76,7 @@ void cpu_collect(scrape_req *req, void *ctx_ptr) { char *at = buf + 3; char *sep = strchr(at, ' '); - if (!sep || sep - at + 1 > sizeof cpu_label) + if (!sep || sep - at + 1 > (ptrdiff_t) sizeof cpu_label) continue; *sep = '\0'; strcpy(cpu_label, at); -- cgit 1.4.1