summaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
Diffstat (limited to 'python')
-rw-r--r--python/.splintrc71
-rw-r--r--python/rpmal-py.c5
-rw-r--r--python/rpmal-py.h1
-rw-r--r--python/rpmdb-py.c4
-rw-r--r--python/rpmdebug-py.c1
-rw-r--r--python/rpmds-py.c16
-rw-r--r--python/rpmds-py.h5
-rw-r--r--python/rpmfd-py.c7
-rw-r--r--python/rpmfd-py.h2
-rw-r--r--python/rpmfi-py.c26
-rw-r--r--python/rpmfi-py.h6
-rw-r--r--python/rpmfts-py.c24
-rw-r--r--python/rpmmi-py.c9
-rw-r--r--python/rpmmi-py.h1
-rw-r--r--python/rpmrc-py.c3
-rw-r--r--python/rpmrc-py.h3
-rw-r--r--python/rpmte-py.c22
-rw-r--r--python/rpmte-py.h1
-rw-r--r--python/rpmts-py.c41
-rw-r--r--python/rpmts-py.h1
20 files changed, 193 insertions, 56 deletions
diff --git a/python/.splintrc b/python/.splintrc
index 5998e6b02..e757a0544 100644
--- a/python/.splintrc
+++ b/python/.splintrc
@@ -16,51 +16,38 @@
+slovak-fcns
-bufferoverflowhigh
--branchstate
--castfcnptr
--compdef
--evalorderuncon
--exportheader
--globs
--globstate
--incondefs # 1
--internalglobs
--modfilesys
--modnomods
--modobserveruncon
--moduncon
--modunconnomods
--noeffect
--noeffectuncon
--nullassign
--nullderef
+-castfcnptr # 48
+-compdef # 28
+-globs # 150
+-globstate # 3 rpmfd
+-internalglobs # 114
+-modfilesys # 131
+-moduncon # 441
+-noeffect # 7
+-noeffectuncon # 132
+-nullassign # 60
-nullpass # 40
--nullret
--nullstate
-paramuse # 14
--predboolothers
--protoparammatch
+-protoparammatch # 5
-redecl # 23
--retalias
--retvalint
--shiftimplementation
--sizeoftype
--type
--usereleased
-
--dependenttrans
--exposetrans
--immediatetrans
--kepttrans
--newreftrans
--observertrans
--onlytrans
--readonlytrans
--refcounttrans
--statictrans
--temptrans
-
--ifempty
+-retalias # 41 PyNone
+-retvalint # 51
+-sizeoftype # 11
+-type # 44
+-usereleased # 6
+
+-dependenttrans # 3
+-exposetrans # 2 rpmte
+-immediatetrans # 34 PyNone
+-kepttrans # 1 rpmfd
+-newreftrans # 3
+-onlytrans # 2 rpmfd
+-readonlytrans # 211
+-refcounttrans # 5
+-statictrans # 46
+-temptrans # 10
+
+-ifempty # 51
# --- +partial artifacts
-declundef
diff --git a/python/rpmal-py.c b/python/rpmal-py.c
index b91b861be..05e5277c1 100644
--- a/python/rpmal-py.c
+++ b/python/rpmal-py.c
@@ -18,6 +18,7 @@
#include "debug.h"
+/*@null@*/
static PyObject *
rpmal_Debug(/*@unused@*/ rpmalObject * s, PyObject * args)
/*@globals _Py_NoneStruct @*/
@@ -28,6 +29,7 @@ rpmal_Debug(/*@unused@*/ rpmalObject * s, PyObject * args)
return Py_None;
}
+/*@null@*/
static PyObject *
rpmal_Add(rpmalObject * s, PyObject * args)
/*@modifies s @*/
@@ -47,6 +49,7 @@ rpmal_Add(rpmalObject * s, PyObject * args)
return Py_BuildValue("i", pkgKey);
}
+/*@null@*/
static PyObject *
rpmal_Del(rpmalObject * s, PyObject * args)
/*@globals _Py_NoneStruct @*/
@@ -63,6 +66,7 @@ rpmal_Del(rpmalObject * s, PyObject * args)
return Py_None;
}
+/*@null@*/
static PyObject *
rpmal_AddProvides(rpmalObject * s, PyObject * args)
/*@globals _Py_NoneStruct @*/
@@ -81,6 +85,7 @@ rpmal_AddProvides(rpmalObject * s, PyObject * args)
return Py_None;
}
+/*@null@*/
static PyObject *
rpmal_MakeIndex(rpmalObject * s, PyObject * args)
/*@globals _Py_NoneStruct @*/
diff --git a/python/rpmal-py.h b/python/rpmal-py.h
index 0ed151b25..d8aa09c99 100644
--- a/python/rpmal-py.h
+++ b/python/rpmal-py.h
@@ -16,6 +16,7 @@ typedef struct rpmalObject_s {
/*@unchecked@*/
extern PyTypeObject rpmal_Type;
+/*@null@*/
rpmalObject * rpmal_Wrap(rpmal al)
/*@*/;
diff --git a/python/rpmdb-py.c b/python/rpmdb-py.c
index 88b80a9f1..945f79853 100644
--- a/python/rpmdb-py.c
+++ b/python/rpmdb-py.c
@@ -111,6 +111,7 @@
/**
*/
+/*@null@*/
static rpmmiObject *
rpmdb_Match (rpmdbObject * s, PyObject * args)
/*@globals rpmGlobalMacroContext @*/
@@ -164,6 +165,7 @@ rpmdb_length(rpmdbObject * s)
/**
*/
+/*@null@*/
static hdrObject *
rpmdb_subscript(rpmdbObject * s, PyObject * key)
/*@globals rpmGlobalMacroContext @*/
@@ -208,7 +210,7 @@ static PyMappingMethods rpmdb_as_mapping = {
static void rpmdb_dealloc(rpmdbObject * s)
/*@modifies s @*/
{
- if (s->db)
+ if (s->db != NULL)
rpmdbClose(s->db);
PyObject_Del(s);
}
diff --git a/python/rpmdebug-py.c b/python/rpmdebug-py.c
index e5920731e..9849dd5ac 100644
--- a/python/rpmdebug-py.c
+++ b/python/rpmdebug-py.c
@@ -21,6 +21,7 @@ extern PyTypeObject PyFrame_Type;
/**
*/
+/*@observer@*/
static const char * lbl(void * s)
/*@*/
{
diff --git a/python/rpmds-py.c b/python/rpmds-py.c
index f2035164b..3bb7c99a1 100644
--- a/python/rpmds-py.c
+++ b/python/rpmds-py.c
@@ -19,6 +19,7 @@
/*@access rpmds @*/
+/*@null@*/
static PyObject *
rpmds_Debug(/*@unused@*/ rpmdsObject * s, PyObject * args)
/*@globals _Py_NoneStruct @*/
@@ -29,6 +30,7 @@ rpmds_Debug(/*@unused@*/ rpmdsObject * s, PyObject * args)
return Py_None;
}
+/*@null@*/
static PyObject *
rpmds_Count(rpmdsObject * s, PyObject * args)
/*@*/
@@ -37,6 +39,7 @@ rpmds_Count(rpmdsObject * s, PyObject * args)
return Py_BuildValue("i", rpmdsCount(s->ds));
}
+/*@null@*/
static PyObject *
rpmds_Ix(rpmdsObject * s, PyObject * args)
/*@*/
@@ -45,6 +48,7 @@ rpmds_Ix(rpmdsObject * s, PyObject * args)
return Py_BuildValue("i", rpmdsIx(s->ds));
}
+/*@null@*/
static PyObject *
rpmds_DNEVR(rpmdsObject * s, PyObject * args)
/*@*/
@@ -53,6 +57,7 @@ rpmds_DNEVR(rpmdsObject * s, PyObject * args)
return Py_BuildValue("s", rpmdsDNEVR(s->ds));
}
+/*@null@*/
static PyObject *
rpmds_N(rpmdsObject * s, PyObject * args)
/*@*/
@@ -61,6 +66,7 @@ rpmds_N(rpmdsObject * s, PyObject * args)
return Py_BuildValue("s", rpmdsN(s->ds));
}
+/*@null@*/
static PyObject *
rpmds_EVR(rpmdsObject * s, PyObject * args)
/*@*/
@@ -69,6 +75,7 @@ rpmds_EVR(rpmdsObject * s, PyObject * args)
return Py_BuildValue("s", rpmdsEVR(s->ds));
}
+/*@null@*/
static PyObject *
rpmds_Flags(rpmdsObject * s, PyObject * args)
/*@*/
@@ -77,6 +84,7 @@ rpmds_Flags(rpmdsObject * s, PyObject * args)
return Py_BuildValue("i", rpmdsFlags(s->ds));
}
+/*@null@*/
static PyObject *
rpmds_TagN(rpmdsObject * s, PyObject * args)
/*@*/
@@ -85,6 +93,7 @@ rpmds_TagN(rpmdsObject * s, PyObject * args)
return Py_BuildValue("i", rpmdsTagN(s->ds));
}
+/*@null@*/
static PyObject *
rpmds_Color(rpmdsObject * s, PyObject * args)
/*@*/
@@ -93,6 +102,7 @@ rpmds_Color(rpmdsObject * s, PyObject * args)
return Py_BuildValue("i", rpmdsColor(s->ds));
}
+/*@null@*/
static PyObject *
rpmds_Refs(rpmdsObject * s, PyObject * args)
/*@*/
@@ -116,6 +126,7 @@ rpmds_iter(rpmdsObject * s)
return (PyObject *)s;
}
+/*@null@*/
static PyObject *
rpmds_iternext(rpmdsObject * s)
/*@globals _Py_NoneStruct @*/
@@ -153,6 +164,7 @@ rpmds_iternext(rpmdsObject * s)
return result;
}
+/*@null@*/
static PyObject *
rpmds_Next(rpmdsObject * s, PyObject *args)
/*@globals _Py_NoneStruct @*/
@@ -172,6 +184,7 @@ rpmds_Next(rpmdsObject * s, PyObject *args)
return result;
}
+/*@null@*/
static PyObject *
rpmds_SetNoPromote(rpmdsObject * s, PyObject * args)
/*@modifies s @*/
@@ -183,6 +196,7 @@ rpmds_SetNoPromote(rpmdsObject * s, PyObject * args)
return Py_BuildValue("i", rpmdsSetNoPromote(s->ds, nopromote));
}
+/*@null@*/
static PyObject *
rpmds_Notify(rpmdsObject * s, PyObject * args)
/*@globals _Py_NoneStruct @*/
@@ -199,6 +213,7 @@ rpmds_Notify(rpmdsObject * s, PyObject * args)
}
#ifdef NOTYET
+/*@null@*/
static PyObject *
rpmds_Problem(rpmdsObject * s, PyObject * args)
/*@*/
@@ -293,6 +308,7 @@ rpmds_length(rpmdsObject * s)
return rpmdsCount(s->ds);
}
+/*@null@*/
static PyObject *
rpmds_subscript(rpmdsObject * s, PyObject * key)
/*@modifies s @*/
diff --git a/python/rpmds-py.h b/python/rpmds-py.h
index b0c15b42c..0a01fe458 100644
--- a/python/rpmds-py.h
+++ b/python/rpmds-py.h
@@ -24,26 +24,31 @@ extern PyTypeObject rpmds_Type;
/**
*/
+/*@null@*/
rpmds dsFromDs(rpmdsObject * ds)
/*@*/;
/**
*/
+/*@null@*/
rpmdsObject * rpmds_Wrap(rpmds ds)
/*@*/;
/**
*/
+/*@null@*/
rpmdsObject * rpmds_Single(PyObject * s, PyObject * args)
/*@*/;
/**
*/
+/*@null@*/
rpmdsObject * hdr_dsFromHeader(PyObject * s, PyObject * args)
/*@*/;
/**
*/
+/*@null@*/
rpmdsObject * hdr_dsOfHeader(PyObject * s, PyObject * args)
/*@*/;
diff --git a/python/rpmfd-py.c b/python/rpmfd-py.c
index e3ae9c65d..9c43bc7f7 100644
--- a/python/rpmfd-py.c
+++ b/python/rpmfd-py.c
@@ -32,6 +32,7 @@ static int _rpmfd_debug = 1;
* \brief An python rpm.fd object represents an rpm I/O handle.
*/
+/*@null@*/
static PyObject *
rpmfd_Debug(/*@unused@*/ rpmfdObject * s, PyObject * args)
/*@globals _Py_NoneStruct @*/
@@ -79,6 +80,7 @@ static int closeCallback(FILE * f)
last = node;
node = node->next;
}
+/*@-branchstate@*/
if (node) {
if (last)
last->next = node->next;
@@ -91,11 +93,13 @@ static int closeCallback(FILE * f)
node->fd = fdFree(node->fd, "closeCallback");
node = _free (node);
}
+/*@=branchstate@*/
return 0;
}
/**
*/
+/*@null@*/
static PyObject *
rpmfd_Fopen(/*@unused@*/ PyObject * s, PyObject * args)
/*@globals fdhead, fdtail @*/
@@ -136,6 +140,7 @@ rpmfd_Fopen(/*@unused@*/ PyObject * s, PyObject * args)
}
node->next = NULL;
+/*@-branchstate@*/
if (!fdhead) {
fdhead = fdtail = node;
} else if (fdtail) {
@@ -143,6 +148,7 @@ rpmfd_Fopen(/*@unused@*/ PyObject * s, PyObject * args)
} else {
fdhead = node;
}
+/*@=branchstate@*/
fdtail = node;
return PyFile_FromFile (node->f, path, mode, closeCallback);
@@ -247,6 +253,7 @@ fprintf(stderr, "*** rpmfd_alloc(%p,%d) ret %p\n", subtype, nitems, s);
/** \ingroup py_c
*/
+/*@null@*/
static rpmfdObject * rpmfd_new(PyTypeObject * subtype, PyObject *args, PyObject *kwds)
/*@*/
{
diff --git a/python/rpmfd-py.h b/python/rpmfd-py.h
index edea5e8ae..0d016603f 100644
--- a/python/rpmfd-py.h
+++ b/python/rpmfd-py.h
@@ -8,12 +8,14 @@
typedef struct rpmfdObject_s {
PyObject_HEAD
PyObject *md_dict; /*!< to look like PyModuleObject */
+/*@relnull@*/
FD_t fd;
} rpmfdObject;
/*@unchecked@*/
extern PyTypeObject rpmfd_Type;
+/*@null@*/
rpmfdObject * rpmfd_Wrap(FD_t fd)
/*@*/;
diff --git a/python/rpmfi-py.c b/python/rpmfi-py.c
index bd77e15fa..691ba0639 100644
--- a/python/rpmfi-py.c
+++ b/python/rpmfi-py.c
@@ -19,6 +19,7 @@
/*@access rpmfi @*/
+/*@null@*/
static PyObject *
rpmfi_Debug(/*@unused@*/ rpmfiObject * s, PyObject * args)
/*@globals _Py_NoneStruct @*/
@@ -29,6 +30,7 @@ rpmfi_Debug(/*@unused@*/ rpmfiObject * s, PyObject * args)
return Py_None;
}
+/*@null@*/
static PyObject *
rpmfi_FC(rpmfiObject * s, PyObject * args)
/*@*/
@@ -37,6 +39,7 @@ rpmfi_FC(rpmfiObject * s, PyObject * args)
return Py_BuildValue("i", rpmfiFC(s->fi));
}
+/*@null@*/
static PyObject *
rpmfi_FX(rpmfiObject * s, PyObject * args)
/*@*/
@@ -45,6 +48,7 @@ rpmfi_FX(rpmfiObject * s, PyObject * args)
return Py_BuildValue("i", rpmfiFX(s->fi));
}
+/*@null@*/
static PyObject *
rpmfi_DC(rpmfiObject * s, PyObject * args)
/*@*/
@@ -53,6 +57,7 @@ rpmfi_DC(rpmfiObject * s, PyObject * args)
return Py_BuildValue("i", rpmfiDC(s->fi));
}
+/*@null@*/
static PyObject *
rpmfi_DX(rpmfiObject * s, PyObject * args)
/*@*/
@@ -61,6 +66,7 @@ rpmfi_DX(rpmfiObject * s, PyObject * args)
return Py_BuildValue("i", rpmfiDX(s->fi));
}
+/*@null@*/
static PyObject *
rpmfi_BN(rpmfiObject * s, PyObject * args)
/*@*/
@@ -69,6 +75,7 @@ rpmfi_BN(rpmfiObject * s, PyObject * args)
return Py_BuildValue("s", xstrdup(rpmfiBN(s->fi)));
}
+/*@null@*/
static PyObject *
rpmfi_DN(rpmfiObject * s, PyObject * args)
/*@*/
@@ -77,6 +84,7 @@ rpmfi_DN(rpmfiObject * s, PyObject * args)
return Py_BuildValue("s", xstrdup(rpmfiDN(s->fi)));
}
+/*@null@*/
static PyObject *
rpmfi_FN(rpmfiObject * s, PyObject * args)
/*@modifies s @*/
@@ -85,6 +93,7 @@ rpmfi_FN(rpmfiObject * s, PyObject * args)
return Py_BuildValue("s", xstrdup(rpmfiFN(s->fi)));
}
+/*@null@*/
static PyObject *
rpmfi_FFlags(rpmfiObject * s, PyObject * args)
/*@*/
@@ -93,6 +102,7 @@ rpmfi_FFlags(rpmfiObject * s, PyObject * args)
return Py_BuildValue("i", rpmfiFFlags(s->fi));
}
+/*@null@*/
static PyObject *
rpmfi_VFlags(rpmfiObject * s, PyObject * args)
/*@*/
@@ -101,6 +111,7 @@ rpmfi_VFlags(rpmfiObject * s, PyObject * args)
return Py_BuildValue("i", rpmfiVFlags(s->fi));
}
+/*@null@*/
static PyObject *
rpmfi_FMode(rpmfiObject * s, PyObject * args)
/*@*/
@@ -109,6 +120,7 @@ rpmfi_FMode(rpmfiObject * s, PyObject * args)
return Py_BuildValue("i", rpmfiFMode(s->fi));
}
+/*@null@*/
static PyObject *
rpmfi_FState(rpmfiObject * s, PyObject * args)
/*@*/
@@ -118,6 +130,7 @@ rpmfi_FState(rpmfiObject * s, PyObject * args)
}
/* XXX rpmfiMD5 */
+/*@null@*/
static PyObject *
rpmfi_MD5(rpmfiObject * s, PyObject * args)
/*@*/
@@ -129,12 +142,14 @@ rpmfi_MD5(rpmfiObject * s, PyObject * args)
if (!PyArg_ParseTuple(args, ":MD5")) return NULL;
MD5 = rpmfiMD5(s->fi);
+ if (MD5 != NULL)
for (i = 0, t = fmd5; i < 16; i++, t += 2)
sprintf(t, "%02x", MD5[i]);
*t = '\0';
return Py_BuildValue("s", xstrdup(fmd5));
}
+/*@null@*/
static PyObject *
rpmfi_FLink(rpmfiObject * s, PyObject * args)
/*@*/
@@ -143,6 +158,7 @@ rpmfi_FLink(rpmfiObject * s, PyObject * args)
return Py_BuildValue("s", xstrdup(rpmfiFLink(s->fi)));
}
+/*@null@*/
static PyObject *
rpmfi_FSize(rpmfiObject * s, PyObject * args)
/*@*/
@@ -151,6 +167,7 @@ rpmfi_FSize(rpmfiObject * s, PyObject * args)
return Py_BuildValue("i", rpmfiFSize(s->fi));
}
+/*@null@*/
static PyObject *
rpmfi_FRdev(rpmfiObject * s, PyObject * args)
/*@*/
@@ -159,6 +176,7 @@ rpmfi_FRdev(rpmfiObject * s, PyObject * args)
return Py_BuildValue("i", rpmfiFRdev(s->fi));
}
+/*@null@*/
static PyObject *
rpmfi_FMtime(rpmfiObject * s, PyObject * args)
/*@*/
@@ -167,6 +185,7 @@ rpmfi_FMtime(rpmfiObject * s, PyObject * args)
return Py_BuildValue("i", rpmfiFMtime(s->fi));
}
+/*@null@*/
static PyObject *
rpmfi_FUser(rpmfiObject * s, PyObject * args)
/*@*/
@@ -175,6 +194,7 @@ rpmfi_FUser(rpmfiObject * s, PyObject * args)
return Py_BuildValue("s", xstrdup(rpmfiFUser(s->fi)));
}
+/*@null@*/
static PyObject *
rpmfi_FGroup(rpmfiObject * s, PyObject * args)
/*@*/
@@ -183,6 +203,7 @@ rpmfi_FGroup(rpmfiObject * s, PyObject * args)
return Py_BuildValue("s", xstrdup(rpmfiFGroup(s->fi)));
}
+/*@null@*/
static PyObject *
rpmfi_FColor(rpmfiObject * s, PyObject * args)
/*@*/
@@ -191,6 +212,7 @@ rpmfi_FColor(rpmfiObject * s, PyObject * args)
return Py_BuildValue("i", rpmfiFColor(s->fi));
}
+/*@null@*/
static PyObject *
rpmfi_FClass(rpmfiObject * s, PyObject * args)
/*@*/
@@ -213,6 +235,7 @@ rpmfi_iter(rpmfiObject * s, /*@unused@*/ PyObject * args)
}
#endif
+/*@null@*/
static PyObject *
rpmfi_iternext(rpmfiObject * s)
/*@globals _Py_NoneStruct @*/
@@ -311,6 +334,7 @@ rpmfi_Next(rpmfiObject * s, /*@unused@*/ PyObject * args)
}
#ifdef NOTYET
+/*@null@*/
static PyObject *
rpmfi_NextD(rpmfiObject * s, PyObject * args)
/*@*/
@@ -321,6 +345,7 @@ rpmfi_NextD(rpmfiObject * s, PyObject * args)
return Py_None;
}
+/*@null@*/
static PyObject *
rpmfi_InitD(rpmfiObject * s, PyObject * args)
/*@*/
@@ -435,6 +460,7 @@ rpmfi_length(rpmfiObject * s)
return rpmfiFC(s->fi);
}
+/*@null@*/
static PyObject *
rpmfi_subscript(rpmfiObject * s, PyObject * key)
/*@modifies s @*/
diff --git a/python/rpmfi-py.h b/python/rpmfi-py.h
index e721a349b..addff73a9 100644
--- a/python/rpmfi-py.h
+++ b/python/rpmfi-py.h
@@ -18,13 +18,17 @@ typedef struct rpmfiObject_s {
/*@unchecked@*/
extern PyTypeObject rpmfi_Type;
+/*@null@*/
rpmfi fiFromFi(rpmfiObject * fi)
/*@*/;
+/*@null@*/
rpmfiObject * rpmfi_Wrap(rpmfi fi)
/*@*/;
+/*@null@*/
rpmfiObject * hdr_fiFromHeader(PyObject * s, PyObject * args)
- /*@*/;
+ /*@globals rpmGlobalMacroContext @*/
+ /*@modifies rpmGlobalMacroContext @*/;
#endif
diff --git a/python/rpmfts-py.c b/python/rpmfts-py.c
index eee87e1c3..52b16b55f 100644
--- a/python/rpmfts-py.c
+++ b/python/rpmfts-py.c
@@ -72,10 +72,11 @@ rpmfts_initialize(rpmftsObject * s, const char * root, int options, int ignore)
/*@modifies s @*/
{
int ac = 1;
- char * t;
size_t nb;
+/*@-branchstate@*/
if (root == NULL) root = "/";
+/*@=branchstate@*/
if (options == -1) options = (FTS_COMFOLLOW | FTS_LOGICAL | FTS_NOSTAT);
if (ignore == -1) ignore = infoBit(FTS_DP);
@@ -84,10 +85,12 @@ rpmfts_initialize(rpmftsObject * s, const char * root, int options, int ignore)
nb = (ac + 1) * sizeof(*s->roots);
nb += strlen(root) + 1;
s->roots = malloc(nb);
- t = (char *) &s->roots[ac + 1];
- s->roots[0] = t;
- s->roots[ac] = NULL;
- (void) stpcpy(t, root);
+ if (s->roots != NULL) {
+ char *t = (char *) &s->roots[ac + 1];
+ s->roots[0] = t;
+ s->roots[ac] = NULL;
+ (void) stpcpy(t, root);
+ }
s->options = options;
s->ignore = ignore;
@@ -131,6 +134,7 @@ rpmfts_debug(__FUNCTION__, s);
return rc;
}
+/*@null@*/
static PyObject *
rpmfts_step(rpmftsObject * s)
/*@modifies s @*/
@@ -168,6 +172,7 @@ rpmfts_debug(__FUNCTION__, s);
* \brief A python rpm.fts object represents an rpm fts(3) handle.
*/
+/*@null@*/
static PyObject *
rpmfts_Debug(/*@unused@*/ rpmftsObject * s, PyObject * args)
/*@globals _Py_NoneStruct @*/
@@ -180,6 +185,7 @@ rpmfts_Debug(/*@unused@*/ rpmftsObject * s, PyObject * args)
return Py_None;
}
+/*@null@*/
static PyObject *
rpmfts_Open(rpmftsObject * s, PyObject * args)
/*@modifies s @*/
@@ -199,6 +205,7 @@ rpmfts_debug(__FUNCTION__, s);
return (PyObject *)s;
}
+/*@null@*/
static PyObject *
rpmfts_Read(rpmftsObject * s, PyObject * args)
/*@globals _Py_NoneStruct @*/
@@ -219,6 +226,7 @@ rpmfts_debug(__FUNCTION__, s);
return result;
}
+/*@null@*/
static PyObject *
rpmfts_Children(rpmftsObject * s, PyObject * args)
/*@globals _Py_NoneStruct @*/
@@ -240,6 +248,7 @@ rpmfts_debug(__FUNCTION__, s);
return Py_None;
}
+/*@null@*/
static PyObject *
rpmfts_Close(rpmftsObject * s, PyObject * args)
/*@modifies s @*/
@@ -251,6 +260,7 @@ rpmfts_debug(__FUNCTION__, s);
return Py_BuildValue("i", rpmfts_state(s, RPMFTS_CLOSE));
}
+/*@null@*/
static PyObject *
rpmfts_Set(rpmftsObject * s, PyObject * args)
/*@modifies s @*/
@@ -326,6 +336,7 @@ rpmfts_iter(rpmftsObject * s)
return (PyObject *)s;
}
+/*@null@*/
static PyObject *
rpmfts_iternext(rpmftsObject * s)
/*@modifies s @*/
@@ -388,6 +399,7 @@ rpmfts_debug(__FUNCTION__, s);
return rpmfts_initialize(s, root, options, ignore);
}
+/*@null@*/
static PyObject * rpmfts_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
/*@*/
{
@@ -491,7 +503,7 @@ static int rpmfts_print(rpmftsObject * s, FILE * fp, /*@unused@*/ int flags)
{
static int indent = 2;
- if (!(s && s->ftsp && s->fts))
+ if (!(s != NULL && s->ftsp != NULL && s->fts != NULL))
return -1;
fprintf(fp, "FTS_%-7s %*s%s", ftsInfoStr(s->fts->fts_info),
indent * (s->fts->fts_level < 0 ? 0 : s->fts->fts_level), "",
diff --git a/python/rpmmi-py.c b/python/rpmmi-py.c
index 5fc40207f..4766bbdb9 100644
--- a/python/rpmmi-py.c
+++ b/python/rpmmi-py.c
@@ -84,6 +84,7 @@ rpmmi_iter(rpmmiObject * s)
/**
*/
+/*@null@*/
static PyObject *
rpmmi_iternext(rpmmiObject * s)
/*@globals rpmGlobalMacroContext @*/
@@ -100,6 +101,7 @@ rpmmi_iternext(rpmmiObject * s)
/**
*/
+/*@null@*/
static PyObject *
rpmmi_Next(rpmmiObject * s, PyObject *args)
/*@globals rpmGlobalMacroContext, _Py_NoneStruct @*/
@@ -121,6 +123,7 @@ rpmmi_Next(rpmmiObject * s, PyObject *args)
/**
*/
+/*@null@*/
static PyObject *
rpmmi_Instance(rpmmiObject * s, PyObject * args)
/*@*/
@@ -130,7 +133,7 @@ rpmmi_Instance(rpmmiObject * s, PyObject * args)
if (!PyArg_ParseTuple(args, ":Instance"))
return NULL;
- if (s->mi)
+ if (s->mi != NULL)
rc = rpmdbGetIteratorOffset(s->mi);
return Py_BuildValue("i", rc);
@@ -138,6 +141,7 @@ rpmmi_Instance(rpmmiObject * s, PyObject * args)
/**
*/
+/*@null@*/
static PyObject *
rpmmi_Count(rpmmiObject * s, PyObject * args)
/*@*/
@@ -147,7 +151,7 @@ rpmmi_Count(rpmmiObject * s, PyObject * args)
if (!PyArg_ParseTuple(args, ":Instance"))
return NULL;
- if (s->mi)
+ if (s->mi != NULL)
rc = rpmdbGetIteratorCount(s->mi);
return Py_BuildValue("i", rc);
@@ -155,6 +159,7 @@ rpmmi_Count(rpmmiObject * s, PyObject * args)
/**
*/
+/*@null@*/
static PyObject *
rpmmi_Pattern(rpmmiObject * s, PyObject * args)
/*@globals rpmGlobalMacroContext, _Py_NoneStruct @*/
diff --git a/python/rpmmi-py.h b/python/rpmmi-py.h
index 4c08bd63e..c45b2fd03 100644
--- a/python/rpmmi-py.h
+++ b/python/rpmmi-py.h
@@ -20,6 +20,7 @@ struct rpmmiObject_s {
/*@unchecked@*/
extern PyTypeObject rpmmi_Type;
+/*@null@*/
rpmmiObject * rpmmi_Wrap(rpmdbMatchIterator mi)
/*@*/;
diff --git a/python/rpmrc-py.c b/python/rpmrc-py.c
index 43fb1051f..12e69811a 100644
--- a/python/rpmrc-py.c
+++ b/python/rpmrc-py.c
@@ -227,6 +227,7 @@ fprintf(stderr, "*** rpmrc_iter(%p[%s])\n", s, lbl(s));
/**
*/
+/*@null@*/
static PyObject * rpmrc_iternext(PyObject * s)
/*@*/
{
@@ -239,6 +240,7 @@ fprintf(stderr, "*** rpmrc_iternext(%p[%s])\n", s, lbl(s));
/**
*/
+/*@null@*/
static PyObject * rpmrc_next(PyObject * s, PyObject *args)
/*@*/
{
@@ -285,6 +287,7 @@ fprintf(stderr, "*** rpmrc_alloc(%p[%s},%d) ret %p[%s]\n", subtype, lbl(subtype)
/** \ingroup py_c
*/
+/*@null@*/
static PyObject * rpmrc_new(PyTypeObject * subtype, PyObject *args, PyObject *kwds)
/*@*/
{
diff --git a/python/rpmrc-py.h b/python/rpmrc-py.h
index ccac3b689..1ebfa67c3 100644
--- a/python/rpmrc-py.h
+++ b/python/rpmrc-py.h
@@ -23,14 +23,17 @@ struct rpmrcObject_s {
/*@unchecked@*/
extern PyTypeObject rpmrc_Type;
+/*@null@*/
PyObject * rpmrc_AddMacro(PyObject * self, PyObject * args)
/*@globals rpmGlobalMacroContext, _Py_NoneStruct @*/
/*@modifies rpmGlobalMacroContext, _Py_NoneStruct @*/;
+/*@null@*/
PyObject * rpmrc_DelMacro(PyObject * self, PyObject * args)
/*@globals rpmGlobalMacroContext, _Py_NoneStruct @*/
/*@modifies rpmGlobalMacroContext, _Py_NoneStruct @*/;
#if Py_TPFLAGS_HAVE_ITER /* XXX backport to python-1.5.2 */
+/*@null@*/
PyObject * rpmrc_Create(PyObject * self, PyObject * args, PyObject * kwds)
/*@*/;
#endif
diff --git a/python/rpmte-py.c b/python/rpmte-py.c
index e1e1ff60c..a004c07b8 100644
--- a/python/rpmte-py.c
+++ b/python/rpmte-py.c
@@ -58,6 +58,7 @@
* @param tag 'Basenames'
*/
+/*@null@*/
static PyObject *
rpmte_Debug(/*@unused@*/ rpmteObject * s, /*@unused@*/ PyObject * args)
/*@globals _Py_NoneStruct @*/
@@ -68,6 +69,7 @@ rpmte_Debug(/*@unused@*/ rpmteObject * s, /*@unused@*/ PyObject * args)
return Py_None;
}
+/*@null@*/
static PyObject *
rpmte_TEType(rpmteObject * s, PyObject * args)
/*@*/
@@ -76,6 +78,7 @@ rpmte_TEType(rpmteObject * s, PyObject * args)
return Py_BuildValue("i", rpmteType(s->te));
}
+/*@null@*/
static PyObject *
rpmte_N(rpmteObject * s, PyObject * args)
/*@*/
@@ -84,6 +87,7 @@ rpmte_N(rpmteObject * s, PyObject * args)
return Py_BuildValue("s", rpmteN(s->te));
}
+/*@null@*/
static PyObject *
rpmte_E(rpmteObject * s, PyObject * args)
/*@*/
@@ -92,6 +96,7 @@ rpmte_E(rpmteObject * s, PyObject * args)
return Py_BuildValue("s", rpmteE(s->te));
}
+/*@null@*/
static PyObject *
rpmte_V(rpmteObject * s, PyObject * args)
/*@*/
@@ -100,6 +105,7 @@ rpmte_V(rpmteObject * s, PyObject * args)
return Py_BuildValue("s", rpmteV(s->te));
}
+/*@null@*/
static PyObject *
rpmte_R(rpmteObject * s, PyObject * args)
/*@*/
@@ -108,6 +114,7 @@ rpmte_R(rpmteObject * s, PyObject * args)
return Py_BuildValue("s", rpmteR(s->te));
}
+/*@null@*/
static PyObject *
rpmte_A(rpmteObject * s, PyObject * args)
/*@*/
@@ -116,6 +123,7 @@ rpmte_A(rpmteObject * s, PyObject * args)
return Py_BuildValue("s", rpmteA(s->te));
}
+/*@null@*/
static PyObject *
rpmte_O(rpmteObject * s, PyObject * args)
/*@*/
@@ -124,6 +132,7 @@ rpmte_O(rpmteObject * s, PyObject * args)
return Py_BuildValue("s", rpmteO(s->te));
}
+/*@null@*/
static PyObject *
rpmte_NEVR(rpmteObject * s, PyObject * args)
/*@*/
@@ -132,6 +141,7 @@ rpmte_NEVR(rpmteObject * s, PyObject * args)
return Py_BuildValue("s", rpmteNEVR(s->te));
}
+/*@null@*/
static PyObject *
rpmte_Color(rpmteObject * s, PyObject * args)
/*@*/
@@ -140,6 +150,7 @@ rpmte_Color(rpmteObject * s, PyObject * args)
return Py_BuildValue("i", rpmteColor(s->te));
}
+/*@null@*/
static PyObject *
rpmte_PkgFileSize(rpmteObject * s, PyObject * args)
/*@*/
@@ -148,6 +159,7 @@ rpmte_PkgFileSize(rpmteObject * s, PyObject * args)
return Py_BuildValue("i", rpmtePkgFileSize(s->te));
}
+/*@null@*/
static PyObject *
rpmte_Depth(rpmteObject * s, PyObject * args)
/*@*/
@@ -156,6 +168,7 @@ rpmte_Depth(rpmteObject * s, PyObject * args)
return Py_BuildValue("i", rpmteDepth(s->te));
}
+/*@null@*/
static PyObject *
rpmte_Npreds(rpmteObject * s, PyObject * args)
/*@*/
@@ -164,6 +177,7 @@ rpmte_Npreds(rpmteObject * s, PyObject * args)
return Py_BuildValue("i", rpmteNpreds(s->te));
}
+/*@null@*/
static PyObject *
rpmte_Degree(rpmteObject * s, PyObject * args)
/*@*/
@@ -172,6 +186,7 @@ rpmte_Degree(rpmteObject * s, PyObject * args)
return Py_BuildValue("i", rpmteDegree(s->te));
}
+/*@null@*/
static PyObject *
rpmte_Parent(rpmteObject * s, PyObject * args)
/*@*/
@@ -180,6 +195,7 @@ rpmte_Parent(rpmteObject * s, PyObject * args)
return Py_BuildValue("i", rpmteParent(s->te));
}
+/*@null@*/
static PyObject *
rpmte_Tree(rpmteObject * s, PyObject * args)
/*@*/
@@ -188,6 +204,7 @@ rpmte_Tree(rpmteObject * s, PyObject * args)
return Py_BuildValue("i", rpmteTree(s->te));
}
+/*@null@*/
static PyObject *
rpmte_AddedKey(rpmteObject * s, PyObject * args)
/*@*/
@@ -196,6 +213,7 @@ rpmte_AddedKey(rpmteObject * s, PyObject * args)
return Py_BuildValue("i", rpmteAddedKey(s->te));
}
+/*@null@*/
static PyObject *
rpmte_DependsOnKey(rpmteObject * s, PyObject * args)
/*@*/
@@ -204,6 +222,7 @@ rpmte_DependsOnKey(rpmteObject * s, PyObject * args)
return Py_BuildValue("i", rpmteDependsOnKey(s->te));
}
+/*@null@*/
static PyObject *
rpmte_DBOffset(rpmteObject * s, PyObject * args)
/*@*/
@@ -212,6 +231,7 @@ rpmte_DBOffset(rpmteObject * s, PyObject * args)
return Py_BuildValue("i", rpmteDBOffset(s->te));
}
+/*@null@*/
static PyObject *
rpmte_Key(rpmteObject * s, PyObject * args)
/*@globals _Py_NoneStruct @*/
@@ -229,6 +249,7 @@ rpmte_Key(rpmteObject * s, PyObject * args)
return Key;
}
+/*@null@*/
static PyObject *
rpmte_DS(rpmteObject * s, PyObject * args)
/*@globals _Py_NoneStruct @*/
@@ -259,6 +280,7 @@ rpmte_DS(rpmteObject * s, PyObject * args)
return (PyObject *) rpmds_Wrap(rpmdsLink(ds, "rpmte_DS"));
}
+/*@null@*/
static PyObject *
rpmte_FI(rpmteObject * s, PyObject * args)
/*@globals _Py_NoneStruct @*/
diff --git a/python/rpmte-py.h b/python/rpmte-py.h
index 504cc5ee2..81ff3cf95 100644
--- a/python/rpmte-py.h
+++ b/python/rpmte-py.h
@@ -16,6 +16,7 @@ typedef struct rpmteObject_s {
/*@unchecked@*/
extern PyTypeObject rpmte_Type;
+/*@null@*/
rpmteObject * rpmte_Wrap(rpmte te)
/*@*/;
diff --git a/python/rpmts-py.c b/python/rpmts-py.c
index 1b81a96cc..f7c381aad 100644
--- a/python/rpmts-py.c
+++ b/python/rpmts-py.c
@@ -169,6 +169,7 @@ struct rpmtsCallbackType_s {
/** \ingroup py_c
*/
+/*@null@*/
static PyObject *
rpmts_Debug(/*@unused@*/ rpmtsObject * s, PyObject * args)
/*@globals _Py_NoneStruct @*/
@@ -191,7 +192,8 @@ fprintf(stderr, "*** rpmts_Debug(%p) ts %p\n", s, s->ts);
*/
static void rpmtsAddAvailableElement(rpmts ts, Header h,
/*@exposed@*/ /*@null@*/ fnpyKey key)
- /*@modifies h, ts @*/
+ /*@globals rpmGlobalMacroContext @*/
+ /*@modifies h, ts, rpmGlobalMacroContext @*/
{
int scareMem = 0;
rpmds provides = rpmdsNew(h, RPMTAG_PROVIDENAME, scareMem);
@@ -210,6 +212,7 @@ fprintf(stderr, "\tAddAvailable(%p) list %p\n", ts, ts->availablePackages);
/** \ingroup py_c
*/
+/*@null@*/
static PyObject *
rpmts_AddInstall(rpmtsObject * s, PyObject * args)
/*@globals rpmGlobalMacroContext, _Py_NoneStruct @*/
@@ -217,7 +220,7 @@ rpmts_AddInstall(rpmtsObject * s, PyObject * args)
{
hdrObject * h;
PyObject * key;
- char * how = NULL;
+ char * how = "u"; /* XXX default to upgrade element if missing */
int isUpgrade = 0;
if (!PyArg_ParseTuple(args, "O!O|s:AddInstall", &hdr_Type, &h, &key, &how))
@@ -255,6 +258,7 @@ fprintf(stderr, "*** rpmts_AddInstall(%p,%p,%p,%s) ts %p\n", s, h, key, how, s->
/** \ingroup py_c
* @todo Permit finer control (i.e. not just --allmatches) of deleted elments.
*/
+/*@null@*/
static PyObject *
rpmts_AddErase(rpmtsObject * s, PyObject * args)
/*@globals rpmGlobalMacroContext, _Py_NoneStruct @*/
@@ -352,6 +356,7 @@ fprintf(stderr, "*** rpmts_SolveCallback(%p,%p,%p) \"%s\"\n", ts, ds, data, rpmd
/** \ingroup py_c
*/
+/*@null@*/
static PyObject *
rpmts_Check(rpmtsObject * s, PyObject * args)
/*@globals rpmGlobalMacroContext, _Py_NoneStruct @*/
@@ -394,7 +399,7 @@ fprintf(stderr, "*** rpmts_Check(%p) ts %p cb %p\n", s, s->ts, cbInfo.cb);
PyEval_RestoreThread(cbInfo._save);
- if (ps) {
+ if (ps != NULL) {
list = PyList_New(0);
/* XXX TODO: rpmlib >= 4.0.3 can return multiple suggested keys. */
@@ -465,6 +470,7 @@ fprintf(stderr, "*** rpmts_Check(%p) ts %p cb %p\n", s, s->ts, cbInfo.cb);
/** \ingroup py_c
*/
+/*@null@*/
static PyObject *
rpmts_Order(rpmtsObject * s, PyObject * args)
/*@globals rpmGlobalMacroContext @*/
@@ -486,6 +492,7 @@ fprintf(stderr, "*** rpmts_Order(%p) ts %p\n", s, s->ts);
/** \ingroup py_c
*/
+/*@null@*/
static PyObject *
rpmts_Clean(rpmtsObject * s, PyObject * args)
/*@globals _Py_NoneStruct @*/
@@ -504,6 +511,7 @@ fprintf(stderr, "*** rpmts_Clean(%p) ts %p\n", s, s->ts);
/** \ingroup py_c
*/
+/*@null@*/
static PyObject *
rpmts_IDTXload(rpmtsObject * s, PyObject * args)
/*@globals rpmGlobalMacroContext, _Py_NoneStruct @*/
@@ -522,6 +530,7 @@ fprintf(stderr, "*** rpmts_IDTXload(%p) ts %p\n", s, s->ts);
idtx = IDTXload(s->ts, tag);
Py_END_ALLOW_THREADS
+/*@-branchstate@*/
if (idtx == NULL || idtx->nidt <= 0) {
Py_INCREF(Py_None);
result = Py_None;
@@ -540,6 +549,7 @@ fprintf(stderr, "*** rpmts_IDTXload(%p) ts %p\n", s, s->ts);
Py_DECREF(ho);
}
}
+/*@=branchstate@*/
idtx = IDTXfree(idtx);
@@ -548,6 +558,7 @@ fprintf(stderr, "*** rpmts_IDTXload(%p) ts %p\n", s, s->ts);
/** \ingroup py_c
*/
+/*@null@*/
static PyObject *
rpmts_IDTXglob(rpmtsObject * s, PyObject * args)
/*@globals rpmGlobalMacroContext, _Py_NoneStruct @*/
@@ -569,6 +580,7 @@ fprintf(stderr, "*** rpmts_IDTXglob(%p) ts %p\n", s, s->ts);
globstr = _free(globstr);
Py_END_ALLOW_THREADS
+/*@-branchstate@*/
if (idtx == NULL || idtx->nidt <= 0) {
Py_INCREF(Py_None);
result = Py_None;
@@ -587,6 +599,7 @@ fprintf(stderr, "*** rpmts_IDTXglob(%p) ts %p\n", s, s->ts);
Py_DECREF(ho);
}
}
+/*@=branchstate@*/
idtx = IDTXfree(idtx);
@@ -595,6 +608,7 @@ fprintf(stderr, "*** rpmts_IDTXglob(%p) ts %p\n", s, s->ts);
/** \ingroup py_c
*/
+/*@null@*/
static PyObject *
rpmts_Rollback(rpmtsObject * s, PyObject * args)
/*@globals rpmGlobalMacroContext @*/
@@ -631,6 +645,7 @@ fprintf(stderr, "*** rpmts_Rollback(%p) ts %p\n", s, s->ts);
/** \ingroup py_c
*/
+/*@null@*/
static PyObject *
rpmts_OpenDB(rpmtsObject * s, PyObject * args)
/*@globals rpmGlobalMacroContext @*/
@@ -650,6 +665,7 @@ fprintf(stderr, "*** rpmts_OpenDB(%p) ts %p\n", s, s->ts);
/** \ingroup py_c
*/
+/*@null@*/
static PyObject *
rpmts_CloseDB(rpmtsObject * s, PyObject * args)
/*@modifies s @*/
@@ -669,6 +685,7 @@ fprintf(stderr, "*** rpmts_CloseDB(%p) ts %p\n", s, s->ts);
/** \ingroup py_c
*/
+/*@null@*/
static PyObject *
rpmts_InitDB(rpmtsObject * s, PyObject * args)
/*@globals rpmGlobalMacroContext @*/
@@ -690,6 +707,7 @@ fprintf(stderr, "*** rpmts_InitDB(%p) ts %p\n", s, s->ts);
/** \ingroup py_c
*/
+/*@null@*/
static PyObject *
rpmts_RebuildDB(rpmtsObject * s, PyObject * args)
/*@globals rpmGlobalMacroContext @*/
@@ -711,6 +729,7 @@ fprintf(stderr, "*** rpmts_RebuildDB(%p) ts %p\n", s, s->ts);
/** \ingroup py_c
*/
+/*@null@*/
static PyObject *
rpmts_VerifyDB(rpmtsObject * s, PyObject * args)
/*@globals rpmGlobalMacroContext @*/
@@ -732,6 +751,7 @@ fprintf(stderr, "*** rpmts_VerifyDB(%p) ts %p\n", s, s->ts);
/** \ingroup py_c
*/
+/*@null@*/
static PyObject *
rpmts_HdrFromFdno(rpmtsObject * s, PyObject * args)
/*@globals rpmGlobalMacroContext, fileSystem @*/
@@ -752,6 +772,7 @@ rpmts_HdrFromFdno(rpmtsObject * s, PyObject * args)
if (_rpmts_debug)
fprintf(stderr, "*** rpmts_HdrFromFdno(%p) ts %p rc %d\n", s, s->ts, rpmrc);
+/*@-branchstate@*/
switch (rpmrc) {
case RPMRC_OK:
if (h)
@@ -773,12 +794,14 @@ fprintf(stderr, "*** rpmts_HdrFromFdno(%p) ts %p rc %d\n", s, s->ts, rpmrc);
PyErr_SetString(pyrpmError, "error reading package header");
break;
}
+/*@=branchstate@*/
return result;
}
/** \ingroup py_c
*/
+/*@null@*/
static PyObject *
rpmts_HdrCheck(rpmtsObject * s, PyObject * args)
/*@globals rpmGlobalMacroContext, _Py_NoneStruct @*/
@@ -834,6 +857,7 @@ fprintf(stderr, "*** rpmts_HdrCheck(%p) ts %p\n", s, s->ts);
/** \ingroup py_c
*/
+/*@null@*/
static PyObject *
rpmts_SetVSFlags(rpmtsObject * s, PyObject * args)
/*@modifies s @*/
@@ -852,6 +876,7 @@ fprintf(stderr, "*** rpmts_SetVSFlags(%p) ts %p\n", s, s->ts);
/** \ingroup py_c
*/
+/*@null@*/
static PyObject *
rpmts_SetColor(rpmtsObject * s, PyObject * args)
/*@modifies s @*/
@@ -870,6 +895,7 @@ fprintf(stderr, "*** rpmts_SetColor(%p) ts %p\n", s, s->ts);
/** \ingroup py_c
*/
+/*@null@*/
static PyObject *
rpmts_PgpPrtPkts(rpmtsObject * s, PyObject * args)
/*@globals _Py_NoneStruct @*/
@@ -902,6 +928,7 @@ fprintf(stderr, "*** rpmts_PgpPrtPkts(%p) ts %p\n", s, s->ts);
/** \ingroup py_c
*/
+/*@null@*/
static PyObject *
rpmts_PgpImportPubkey(rpmtsObject * s, PyObject * args)
/*@globals rpmGlobalMacroContext, _Py_NoneStruct @*/
@@ -934,6 +961,7 @@ fprintf(stderr, "*** rpmts_PgpImportPubkey(%p) ts %p\n", s, s->ts);
/** \ingroup py_c
*/
+/*@null@*/
static PyObject *
rpmts_GetKeys(rpmtsObject * s, PyObject * args)
/*@globals _Py_NoneStruct @*/
@@ -971,6 +999,7 @@ fprintf(stderr, "*** rpmts_GetKeys(%p) ts %p\n", s, s->ts);
/** \ingroup py_c
*/
+/*@null@*/
static void *
rpmtsCallback(/*@unused@*/ const void * hd, const rpmCallbackType what,
const unsigned long amount, const unsigned long total,
@@ -1166,6 +1195,7 @@ fprintf(stderr, "*** rpmts_iter(%p) ts %p\n", s, s->ts);
/**
* @todo Add TR_ADDED filter to iterator.
*/
+/*@null@*/
static PyObject *
rpmts_iternext(rpmtsObject * s)
/*@modifies s @*/
@@ -1185,12 +1215,14 @@ fprintf(stderr, "*** rpmts_iternext(%p) ts %p tsi %p %d\n", s, s->ts, s->tsi, s-
}
te = rpmtsiNext(s->tsi, s->tsiFilter);
+/*@-branchstate@*/
if (te != NULL) {
result = (PyObject *) rpmte_Wrap(te);
} else {
s->tsi = rpmtsiFree(s->tsi);
s->tsiFilter = 0;
}
+/*@=branchstate@*/
return result;
}
@@ -1220,6 +1252,7 @@ fprintf(stderr, "*** rpmts_Next(%p) ts %p\n", s, s->ts);
/**
*/
+/*@null@*/
static rpmmiObject *
rpmts_Match(rpmtsObject * s, PyObject * args)
/*@globals rpmGlobalMacroContext @*/
@@ -1370,7 +1403,7 @@ static PyObject * rpmts_getattro(PyObject * o, PyObject * n)
/** \ingroup py_c
*/
static int rpmts_setattro(PyObject * o, PyObject * n, PyObject * v)
- /*@modifies o @*/
+ /*@*/
{
rpmtsObject *s = (rpmtsObject *)o;
char * name = PyString_AsString(n);
diff --git a/python/rpmts-py.h b/python/rpmts-py.h
index 049976d67..10d05d919 100644
--- a/python/rpmts-py.h
+++ b/python/rpmts-py.h
@@ -13,6 +13,7 @@ typedef struct rpmtsObject_s {
rpmts ts;
PyObject * keyList; /* keeps reference counts correct */
FD_t scriptFd;
+/*@relnull@*/
rpmtsi tsi;
rpmElementType tsiFilter;
rpmprobFilterFlags ignoreSet;