From 01c901a56b165e57a17db349cc110f84f1b839c7 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Sun, 22 Dec 1996 00:32:43 +0000 Subject: update from main archive 961220 Sun Dec 22 00:01:27 1996 Ulrich Drepper * inet/getnetgrent.c: Reformat copyright. * inet/getnetgrent_r.c (__internal_endnetgrent): Correct comment. (__internal_getnetgrent): Rename to __internal_getnetgrent_r as required in change nis/nss_compat/* at Thu Dec 19 14:24:50 1996. Reported by Thorsten Kukuk . * nss/nss_files/files-netgrp.c: Fix typo. * login/utmp_db.c: Comment out unused variables. * misc/tst-dirname.c: Provide prototype for main (for now). * new-malloc/mcheck-init.c: Include . * new-malloc/obstack.c: Provide real prototypes. * resolv/base64.c (b64_ntop): Use size_t as type of `i', not int. (b64_pton): Likewise for `tarindex'. * resolv/nsap_addr.c (inet_nsap_addr): Add cast to prevent warning. * stdio-common/Makefile: Add CFLAGS-vfprintf.c to prevent warning. * stdio-common/printf-parse.h: Remove definition of MIN and MAX. * stdio-common/printf-prs.c: Include to get MIN and MAX. * stdio-common/vfprintf.c: Likewise. * stdlib/gmp-impl.h: Only define MIN and MAX if not already done. * stdlib/tst-strtol.c: Don't use -2147483648 as unsigned long value. * sysdeps/generic/Makefile ($(subdir)=string): Define CFLAGS-wordcopy.c to prevent warning. * sysdeps/generic/mul_n.c (mpn_mul_n): Don't define as inline. * sysdeps/generic/wordcopy.c: De-ANSI-declfy. * sysdeps/i386/Makefile ($(subdir)=elf): Define CFLAGS-rtld.c to prevent warning. * sysdeps/i386/dl-machine.h: Correct copyright. * sysdeps/unix/closedir.c: Likewise. * sysdeps/unix/dirstream.h: Likewise. * sysdeps/unix/opendir.c: Likewise. * time/tzset.c: Add prototype for __tzset_internal. * sysdeps/gnu/utmpbits.h (enum utlogin): Comment out since the way it is supposed to work is not yet known. (struct utmp): Remove ut_login and ut_syslen field for now. Sat Dec 21 16:23:54 1996 Ulrich Drepper * time/strftime.c: Fix another bug in handling flags made it impossible to use the `-', `_', or `0' flag. --- malloc/mcheck-init.c | 29 +++++++++++++++-------------- malloc/obstack.c | 35 +++++++++++++++++++++++++++++++++++ 2 files changed, 50 insertions(+), 14 deletions(-) (limited to 'malloc') diff --git a/malloc/mcheck-init.c b/malloc/mcheck-init.c index a1cb7c9..aa1051f 100644 --- a/malloc/mcheck-init.c +++ b/malloc/mcheck-init.c @@ -1,25 +1,26 @@ -/* Copyright (C) 1991, 1994, 1995 Free Software Foundation, Inc. -This file is part of the GNU C Library. +/* Copyright (C) 1991, 1994, 1995, 1996 Free Software Foundation, Inc. + This file is part of the GNU C Library. -The GNU C Library is free software; you can redistribute it and/or -modify it under the terms of the GNU Library General Public License as -published by the Free Software Foundation; either version 2 of the -License, or (at your option) any later version. + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. -The GNU C Library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Library General Public License for more details. + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. -You should have received a copy of the GNU Library General Public -License along with the GNU C Library; see the file COPYING.LIB. If -not, write to the Free Software Foundation, Inc., 675 Mass Ave, -Cambridge, MA 02139, USA. */ + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ /* The object of this file should be installed as libmcheck.a, so one can do -lmcheck to turn on mcheck. */ #include +#include static void turn_on_mcheck __P ((void)) diff --git a/malloc/obstack.c b/malloc/obstack.c index e059b5a..1e36c4a 100644 --- a/malloc/obstack.c +++ b/malloc/obstack.c @@ -104,6 +104,20 @@ struct obstack *_obstack; For free, do not use ?:, since some compilers, like the MIPS compilers, do not allow (expr) ? void : void. */ +#if defined (__STDC__) && __STDC__ +#define CALL_CHUNKFUN(h, size) \ + (((h) -> use_extra_arg) \ + ? (*(h)->chunkfun) ((h)->extra_arg, (size)) \ + : (*(struct _obstack_chunk *(*) (long)) (h)->chunkfun) ((size))) + +#define CALL_FREEFUN(h, old_chunk) \ + do { \ + if ((h) -> use_extra_arg) \ + (*(h)->freefun) ((h)->extra_arg, (old_chunk)); \ + else \ + (*(void (*) (void *)) (h)->freefun) ((old_chunk)); \ + } while (0) +#else #define CALL_CHUNKFUN(h, size) \ (((h) -> use_extra_arg) \ ? (*(h)->chunkfun) ((h)->extra_arg, (size)) \ @@ -116,6 +130,7 @@ struct obstack *_obstack; else \ (*(void (*) ()) (h)->freefun) ((old_chunk)); \ } while (0) +#endif /* Initialize an obstack H for use. Specify chunk size SIZE (0 means default). @@ -132,8 +147,13 @@ _obstack_begin (h, size, alignment, chunkfun, freefun) struct obstack *h; int size; int alignment; +#if defined (__STDC__) && __STDC__ + POINTER (*chunkfun) (long); + void (*freefun) (void *); +#else POINTER (*chunkfun) (); void (*freefun) (); +#endif { register struct _obstack_chunk *chunk; /* points to new chunk */ @@ -156,8 +176,13 @@ _obstack_begin (h, size, alignment, chunkfun, freefun) size = 4096 - extra; } +#if defined (__STDC__) && __STDC__ + h->chunkfun = (struct _obstack_chunk * (*)(void *, long)) chunkfun; + h->freefun = (void (*) (void *, struct _obstack_chunk *)) freefun; +#else h->chunkfun = (struct _obstack_chunk * (*)()) chunkfun; h->freefun = freefun; +#endif h->chunk_size = size; h->alignment_mask = alignment - 1; h->use_extra_arg = 0; @@ -180,8 +205,13 @@ _obstack_begin_1 (h, size, alignment, chunkfun, freefun, arg) struct obstack *h; int size; int alignment; +#if defined (__STDC__) && __STDC__ + POINTER (*chunkfun) (POINTER, long); + void (*freefun) (POINTER, POINTER); +#else POINTER (*chunkfun) (); void (*freefun) (); +#endif POINTER arg; { register struct _obstack_chunk *chunk; /* points to new chunk */ @@ -205,8 +235,13 @@ _obstack_begin_1 (h, size, alignment, chunkfun, freefun, arg) size = 4096 - extra; } +#if defined(__STDC__) && __STDC__ + h->chunkfun = (struct _obstack_chunk * (*)(void *,long)) chunkfun; + h->freefun = (void (*) (void *, struct _obstack_chunk *)) freefun; +#else h->chunkfun = (struct _obstack_chunk * (*)()) chunkfun; h->freefun = freefun; +#endif h->chunk_size = size; h->alignment_mask = alignment - 1; h->extra_arg = arg; -- cgit v1.1