summaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
authorPanu Matilainen <pmatilai@redhat.com>2010-09-21 15:02:43 +0300
committerPanu Matilainen <pmatilai@redhat.com>2010-09-21 15:02:43 +0300
commit7e53dc6ee11a2af50dc8d2c3cb132e7e69aaff18 (patch)
tree01ddb9e22314da867a8a2d3eb9969f154e008b82 /python
parentb9cd5a5e746d1bb0da5d6ccef8d83e7867569168 (diff)
downloadlibrpm-tizen-7e53dc6ee11a2af50dc8d2c3cb132e7e69aaff18.tar.gz
librpm-tizen-7e53dc6ee11a2af50dc8d2c3cb132e7e69aaff18.tar.bz2
librpm-tizen-7e53dc6ee11a2af50dc8d2c3cb132e7e69aaff18.zip
Avoid stepping on toes of relatives, part 2
- Eliminate uses of "class" which is a reserved keyword in C++
Diffstat (limited to 'python')
-rw-r--r--python/header-py.c10
-rw-r--r--python/rpmtd-py.c10
2 files changed, 10 insertions, 10 deletions
diff --git a/python/header-py.c b/python/header-py.c
index 13d5bf81d..5da946c90 100644
--- a/python/header-py.c
+++ b/python/header-py.c
@@ -464,11 +464,11 @@ static PyObject * hdrGetTag(Header h, rpmTag tag)
return res;
}
-static int validItem(rpmTagClass class, PyObject *item)
+static int validItem(rpmTagClass tclass, PyObject *item)
{
int rc;
- switch (class) {
+ switch (tclass) {
case RPM_NUMERIC_CLASS:
rc = (PyLong_Check(item) || PyInt_Check(item));
break;
@@ -487,17 +487,17 @@ static int validItem(rpmTagClass class, PyObject *item)
static int validData(rpmTag tag, rpmTagType type, rpmTagReturnType retype, PyObject *value)
{
- rpmTagClass class = rpmTagGetClass(tag);
+ rpmTagClass tclass = rpmTagGetClass(tag);
int valid = 1;
if (retype == RPM_SCALAR_RETURN_TYPE) {
- valid = validItem(class, value);
+ valid = validItem(tclass, value);
} else if (retype == RPM_ARRAY_RETURN_TYPE && PyList_Check(value)) {
/* python lists can contain arbitrary objects, validate each item */
Py_ssize_t len = PyList_Size(value);
for (Py_ssize_t i = 0; i < len; i++) {
PyObject *item = PyList_GetItem(value, i);
- if (!validItem(class, item)) {
+ if (!validItem(tclass, item)) {
valid = 0;
break;
}
diff --git a/python/rpmtd-py.c b/python/rpmtd-py.c
index 6c4b1f8dc..4138f5510 100644
--- a/python/rpmtd-py.c
+++ b/python/rpmtd-py.c
@@ -11,11 +11,11 @@
/*
* Convert single tag data item to python object of suitable type
*/
-static PyObject * rpmtd_ItemAsPyobj(rpmtd td, rpmTagClass class)
+static PyObject * rpmtd_ItemAsPyobj(rpmtd td, rpmTagClass tclass)
{
PyObject *res = NULL;
- switch (class) {
+ switch (tclass) {
case RPM_STRING_CLASS:
res = PyBytes_FromString(rpmtdGetString(td));
break;
@@ -36,7 +36,7 @@ PyObject *rpmtd_AsPyobj(rpmtd td)
{
PyObject *res = NULL;
int array = (rpmTagGetReturnType(td->tag) == RPM_ARRAY_RETURN_TYPE);
- rpmTagClass class = rpmtdClass(td);
+ rpmTagClass tclass = rpmtdClass(td);
if (!array && rpmtdCount(td) < 1) {
Py_RETURN_NONE;
@@ -45,12 +45,12 @@ PyObject *rpmtd_AsPyobj(rpmtd td)
if (array) {
res = PyList_New(0);
while (rpmtdNext(td) >= 0) {
- PyObject *item = rpmtd_ItemAsPyobj(td, class);
+ PyObject *item = rpmtd_ItemAsPyobj(td, tclass);
PyList_Append(res, item);
Py_DECREF(item);
}
} else {
- res = rpmtd_ItemAsPyobj(td, class);
+ res = rpmtd_ItemAsPyobj(td, tclass);
}
return res;
}