aboutsummaryrefslogtreecommitdiffstats
path: root/meta-gnome/recipes-support/libuser/libuser/0003-python-Compilation-warnings-update.patch
blob: 45d69521509e5a3779fc5bc4945883b4839cd571 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
From acd7b051993d501f4b5e3a593e0f18d1336ba2de Mon Sep 17 00:00:00 2001
From: Tomas Halman <thalman@redhat.com>
Date: Wed, 21 Jul 2021 15:36:59 +0200
Subject: [PATCH] python: Compilation warnings update

The compilation produces few warnings about discard const qualifier
and pointer to int conversion. This patch fixes the const qualifiers
and replaces the tp_print inicialization in PyTypeObject with 0 instead
of NULL

Upstream-Status: Backport [https://pagure.io/libuser/c/3cb7ea54e7b50da6ea313a0e7c7187c8aa5e6ee9?branch=master]
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
 python/admin.c | 2 +-
 python/ent.c   | 8 ++++----
 python/misc.c  | 2 +-
 3 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/python/admin.c b/python/admin.c
index 83595af..e92fca4 100644
--- a/python/admin.c
+++ b/python/admin.c
@@ -1512,7 +1512,7 @@ PyTypeObject AdminType = {
 	sizeof(struct libuser_admin), /* tp_basicsize */
 	0,			/* tp_itemsize */
 	libuser_admin_destroy,	/* tp_dealloc */
-	NULL,			/* tp_print */
+	0,	            /* tp_print */
 	NULL,			/* tp_getattr */
 	NULL,			/* tp_setattr */
 	NULL,			/* tp_compare */
diff --git a/python/ent.c b/python/ent.c
index ee712d2..fc3d654 100644
--- a/python/ent.c
+++ b/python/ent.c
@@ -255,7 +255,7 @@ libuser_convert_to_value(PyObject *item, GValue *value)
 static int
 libuser_entity_setattro(PyObject *self, PyObject *attr_name, PyObject *value)
 {
-	char *name;
+	const char *name;
 	struct libuser_entity *me;
 	PyObject *list;
 	struct lu_ent *copy;
@@ -616,7 +616,7 @@ static PyObject *
 libuser_entity_get_item(PyObject *self, PyObject *item)
 {
 	struct libuser_entity *me;
-	char *attr;
+	const char *attr;
 
 	DEBUG_ENTRY;
 	me = (struct libuser_entity *)self;
@@ -664,7 +664,7 @@ static int
 libuser_entity_set_item(PyObject *self, PyObject *item, PyObject *args)
 {
 	struct libuser_entity *me;
-	char *attr = NULL;
+	const char *attr = NULL;
 	Py_ssize_t i, size;
 	int ret;
 	GValue value;
@@ -800,7 +800,7 @@ PyTypeObject EntityType = {
 	sizeof(struct libuser_entity), /* tp_basicsize */
 	0,			/* tp_itemsize */
 	libuser_entity_destroy, /* tp_dealloc */
-	NULL,			/* tp_print */
+	0,              /* tp_print */
 	NULL,			/* tp_getattr */
 	NULL,			/* tp_setattr */
 	NULL,			/* tp_compare */
diff --git a/python/misc.c b/python/misc.c
index c4ce819..810a846 100644
--- a/python/misc.c
+++ b/python/misc.c
@@ -488,7 +488,7 @@ PyTypeObject PromptType = {
 	sizeof(struct libuser_prompt), /* tp_basicsize */
 	0,			/* tp_itemsize */
 	libuser_prompt_destroy,	/* tp_dealloc */
-	NULL,			/* tp_print */
+	0,              /* tp_print */
 	NULL,			/* tp_getattr */
 	NULL,			/* tp_setattr */
 	NULL,			/* tp_compare */