Move _free() into system.h for now
- get rid of dozen _free() definitions - get _free() out of public headers
This commit is contained in:
parent
e53ceb6706
commit
154a7f7603
12
lib/rpmlib.h
12
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
|
||||
|
|
|
@ -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));
|
||||
|
|
|
@ -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
|
||||
|
|
12
rpmio/argv.c
12
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;
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
/* =============================================================== */
|
||||
|
||||
/**
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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)
|
||||
{
|
||||
|
|
12
rpmio/url.c
12
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;
|
||||
|
|
13
system.h
13
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 */
|
||||
/**
|
||||
*/
|
||||
|
|
Loading…
Reference in New Issue