RPM Package Manager, CVS Repository
http://rpm5.org/cvs/
____________________________________________________________________________
Server: rpm5.org Name: Jeff Johnson
Root: /v/rpm/cvs Email: jbj@rpm5.org
Module: rpm Date: 06-Oct-2007 19:46:46
Branch: HEAD Handle: 2007100618464600
Modified files:
rpm CHANGES
rpm/rpmio .splintrc mire.c mire.h
Log:
- start making miRE abstract and refcounted.
rescuscitate rpmio splint.
Summary:
Revision Changes Path
1.1655 +1 -0 rpm/CHANGES
1.13 +41 -1 rpm/rpmio/.splintrc
1.4 +24 -0 rpm/rpmio/mire.c
1.4 +29 -3 rpm/rpmio/mire.h
____________________________________________________________________________
patch -p0 <<'@@ .'
Index: rpm/CHANGES
============================================================================
$ cvs diff -u -r1.1654 -r1.1655 CHANGES
--- rpm/CHANGES 6 Oct 2007 16:50:03 -0000 1.1654
+++ rpm/CHANGES 6 Oct 2007 17:46:46 -0000 1.1655
@@ -1,4 +1,5 @@
4.5 -> 5.0:
+ - jbj: start making miRE abstract and refcounted.
- jbj: convert rel to abs linkto depedency iff directory is known.
- rpm.org: correct typo in comment.
- rse: remove all compile-time warnings caused by recent changes
@@ .
patch -p0 <<'@@ .'
Index: rpm/rpmio/.splintrc
============================================================================
$ cvs diff -u -r1.12 -r1.13 .splintrc
--- rpm/rpmio/.splintrc 30 May 2007 03:46:22 -0000 1.12
+++ rpm/rpmio/.splintrc 6 Oct 2007 17:46:46 -0000 1.13
@@ -1,4 +1,4 @@
--I. -I.. -I../neon/src -I../lua/include -I../lua/include/local -I../beecrypt -I../popt -I../zlib -DHAVE_CONFIG_H -D_GNU_SOURCE -DHAVE_NEON_NE_GET_RESPONSE_HEADER -D__STDC__=1 -DHAVE_NEON_NE_GET_RESPONSE_HEADER
+-I. -I.. -I../file/src -I/usr/include/neon -I../lua -I../lua/local -I/usr/include/beecrypt -I../zlib -DHAVE_CONFIG_H -D_GNU_SOURCE -D__STDC__=1 -DHAVE_NEON_NE_GET_RESPONSE_HEADER
+partial
+forcehints
@@ -17,6 +17,46 @@
-shiftimplementation
-shiftnegative
+-assignexpose
+-branchstate
+-compdef
+-compmempass
+-evalorderuncon
+-globs
+-globstate
+-globuse
+-internalglobs
+-modfilesys
+-modobserver
+-mods
+-moduncon
+-modunconnomods
+-mustmod
+-noeffect
+-noeffectuncon
+-nullderef
+-nullpass
+-nullret
+-nullstate
+-paramuse
+-protoparammatch
+-redecl
+-refcounttrans
+-retalias
+-retexpose
+-sefuncon
+-sizeoftype
+-sysunrecog
+-unreachable
+-unrecog
+
+-dependenttrans
+-immediatetrans
+-observertrans
+-readonlytrans
+-temptrans
+-type
+
-forempty
-looploopbreak
-nullptrarith
@@ .
patch -p0 <<'@@ .'
Index: rpm/rpmio/mire.c
============================================================================
$ cvs diff -u -r1.3 -r1.4 mire.c
--- rpm/rpmio/mire.c 1 Aug 2007 17:58:37 -0000 1.3
+++ rpm/rpmio/mire.c 6 Oct 2007 17:46:46 -0000 1.4
@@ -43,6 +43,30 @@
return 0;
}
+miRE XmireUnlink(miRE mire, const char * msg, const char * fn, unsigned ln)
+{
+ if (mire == NULL) return NULL;
+/*@-modfilesys@*/
+if (_mire_debug && msg != NULL)
+fprintf(stderr, "--> mire %p -- %d %s at %s:%u\n", mire, mire->nrefs, msg, fn, ln);
+/*@=modfilesys@*/
+ mire->nrefs--;
+ return NULL;
+}
+
+miRE XmireLink(miRE mire, const char * msg, const char * fn, unsigned ln)
+{
+ if (mire == NULL) return NULL;
+ mire->nrefs++;
+
+/*@-modfilesys@*/
+if (_mire_debug && msg != NULL)
+fprintf(stderr, "--> mire %p ++ %d %s at %s:%u\n", mire, mire->nrefs, msg, fn, ln);
+/*@=modfilesys@*/
+
+ /*@-refcounttrans@*/ return mire; /*@=refcounttrans@*/
+}
+
miRE mireFree(miRE mire)
{
/*@-modfilesys@*/
@@ .
patch -p0 <<'@@ .'
Index: rpm/rpmio/mire.h
============================================================================
$ cvs diff -u -r1.3 -r1.4 mire.h
--- rpm/rpmio/mire.h 1 Aug 2007 15:55:29 -0000 1.3
+++ rpm/rpmio/mire.h 6 Oct 2007 17:46:46 -0000 1.4
@@ -38,7 +38,7 @@
/**
*/
-typedef struct miRE_s * miRE;
+typedef /*@abstract@*/ /*@refcounted@*/ struct miRE_s * miRE;
/**
* Tag value pattern match mode.
@@ -64,6 +64,7 @@
int eflags; /*!< regexec(3) flags */
int notmatch; /*!< non-zero: negative match, like "grep -v" */
int tag; /*!< sort identifier (e.g. an rpmTag) */
+ int nrefs; /*!< Reference count. */
};
#endif /* defined(_MIRE_INTERNAL) */
@@ -79,19 +80,44 @@
int mireClean(miRE mire)
/*@modifies mire @*/;
+/*@-exportlocal@*/
+/*@null@*/
+miRE XmireUnlink (/*@killref@*/ /*@only@*/ /*@null@*/ miRE mire,
+ /*@null@*/ const char * msg, const char * fn, unsigned ln)
+ /*@modifies mire @*/;
+/*@=exportlocal@*/
+#define mireUnlink(_mire, _msg) XmireUnlink(_mire, _msg, __FILE__, __LINE__)
+
+/**
+ * Reference a pattern container instance.
+ * @param mire pattern container
+ * @param msg
+ * @return new pattern container reference
+ */
+/*@unused@*/ /*@newref@*/ /*@null@*/
+miRE mireLink (/*@null@*/ miRE mire, /*@null@*/ const char * msg)
+ /*@modifies mire @*/;
+
+/** @todo Remove debugging entry from the ABI. */
+/*@newref@*/ /*@null@*/
+miRE XmireLink (/*@null@*/ miRE mire, /*@null@*/ const char * msg,
+ const char * fn, unsigned ln)
+ /*@modifies mire @*/;
+#define mireLink(_mire, _msg) XmireLink(_mire, _msg, __FILE__, __LINE__)
+
/**
* Free pattern container.
* @param mire pattern container
* @return NULL always
*/
/*@null@*/
-miRE mireFree(/*@only@*/ miRE mire)
+miRE mireFree(/*@killref@*/ /*@only@*/ /*@null@*/ miRE mire)
/*@modifies mire @*/;
/**
* Create pattern container.
* @param mode type of pattern match
- * @param tag identifier (like an rpmTag)
+ * @param tag identifier (e.g. an rpmTag)
* @return NULL always
*/
miRE mireNew(rpmMireMode mode, int tag)
@@ .
Received on Sat Oct 6 19:46:46 2007