Move _free() into system.h for now
authorPanu Matilainen <pmatilai@redhat.com>
Thu, 20 Sep 2007 12:37:48 +0000 (15:37 +0300)
committerPanu Matilainen <pmatilai@redhat.com>
Thu, 20 Sep 2007 12:37:48 +0000 (15:37 +0300)
- get rid of dozen _free() definitions
- get _free() out of public headers

lib/rpmlib.h
lib/stringbuf.c
rpmdb/header.c
rpmio/argv.c
rpmio/macro.c
rpmio/rpmio.c
rpmio/rpmlog.c
rpmio/rpmpgp.c
rpmio/rpmrpc.c
rpmio/url.c
system.h

index a574bf8..260bb08 100644 (file)
@@ -41,18 +41,6 @@ extern int rpmFLAGS;
 extern "C" {
 #endif
 
-/**
- * Wrapper to free(3), hides const compilation noise, permit NULL, return NULL.
- * @param p            memory to free
- * @return             NULL always
- */
-static inline
-void * _free(const void * p)
-{
-    if (p != NULL)     free((void *)p);
-    return NULL;
-}
-
 /** \ingroup rpmtrans
  * The RPM Transaction Set.
  * Transaction sets are inherently unordered! RPM may reorder transaction
index bc85715..fbb9567 100644 (file)
@@ -23,18 +23,6 @@ static inline int xisspace(int c)  {
     return (c == ' ' || c == '\t' || c == '\n' || c == '\r' || c == '\f' || c == '\v');
 }
 
-/**
- * Wrapper to free(3), hides const compilation noise, permit NULL, return NULL.
- * @param p            memory to free
- * @return             NULL always
- */
-static inline void *
-_free(const void * p)
-{
-    if (p != NULL)     free((void *)p);
-    return NULL;
-}
-
 StringBuf newStringBuf(void)
 {
     StringBuf sb = xmalloc(sizeof(*sb));
index cd1d7df..645fbb4 100644 (file)
@@ -108,18 +108,6 @@ static size_t headerMaxbytes = (32*1024*1024);
 
 HV_t hdrVec;   /* forward reference */
 
-/**
- * Wrapper to free(3), hides const compilation noise, permit NULL, return NULL.
- * @param p            memory to free
- * @return             NULL always
- */
-static inline void *
-_free(const void * p)
-{
-    if (p != NULL)     free((void *)p);
-    return NULL;
-}
-
 /** \ingroup header
  * Reference a header instance.
  * @param h            header
index d112dfb..64cfd64 100644 (file)
@@ -8,18 +8,6 @@
 
 #include "debug.h"
 
-/**
- * Wrapper to free(3), hides const compilation noise, permit NULL, return NULL.
- * @param p            memory to free
- * @return             NULL always
- */
-static inline
-void * _free(const void * p)
-{
-    if (p != NULL)     free((void *)p);
-    return NULL;
-}
-
 void argvPrint(const char * msg, ARGV_t argv, FILE * fp)
 {
     ARGV_t av;
index 7d6b892..fd18b24 100644 (file)
@@ -90,18 +90,6 @@ int print_expand_trace = _PRINT_EXPAND_TRACE;
 /* forward ref */
 static int expandMacro(MacroBuf mb);
 
-/**
- * Wrapper to free(3), hides const compilation noise, permit NULL, return NULL.
- * @param p            memory to free
- * @retval             NULL always
- */
-static inline void *
-_free(const void * p)
-{
-    if (p != NULL)     free((void *)p);
-    return NULL;
-}
-
 /* =============================================================== */
 
 /**
index f7ab21d..a565c64 100644 (file)
@@ -70,18 +70,6 @@ int noLibio = 1;
  */
 int _rpmio_debug = 0;
 
-/**
- * Wrapper to free(3), hides const compilation noise, permit NULL, return NULL.
- * @param p            memory to free
- * @retval             NULL always
- */
-static inline void *
-_free(const void * p)
-{
-    if (p != NULL)     free((void *)p);
-    return NULL;
-}
-
 /* =============================================================== */
 
 static const char * fdbg(FD_t fd)
index ed2091e..06710ad 100644 (file)
 static int nrecs = 0;
 static rpmlogRec recs = NULL;
 
-/**
- * Wrapper to free(3), hides const compilation noise, permit NULL, return NULL.
- * @param p            memory to free
- * @retval             NULL always
- */
-static inline void *
-_free(const void * p)
-{
-    if (p != NULL)     free((void *)p);
-    return NULL;
-}
-
 int rpmlogGetNrecs(void)
 {
     return nrecs;
index 353f826..1335d31 100644 (file)
@@ -173,18 +173,6 @@ struct pgpValTbl_s pgpArmorKeyTbl[] = {
     { -1,                      "Unknown armor key" }
 };
 
-/**
- * Wrapper to free(3), hides const compilation noise, permit NULL, return NULL.
- * @param p            memory to free
- * @return             NULL always
- */
-static inline void *
-_free(const void * p)
-{
-    if (p != NULL)     free((void *)p);
-    return NULL;
-}
-
 static void pgpPrtNL(void)
 {
     if (!_print) return;
index 3e639a2..6bf1fb2 100644 (file)
 #include "ugid.h"
 #include "debug.h"
 
-
-/**
- * Wrapper to free(3), hides const compilation noise, permit NULL, return NULL.
- * @param p            memory to free
- * @retval             NULL always
- */
-static inline void *
-_free(const void * p)
-{
-    if (p != NULL)     free((void *)p);
-    return NULL;
-}
-
 /* =============================================================== */
 int Mkdir (const char * path, mode_t mode)
 {
index 8f5e858..1cc8455 100644 (file)
@@ -31,18 +31,6 @@ int _url_debug = 0;
 
 #define        URLDBG(_f, _m, _x)      if ((_url_debug | (_f)) & (_m)) fprintf _x
 
-/**
- * Wrapper to free(3), hides const compilation noise, permit NULL, return NULL.
- * @param p            memory to free
- * @retval             NULL always
- */
-static inline void *
-_free(const void * p)
-{
-    if (p != NULL)     free((void *)p);
-    return NULL;
-}
-
 urlinfo urlNew()
 {
     urlinfo u;
index 3d7dd4a..10d9e06 100644 (file)
--- a/system.h
+++ b/system.h
@@ -233,6 +233,19 @@ typedef    char * security_context_t;
 #define rpm_execcon(_v, _fn, _av, _envp)       (0)
 #endif
 
+/**
+ * Wrapper to free(3), hides const compilation noise, permit NULL, return NULL.
+ * @param p             memory to free
+ * @return              NULL always
+ */
+static inline
+void * _free(const void * p)
+{
+    if (p != NULL)      free((void *)p);
+    return NULL;
+}
+
+
 /* FIX: these are macros */
 /**
  */