[3/6] libgloss: i386: cygmon-gmon.c: make moncontrol() visible to its users
Commit Message
Move moncontrol() up so that it becomes visible to the two functions
which are using it: monstartup() and _mcleanup(). This resolves below
GCC errors:
cygmon-gmon.c: In function 'monstartup':
cygmon-gmon.c:165:3: error: implicit declaration of function 'moncontrol' [-Wimplicit-function-declaration]
165 | moncontrol (1);
| ^~~~~~~~~~
While at it, change the function declaration style of moncontrol()
from K&R to ISO C and remove any trailing spaces in that function.
Signed-off-by: Vincent Mailhol <mailhol@kernel.org>
---
libgloss/i386/cygmon-gmon.c | 50 ++++++++++++++++++++++-----------------------
1 file changed, 25 insertions(+), 25 deletions(-)
@@ -92,6 +92,31 @@ static int s_scale;
extern int errno;
+/*
+ * Control profiling
+ * profiling is what mcount checks to see if
+ * all the data structures are ready.
+ */
+void
+moncontrol(int mode)
+{
+ if (mode)
+ {
+ /* start */
+ profil((unsigned short *)(sbuf + sizeof(struct phdr)),
+ ssiz - sizeof(struct phdr),
+ (int)s_lowpc, s_scale);
+
+ profiling = 0;
+ }
+ else
+ {
+ /* stop */
+ profil((unsigned short *)0, 0, 0, 0);
+ profiling = 3;
+ }
+}
+
int
monstartup(lowpc, highpc)
char *lowpc;
@@ -338,28 +363,3 @@ overflow:
write (2, TOLIMIT, sizeof(TOLIMIT));
goto out;
}
-
-/*
- * Control profiling
- * profiling is what mcount checks to see if
- * all the data structures are ready.
- */
-moncontrol(mode)
- int mode;
-{
- if (mode)
- {
- /* start */
- profil((unsigned short *)(sbuf + sizeof(struct phdr)),
- ssiz - sizeof(struct phdr),
- (int)s_lowpc, s_scale);
-
- profiling = 0;
- }
- else
- {
- /* stop */
- profil((unsigned short *)0, 0, 0, 0);
- profiling = 3;
- }
-}