From a3e23446e2969387efdd71a2e1b062af0bedfce7 Mon Sep 17 00:00:00 2001 From: Danny Smith Date: Fri, 25 Jan 2002 03:29:55 +0000 Subject: * profile/profil.c: Update copyright info. * profile/profil.h: Likewise. * profile/gcrt0.c: Likewise. * profile/profil.h (PROFADDR): Cast idx to unsigned long long to avoid overflow. * profile/gmon.c: Define bzero as memset if mingw32. (monstartup): Use it. --- winsup/mingw/profile/gcrt0.c | 2 +- winsup/mingw/profile/gmon.c | 9 +++++++-- winsup/mingw/profile/profil.c | 2 +- winsup/mingw/profile/profil.h | 8 +++++--- 4 files changed, 14 insertions(+), 7 deletions(-) (limited to 'winsup/mingw/profile') diff --git a/winsup/mingw/profile/gcrt0.c b/winsup/mingw/profile/gcrt0.c index 601b2758c..20f3c7ced 100644 --- a/winsup/mingw/profile/gcrt0.c +++ b/winsup/mingw/profile/gcrt0.c @@ -1,6 +1,6 @@ /* gcrt0.c - Copyright 1998 Cygnus Solutions. + Copyright 1998, 1999, 2000, 2001, 2002 Red Hat, Inc. This file is part of Cygwin. diff --git a/winsup/mingw/profile/gmon.c b/winsup/mingw/profile/gmon.c index 17398b8e2..b68f31818 100644 --- a/winsup/mingw/profile/gmon.c +++ b/winsup/mingw/profile/gmon.c @@ -55,6 +55,10 @@ static char rcsid[] = "$OpenBSD: gmon.c,v 1.8 1997/07/23 21:11:27 kstailey Exp $ /* XXX needed? */ //extern char *minbrk __asm ("minbrk"); +#ifdef __MINGW32__ +#define bzero(ptr,size) memset (ptr, 0, size); +#endif + struct gmonparam _gmonparam = { GMON_PROF_OFF }; static int s_scale; @@ -102,9 +106,10 @@ monstartup(lowpc, highpc) ERR("monstartup: out of memory\n"); return; } -#ifdef notdef + + /* zero out cp as value will be added there */ bzero(cp, p->kcountsize + p->fromssize + p->tossize); -#endif + p->tos = (struct tostruct *)cp; cp += p->tossize; p->kcount = (u_short *)cp; diff --git a/winsup/mingw/profile/profil.c b/winsup/mingw/profile/profil.c index d2946210e..dae59d7fd 100644 --- a/winsup/mingw/profile/profil.c +++ b/winsup/mingw/profile/profil.c @@ -1,6 +1,6 @@ /* profil.c -- win32 profil.c equivalent - Copyright 1998 Cygnus Solutions. + Copyright 1998, 1999, 2000, 2001, 2002 Red Hat, Inc. This file is part of Cygwin. diff --git a/winsup/mingw/profile/profil.h b/winsup/mingw/profile/profil.h index 1e3ef479f..9245dd25a 100644 --- a/winsup/mingw/profile/profil.h +++ b/winsup/mingw/profile/profil.h @@ -1,6 +1,6 @@ /* profil.h: gprof profiling header file - Copyright 1998 Cygnus Solutions. + Copyright 1998, 1999, 2000, 2001, 2002 Red Hat, Inc. This file is part of Cygwin. @@ -28,8 +28,10 @@ details. */ }) /* convert an index into an address */ -#define PROFADDR(idx, base, scale) \ - ((base) + ((((idx) << 16) / (scale)) << 1)) +#define PROFADDR(idx, base, scale) \ + ((base) \ + + ((((unsigned long long)(idx) << 16) \ + / (unsigned long long)(scale)) << 1)) /* convert a bin size into a scale */ #define PROFSCALE(range, bins) (((bins) << 16) / ((range) >> 1)) -- cgit v1.2.3