Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/lib/libc/gmon fix nested extern



details:   https://anonhg.NetBSD.org/src/rev/4be0771c5286
branches:  trunk
changeset: 500930:4be0771c5286
user:      christos <christos%NetBSD.org@localhost>
date:      Wed Dec 20 20:55:23 2000 +0000

description:
fix nested extern
fix sbrk casts

diffstat:

 lib/libc/gmon/gmon.c |  12 +++++++-----
 1 files changed, 7 insertions(+), 5 deletions(-)

diffs (61 lines):

diff -r da8cfe95f4f7 -r 4be0771c5286 lib/libc/gmon/gmon.c
--- a/lib/libc/gmon/gmon.c      Wed Dec 20 20:54:30 2000 +0000
+++ b/lib/libc/gmon/gmon.c      Wed Dec 20 20:55:23 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: gmon.c,v 1.15 1999/01/14 22:48:19 kleink Exp $ */
+/*     $NetBSD: gmon.c,v 1.16 2000/12/20 20:55:23 christos Exp $       */
 
 /*-
  * Copyright (c) 1983, 1992, 1993
@@ -38,7 +38,7 @@
 #if 0
 static char sccsid[] = "@(#)gmon.c     8.1 (Berkeley) 6/4/93";
 #else
-__RCSID("$NetBSD: gmon.c,v 1.15 1999/01/14 22:48:19 kleink Exp $");
+__RCSID("$NetBSD: gmon.c,v 1.16 2000/12/20 20:55:23 christos Exp $");
 #endif
 #endif
 
@@ -56,6 +56,8 @@
 #include <err.h>
 #include "extern.h"
 
+extern char *__progname;
+
 struct gmonparam _gmonparam = { GMON_PROF_OFF };
 
 static u_int   s_scale;
@@ -69,6 +71,7 @@
 void   _mcleanup __P((void));
 static int hertz __P((void));
 
+
 void
 monstartup(lowpc, highpc)
        u_long lowpc;
@@ -95,7 +98,7 @@
                p->tolimit = MAXARCS;
        p->tossize = p->tolimit * sizeof(struct tostruct);
 
-       cp = sbrk((int)(p->kcountsize + p->fromssize + p->tossize));
+       cp = sbrk((intptr_t)(p->kcountsize + p->fromssize + p->tossize));
        if (cp == (char *)-1) {
                ERR("monstartup: out of memory\n");
                return;
@@ -109,7 +112,7 @@
        cp += (size_t)p->kcountsize;
        p->froms = (u_short *)(void *)cp;
 
-       __minbrk = sbrk(0);
+       __minbrk = sbrk((intptr_t)0);
        p->tos[0].link = 0;
 
        o = p->highpc - p->lowpc;
@@ -178,7 +181,6 @@
        moncontrol(0);
 
        if ((profdir = getenv("PROFDIR")) != NULL) {
-               extern char *__progname;
                char *s, *t;
                pid_t pid;
                long divisor;



Home | Main Index | Thread Index | Old Index