From 60dc809db136e8bba12a9d45e189248218e304cb Mon Sep 17 00:00:00 2001 From: Panu Matilainen Date: Mon, 4 Jan 2010 13:46:43 +0200 Subject: [PATCH] Eliminate myrealloc() replacement function - realloc(NULL, size) is defined as equal to malloc(size) in C99 and POSIX 2001, we dont care about anything older than that --- configure.ac | 2 -- misc/Makefile.am | 2 +- misc/myrealloc.c | 8 -------- rpmio/rpmmalloc.c | 5 ----- 4 files changed, 1 insertion(+), 16 deletions(-) delete mode 100644 misc/myrealloc.c diff --git a/configure.ac b/configure.ac index 92001b2..d6da981 100644 --- a/configure.ac +++ b/configure.ac @@ -812,8 +812,6 @@ elif echo "$host_os" | grep sunos > /dev/null; then echo "hacking things up for sunos" CFLAGS="$CFLAGS -D__USE_FIXED_PROTOTYPES__" AC_DEFINE(NEED_STRINGS_H, 1, [Define as one if we need to include (along with )]) - AC_DEFINE(NEED_MYREALLOC, 1, [Define as 1 if we need myrealloc]) - AC_LIBOBJ(myrealloc) fi # diff --git a/misc/Makefile.am b/misc/Makefile.am index eb921ee..b84eea4 100644 --- a/misc/Makefile.am +++ b/misc/Makefile.am @@ -8,7 +8,7 @@ EXTRA_DIST = \ fakefork.c fnmatch.c fnmatch.h \ getcwd.c getmntent.c \ getwd.c glob.c glob.h \ - myrealloc.c putenv.c realpath.c \ + putenv.c realpath.c \ setenv.c stpcpy.c stpncpy.c noinst_LTLIBRARIES = libmisc.la diff --git a/misc/myrealloc.c b/misc/myrealloc.c deleted file mode 100644 index 1b93c17..0000000 --- a/misc/myrealloc.c +++ /dev/null @@ -1,8 +0,0 @@ -#include "system.h" - -void *myrealloc(void *ptr, size_t size) { -if (ptr == NULL) - return malloc(size); - else - return realloc(ptr, size); -} diff --git a/rpmio/rpmmalloc.c b/rpmio/rpmmalloc.c index 479fe88..fd93cbc 100644 --- a/rpmio/rpmmalloc.c +++ b/rpmio/rpmmalloc.c @@ -10,11 +10,6 @@ #include "debug.h" -#if NEED_MYREALLOC -#define realloc(ptr,size) myrealloc(ptr,size) -extern void *myrealloc(void *, size_t); -#endif - static rpmMemFailFunc failfunc = NULL; static void *failfunc_data = NULL; -- 2.7.4