Move _free() into system.h for now

- get rid of dozen _free() definitions
- get _free() out of public headers
This commit is contained in:
Panu Matilainen 2007-09-20 15:37:48 +03:00
parent e53ceb6706
commit 154a7f7603
11 changed files with 13 additions and 121 deletions

View 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

View 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));

View 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

View 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;

View 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;
}
/* =============================================================== */
/**

View 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)

View File

@ -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;

View 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;

View File

@ -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)
{

View 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;

View File

@ -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 */
/**
*/