summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPanu Matilainen <pmatilai@redhat.com>2010-03-19 16:51:32 +0200
committerPanu Matilainen <pmatilai@redhat.com>2010-03-19 16:51:32 +0200
commitf510c8704cbd08719e5f868976cfd4242b6fca13 (patch)
tree764ba34002a402bf9733084ea38a5bd442033f89
parent6b1ce53ae108d6581861237864d74747099d5cb1 (diff)
downloadlibrpm-tizen-f510c8704cbd08719e5f868976cfd4242b6fca13.tar.gz
librpm-tizen-f510c8704cbd08719e5f868976cfd4242b6fca13.tar.bz2
librpm-tizen-f510c8704cbd08719e5f868976cfd4242b6fca13.zip
Lose useless rpmgi reference counting
- these dont get passed around in a manner where refcounting would make any difference
-rw-r--r--lib/rpmgi.c32
-rw-r--r--lib/rpmgi.h16
2 files changed, 0 insertions, 48 deletions
diff --git a/lib/rpmgi.c b/lib/rpmgi.c
index fdcbdecc2..1b614bf79 100644
--- a/lib/rpmgi.c
+++ b/lib/rpmgi.c
@@ -51,8 +51,6 @@ struct rpmgi_s {
int ftsOpts;
FTS * ftsp;
FTSENT * fts;
-
- int nrefs; /*!< Reference count. */
};
static const char * const ftsInfoStrings[] = {
@@ -362,39 +360,11 @@ fprintf(stderr, "\tav %p[%ld]: \"%s\" -> %s ~= \"%s\"\n", gi->argv, (long) (av -
return rpmrc;
}
-rpmgi rpmgiUnlink(rpmgi gi, const char * msg)
-{
- if (gi == NULL) return NULL;
-
-if (_rpmgi_debug && msg != NULL)
-fprintf(stderr, "--> gi %p -- %d: %s\n", gi, gi->nrefs, msg);
-
- gi->nrefs--;
- return NULL;
-}
-
-rpmgi rpmgiLink(rpmgi gi, const char * msg)
-{
- if (gi == NULL) return NULL;
- gi->nrefs++;
-
-if (_rpmgi_debug && msg != NULL)
-fprintf(stderr, "--> gi %p ++ %d: %s\n", gi, gi->nrefs, msg);
-
- return gi;
-}
-
rpmgi rpmgiFree(rpmgi gi)
{
if (gi == NULL)
return NULL;
- if (gi->nrefs > 1)
- return rpmgiUnlink(gi, __FUNCTION__);
-
- (void) rpmgiUnlink(gi, __FUNCTION__);
-
-
gi->hdrPath = _free(gi->hdrPath);
gi->h = headerFree(gi->h);
@@ -447,8 +417,6 @@ rpmgi rpmgiNew(rpmts ts, rpmTag tag, const void * keyp, size_t keylen)
gi->ftsp = NULL;
gi->fts = NULL;
- gi = rpmgiLink(gi, __FUNCTION__);
-
return gi;
}
diff --git a/lib/rpmgi.h b/lib/rpmgi.h
index f00534256..4fcf8f844 100644
--- a/lib/rpmgi.h
+++ b/lib/rpmgi.h
@@ -39,22 +39,6 @@ typedef enum rpmgiFlags_e {
extern rpmgiFlags giFlags;
-/** \ingroup rpmgi
- * Unreference a generalized iterator instance.
- * @param gi generalized iterator
- * @param msg
- * @return NULL always
- */
-rpmgi rpmgiUnlink (rpmgi gi, const char * msg);
-
-/** \ingroup rpmgi
- * Reference a generalized iterator instance.
- * @param gi generalized iterator
- * @param msg
- * @return new generalized iterator reference
- */
-rpmgi rpmgiLink (rpmgi gi, const char * msg);
-
/** \ingroup rpmgi
* Destroy a generalized iterator.
* @param gi generalized iterator