diff options
author | Panu Matilainen <pmatilai@redhat.com> | 2007-09-20 15:37:48 +0300 |
---|---|---|
committer | Panu Matilainen <pmatilai@redhat.com> | 2007-09-20 15:37:48 +0300 |
commit | 154a7f7603dca24ee56d66f3ca6b2b2757f29cd9 (patch) | |
tree | e80bfb8429517b10e53b1f53717ad4dd8ae25a38 | |
parent | e53ceb6706125bead8630ba52f232c792ca1fdae (diff) | |
download | librpm-tizen-154a7f7603dca24ee56d66f3ca6b2b2757f29cd9.tar.gz librpm-tizen-154a7f7603dca24ee56d66f3ca6b2b2757f29cd9.tar.bz2 librpm-tizen-154a7f7603dca24ee56d66f3ca6b2b2757f29cd9.zip |
Move _free() into system.h for now
- get rid of dozen _free() definitions
- get _free() out of public headers
-rw-r--r-- | lib/rpmlib.h | 12 | ||||
-rw-r--r-- | lib/stringbuf.c | 12 | ||||
-rw-r--r-- | rpmdb/header.c | 12 | ||||
-rw-r--r-- | rpmio/argv.c | 12 | ||||
-rw-r--r-- | rpmio/macro.c | 12 | ||||
-rw-r--r-- | rpmio/rpmio.c | 12 | ||||
-rw-r--r-- | rpmio/rpmlog.c | 12 | ||||
-rw-r--r-- | rpmio/rpmpgp.c | 12 | ||||
-rw-r--r-- | rpmio/rpmrpc.c | 13 | ||||
-rw-r--r-- | rpmio/url.c | 12 | ||||
-rw-r--r-- | system.h | 13 |
11 files changed, 13 insertions, 121 deletions
diff --git a/lib/rpmlib.h b/lib/rpmlib.h index a574bf869..260bb083c 100644 --- a/lib/rpmlib.h +++ b/lib/rpmlib.h @@ -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 diff --git a/lib/stringbuf.c b/lib/stringbuf.c index bc85715f9..fbb956716 100644 --- a/lib/stringbuf.c +++ b/lib/stringbuf.c @@ -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)); diff --git a/rpmdb/header.c b/rpmdb/header.c index cd1d7df29..645fbb4e6 100644 --- a/rpmdb/header.c +++ b/rpmdb/header.c @@ -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 diff --git a/rpmio/argv.c b/rpmio/argv.c index d112dfbc2..64cfd64c2 100644 --- a/rpmio/argv.c +++ b/rpmio/argv.c @@ -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; diff --git a/rpmio/macro.c b/rpmio/macro.c index 7d6b89208..fd18b2473 100644 --- a/rpmio/macro.c +++ b/rpmio/macro.c @@ -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; -} - /* =============================================================== */ /** diff --git a/rpmio/rpmio.c b/rpmio/rpmio.c index f7ab21d6f..a565c6471 100644 --- a/rpmio/rpmio.c +++ b/rpmio/rpmio.c @@ -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) diff --git a/rpmio/rpmlog.c b/rpmio/rpmlog.c index ed2091ee9..06710add9 100644 --- a/rpmio/rpmlog.c +++ b/rpmio/rpmlog.c @@ -23,18 +23,6 @@ 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; diff --git a/rpmio/rpmpgp.c b/rpmio/rpmpgp.c index 353f826da..1335d31cb 100644 --- a/rpmio/rpmpgp.c +++ b/rpmio/rpmpgp.c @@ -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; diff --git a/rpmio/rpmrpc.c b/rpmio/rpmrpc.c index 3e639a262..6bf1fb28c 100644 --- a/rpmio/rpmrpc.c +++ b/rpmio/rpmrpc.c @@ -13,19 +13,6 @@ #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) { diff --git a/rpmio/url.c b/rpmio/url.c index 8f5e8583a..1cc845581 100644 --- a/rpmio/url.c +++ b/rpmio/url.c @@ -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; @@ -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 */ /** */ |