From 05bc9aa78fcc7152d6d13e9f5ed11612ccb5c6f4 Mon Sep 17 00:00:00 2001 From: Ed Maste Date: Sat, 20 Oct 2018 22:39:35 +0000 Subject: [PATCH] mcount: tidy up ANSIfication libc/gmon's mcount was ANSIfied in r124180, with libkern following over a decade later, in r325988, but some minor discrepancies remained. Update libc/gmon's mexitcount to an ANSI C function definition, and use (void) for libkern-only functions that take no arguments. Reported by: bde --- lib/libc/gmon/mcount.c | 3 +-- sys/libkern/mcount.c | 9 +++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/libc/gmon/mcount.c b/lib/libc/gmon/mcount.c index ad2877e19b1d..0d816a734350 100644 --- a/lib/libc/gmon/mcount.c +++ b/lib/libc/gmon/mcount.c @@ -279,8 +279,7 @@ MCOUNT #ifdef GUPROF void -mexitcount(selfpc) - uintfptr_t selfpc; +mexitcount(uintfptr_t selfpc) { struct gmonparam *p; uintfptr_t selfpcdiff; diff --git a/sys/libkern/mcount.c b/sys/libkern/mcount.c index 2d387b96cc2d..264cb2cef85c 100644 --- a/sys/libkern/mcount.c +++ b/sys/libkern/mcount.c @@ -58,7 +58,8 @@ __FBSDID("$FreeBSD$"); * both frompcindex and frompc. Any reasonable, modern compiler will * perform this optimization. */ -_MCOUNT_DECL(uintfptr_t frompc, uintfptr_t selfpc) /* _mcount; may be static, inline, etc */ +/* _mcount; may be static, inline, etc */ +_MCOUNT_DECL(uintfptr_t frompc, uintfptr_t selfpc) { #ifdef GUPROF int delta; @@ -291,7 +292,7 @@ mexitcount(uintfptr_t selfpc) #endif void -empty_loop() +empty_loop(void) { int i; @@ -300,13 +301,13 @@ empty_loop() } void -nullfunc() +nullfunc(void) { __asm __volatile(""); } void -nullfunc_loop() +nullfunc_loop(void) { int i;