summaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
authorjbj <devnull@localhost>2004-10-13 19:03:45 +0000
committerjbj <devnull@localhost>2004-10-13 19:03:45 +0000
commit5c095b4d656f6429700b1c585060b05308dd49e7 (patch)
treeedb37b0517e00256716e09651737dbd3485deab3 /python
parent3027bc96de4ca46c42de6e7cf0b31feed64334bc (diff)
downloadlibrpm-tizen-5c095b4d656f6429700b1c585060b05308dd49e7.tar.gz
librpm-tizen-5c095b4d656f6429700b1c585060b05308dd49e7.tar.bz2
librpm-tizen-5c095b4d656f6429700b1c585060b05308dd49e7.zip
Splint fiddles.
CVS patchset: 7460 CVS date: 2004/10/13 19:03:45
Diffstat (limited to 'python')
-rw-r--r--python/rpmds-py.c12
-rw-r--r--python/rpmfi-py.c1
-rw-r--r--python/rpmps-py.c24
-rw-r--r--python/rpmps-py.h2
-rw-r--r--python/rpmts-py.c5
5 files changed, 29 insertions, 15 deletions
diff --git a/python/rpmds-py.c b/python/rpmds-py.c
index 006076807..472e9c61f 100644
--- a/python/rpmds-py.c
+++ b/python/rpmds-py.c
@@ -239,8 +239,7 @@ rpmds_iter(rpmdsObject * s)
/*@null@*/
static PyObject *
rpmds_iternext(rpmdsObject * s)
- /*@globals _Py_NoneStruct @*/
- /*@modifies s, _Py_NoneStruct @*/
+ /*@modifies s @*/
{
PyObject * result = NULL;
@@ -257,8 +256,10 @@ rpmds_iternext(rpmdsObject * s)
int tagN = rpmdsTagN(s->ds);
int Flags = rpmdsFlags(s->ds);
+/*@-branchstate@*/
if (N != NULL) N = xstrdup(N);
if (EVR != NULL) EVR = xstrdup(EVR);
+/*@=branchstate@*/
result = rpmds_Wrap( rpmdsSingle(tagN, N, EVR, Flags) );
} else
s->active = 0;
@@ -315,9 +316,11 @@ rpmds_Notify(rpmdsObject * s, PyObject * args)
}
/* XXX rpmdsFind uses bsearch on s->ds, so a sort is needed. */
+/*@null@*/
static PyObject *
rpmds_Sort(rpmdsObject * s, PyObject * args)
- /*@modifies s @*/
+ /*@globals _Py_NoneStruct @*/
+ /*@modifies _Py_NoneStruct @*/
{
if (!PyArg_ParseTuple(args, ":Sort"))
return NULL;
@@ -326,6 +329,7 @@ rpmds_Sort(rpmdsObject * s, PyObject * args)
return Py_None;
}
+/*@null@*/
static PyObject *
rpmds_Find(rpmdsObject * s, PyObject * args)
/*@modifies s @*/
@@ -346,6 +350,7 @@ rpmds_Find(rpmdsObject * s, PyObject * args)
return Py_BuildValue("i", rc);
}
+/*@null@*/
static PyObject *
rpmds_Merge(rpmdsObject * s, PyObject * args)
/*@modifies s @*/
@@ -560,6 +565,7 @@ fprintf(stderr, "*** rpmds_alloc(%p,%d) ret %p\n", subtype, nitems, s);
/** \ingroup py_c
*/
+/*@null@*/
static PyObject * rpmds_new(PyTypeObject * subtype, PyObject *args, PyObject *kwds)
/*@globals rpmGlobalMacroContext @*/
/*@modifies rpmGlobalMacroContext @*/
diff --git a/python/rpmfi-py.c b/python/rpmfi-py.c
index e8686ffd4..2bc46cef5 100644
--- a/python/rpmfi-py.c
+++ b/python/rpmfi-py.c
@@ -535,6 +535,7 @@ fprintf(stderr, "*** rpmfi_alloc(%p,%d) ret %p\n", subtype, nitems, s);
/** \ingroup py_c
*/
+/*@null@*/
static PyObject * rpmfi_new(PyTypeObject * subtype, PyObject *args, PyObject *kwds)
/*@globals rpmGlobalMacroContext @*/
/*@modifies rpmGlobalMacroContext @*/
diff --git a/python/rpmps-py.c b/python/rpmps-py.c
index b5a933225..9d7bdef82 100644
--- a/python/rpmps-py.c
+++ b/python/rpmps-py.c
@@ -1,6 +1,7 @@
/** \ingroup py_c
* \file python/rpmps-py.c
*/
+/*@-modunconnomods -evalorderuncon @*/
#include "system.h"
@@ -12,7 +13,9 @@
#include "debug.h"
+/*@access FILE @*/
/*@access rpmps @*/
+/*@access rpmProblem @*/
/*@null@*/
static PyObject *
@@ -27,7 +30,7 @@ rpmps_Debug(/*@unused@*/ rpmpsObject * s, PyObject * args)
static PyObject *
rpmps_iter(rpmpsObject * s)
- /*@*/
+ /*@modifies s @*/
{
if (_rpmps_debug < 0)
fprintf(stderr, "*** rpmps_iter(%p)\n", s);
@@ -39,14 +42,14 @@ fprintf(stderr, "*** rpmps_iter(%p)\n", s);
/*@null@*/
static PyObject *
rpmps_iternext(rpmpsObject * s)
- /*@globals _Py_NoneStruct @*/
- /*@modifies s, _Py_NoneStruct @*/
+ /*@modifies s @*/
{
PyObject * result = NULL;
rpmps ps = s->ps;
if (_rpmps_debug < 0)
fprintf(stderr, "*** rpmps_iternext(%p) ps %p ix %d active %d\n", s, s->ps, s->ix, s->active);
+
/* Reset loop indices on 1st entry. */
if (!s->active) {
s->ix = -1;
@@ -93,7 +96,7 @@ rpmps_print(rpmpsObject * s, FILE * fp, /*@unused@*/ int flags)
/*@modifies s, fp, fileSystem @*/
{
if (_rpmps_debug < 0)
-fprintf(stderr, "*** rpmps_print(%p,%p,%x)\n", s, fp, flags);
+fprintf(stderr, "*** rpmps_print(%p,%p,%x)\n", s, (void *)fp, flags);
if (s && s->ps)
rpmpsPrint(fp, s->ps);
return 0;
@@ -129,7 +132,7 @@ fprintf(stderr, "*** rpmps_length(%p) rc %d\n", s, rc);
/*@null@*/
static PyObject *
rpmps_subscript(rpmpsObject * s, PyObject * key)
- /*@modifies s @*/
+ /*@*/
{
PyObject * result = NULL;
rpmps ps;
@@ -156,6 +159,7 @@ fprintf(stderr, "*** rpmps_subscript(%p,%p) %s\n", s, key, PyString_AsString(res
static int
rpmps_ass_sub(rpmpsObject * s, PyObject * key, PyObject * value)
+ /*@modifies s @*/
{
rpmps ps;
int ix;
@@ -199,6 +203,7 @@ fprintf(stderr, "*** rpmps_ass_sub(%p[%s],%p[%s],%p[%s]) ps %p[%d:%d:%d]\n", s,
return -1;
}
+/*@-branchstate@*/
if (ix >= ps->numProblems) {
/* XXX force append for indices out of range. */
rpmpsAppend(s->ps, p->type, p->pkgNEVR, p->key,
@@ -216,6 +221,7 @@ fprintf(stderr, "*** rpmps_ass_sub(%p[%s],%p[%s],%p[%s]) ps %p[%d:%d:%d]\n", s,
*op = *p; /* structure assignment */
}
+/*@=branchstate@*/
}
return 0;
@@ -230,8 +236,7 @@ static PyMappingMethods rpmps_as_mapping = {
/** \ingroup py_c
*/
static int rpmps_init(rpmpsObject * s, PyObject *args, PyObject *kwds)
- /*@globals rpmGlobalMacroContext @*/
- /*@modifies s, rpmGlobalMacroContext @*/
+ /*@modifies s @*/
{
if (_rpmps_debug < 0)
@@ -273,9 +278,9 @@ fprintf(stderr, "*** rpmps_alloc(%p,%d) ret %p\n", subtype, nitems, s);
/** \ingroup py_c
*/
+/*@null@*/
static PyObject * rpmps_new(PyTypeObject * subtype, PyObject *args, PyObject *kwds)
- /*@globals rpmGlobalMacroContext @*/
- /*@modifies rpmGlobalMacroContext @*/
+ /*@*/
{
rpmpsObject * s = (void *) PyObject_New(rpmpsObject, subtype);
@@ -365,3 +370,4 @@ rpmps_Wrap(rpmps ps)
s->ix = -1;
return s;
}
+/*@=modunconnomods =evalorderuncon @*/
diff --git a/python/rpmps-py.h b/python/rpmps-py.h
index 43655fbcc..5278ce4da 100644
--- a/python/rpmps-py.h
+++ b/python/rpmps-py.h
@@ -14,7 +14,7 @@ typedef struct rpmpsObject_s {
PyObject *md_dict; /*!< to look like PyModuleObject */
int active;
int ix;
-/*@null@*/
+/*@relnull@*/
rpmps ps;
} rpmpsObject;
diff --git a/python/rpmts-py.c b/python/rpmts-py.c
index ec4493d18..4a18fbb3f 100644
--- a/python/rpmts-py.c
+++ b/python/rpmts-py.c
@@ -1116,8 +1116,7 @@ fprintf(stderr, "*** rpmts_SetProbFilter(%p) ts %p ignoreSet %x\n", s, s->ts, ig
/*@null@*/
static rpmpsObject *
rpmts_Problems(rpmtsObject * s, PyObject * args)
- /*@globals rpmGlobalMacroContext @*/
- /*@modifies s, rpmGlobalMacroContext @*/
+ /*@modifies s @*/
{
if (_rpmts_debug)
@@ -1339,6 +1338,7 @@ fprintf(stderr, "*** rpmts_Match(%p) ts %p\n", s, s->ts);
}
if (Key) {
+/*@-branchstate@*/
if (PyString_Check(Key)) {
key = PyString_AsString(Key);
len = PyString_Size(Key);
@@ -1350,6 +1350,7 @@ fprintf(stderr, "*** rpmts_Match(%p) ts %p\n", s, s->ts);
PyErr_SetString(PyExc_TypeError, "unknown key type");
return NULL;
}
+/*@=branchstate@*/
}
/* XXX If not already opened, open the database O_RDONLY now. */