diff options
Diffstat (limited to 'recipes-extended/xen/files/xen-tools-python-fix-Wsign-compare-warnings.patch')
-rw-r--r-- | recipes-extended/xen/files/xen-tools-python-fix-Wsign-compare-warnings.patch | 136 |
1 files changed, 136 insertions, 0 deletions
diff --git a/recipes-extended/xen/files/xen-tools-python-fix-Wsign-compare-warnings.patch b/recipes-extended/xen/files/xen-tools-python-fix-Wsign-compare-warnings.patch new file mode 100644 index 00000000..b32c5d06 --- /dev/null +++ b/recipes-extended/xen/files/xen-tools-python-fix-Wsign-compare-warnings.patch | |||
@@ -0,0 +1,136 @@ | |||
1 | From 88d703a361d34d75f81fc6d30b31d0abc8aa17eb Mon Sep 17 00:00:00 2001 | ||
2 | From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= | ||
3 | <marmarek@invisiblethingslab.com> | ||
4 | Date: Fri, 9 Aug 2019 03:01:36 +0100 | ||
5 | Subject: [PATCH] python: fix -Wsign-compare warnings | ||
6 | MIME-Version: 1.0 | ||
7 | Content-Type: text/plain; charset=UTF-8 | ||
8 | Content-Transfer-Encoding: 8bit | ||
9 | |||
10 | Specifically: | ||
11 | xen/lowlevel/xc/xc.c: In function ‘pyxc_domain_create’: | ||
12 | xen/lowlevel/xc/xc.c:147:24: error: comparison of integer expressions of different signedness: ‘int’ and ‘long unsigned int’ [-Werror=sign-compare] | ||
13 | 147 | for ( i = 0; i < sizeof(xen_domain_handle_t); i++ ) | ||
14 | | ^ | ||
15 | xen/lowlevel/xc/xc.c: In function ‘pyxc_domain_sethandle’: | ||
16 | xen/lowlevel/xc/xc.c:312:20: error: comparison of integer expressions of different signedness: ‘int’ and ‘long unsigned int’ [-Werror=sign-compare] | ||
17 | 312 | for ( i = 0; i < sizeof(xen_domain_handle_t); i++ ) | ||
18 | | ^ | ||
19 | xen/lowlevel/xc/xc.c: In function ‘pyxc_domain_getinfo’: | ||
20 | xen/lowlevel/xc/xc.c:391:24: error: comparison of integer expressions of different signedness: ‘int’ and ‘long unsigned int’ [-Werror=sign-compare] | ||
21 | 391 | for ( j = 0; j < sizeof(xen_domain_handle_t); j++ ) | ||
22 | | ^ | ||
23 | xen/lowlevel/xc/xc.c: In function ‘pyxc_get_device_group’: | ||
24 | xen/lowlevel/xc/xc.c:677:20: error: comparison of integer expressions of different signedness: ‘int’ and ‘uint32_t’ {aka ‘unsigned int’} [-Werror=sign-compare] | ||
25 | 677 | for ( i = 0; i < num_sdevs; i++ ) | ||
26 | | ^ | ||
27 | xen/lowlevel/xc/xc.c: In function ‘pyxc_physinfo’: | ||
28 | xen/lowlevel/xc/xc.c:988:20: error: comparison of integer expressions of different signedness: ‘int’ and ‘long unsigned int’ [-Werror=sign-compare] | ||
29 | 988 | for ( i = 0; i < sizeof(pinfo.hw_cap)/4; i++ ) | ||
30 | | ^ | ||
31 | xen/lowlevel/xc/xc.c:994:20: error: comparison of integer expressions of different signedness: ‘int’ and ‘long unsigned int’ [-Werror=sign-compare] | ||
32 | 994 | for ( i = 0; i < ARRAY_SIZE(virtcaps_bits); i++ ) | ||
33 | | ^ | ||
34 | xen/lowlevel/xc/xc.c:998:24: error: comparison of integer expressions of different signedness: ‘int’ and ‘long unsigned int’ [-Werror=sign-compare] | ||
35 | 998 | for ( i = 0; i < ARRAY_SIZE(virtcaps_bits); i++ ) | ||
36 | | ^ | ||
37 | xen/lowlevel/xs/xs.c: In function ‘xspy_ls’: | ||
38 | xen/lowlevel/xs/xs.c:191:23: error: comparison of integer expressions of different signedness: ‘int’ and ‘unsigned int’ [-Werror=sign-compare] | ||
39 | 191 | for (i = 0; i < xsval_n; i++) | ||
40 | | ^ | ||
41 | xen/lowlevel/xs/xs.c: In function ‘xspy_get_permissions’: | ||
42 | xen/lowlevel/xs/xs.c:297:23: error: comparison of integer expressions of different signedness: ‘int’ and ‘unsigned int’ [-Werror=sign-compare] | ||
43 | 297 | for (i = 0; i < perms_n; i++) { | ||
44 | | ^ | ||
45 | cc1: all warnings being treated as errors | ||
46 | |||
47 | Use size_t for loop iterators where it's compared with sizeof() or | ||
48 | similar construct. | ||
49 | |||
50 | Signed-off-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com> | ||
51 | Acked-by: Ian Jackson <ian.jackson@eu.citrix.com> | ||
52 | |||
53 | Modified to apply to Xen 4.12.2 by Christopher Clark | ||
54 | Signed-off-by: Christopher Clark <christopher.clark6@baesystems.com> | ||
55 | --- | ||
56 | tools/python/xen/lowlevel/xc/xc.c | 13 ++++++++----- | ||
57 | tools/python/xen/lowlevel/xs/xs.c | 4 ++-- | ||
58 | 2 files changed, 10 insertions(+), 7 deletions(-) | ||
59 | |||
60 | diff --git a/tools/python/xen/lowlevel/xc/xc.c b/tools/python/xen/lowlevel/xc/xc.c | ||
61 | index 522cbe3b9c..188bfa34da 100644 | ||
62 | --- a/tools/python/xen/lowlevel/xc/xc.c | ||
63 | +++ b/tools/python/xen/lowlevel/xc/xc.c | ||
64 | @@ -117,7 +117,8 @@ static PyObject *pyxc_domain_create(XcObject *self, | ||
65 | PyObject *kwds) | ||
66 | { | ||
67 | uint32_t dom = 0, target = 0; | ||
68 | - int ret, i; | ||
69 | + int ret; | ||
70 | + size_t i; | ||
71 | PyObject *pyhandle = NULL; | ||
72 | struct xen_domctl_createdomain config = { | ||
73 | .handle = { | ||
74 | @@ -295,7 +296,7 @@ static PyObject *pyxc_vcpu_setaffinity(XcObject *self, | ||
75 | |||
76 | static PyObject *pyxc_domain_sethandle(XcObject *self, PyObject *args) | ||
77 | { | ||
78 | - int i; | ||
79 | + size_t i; | ||
80 | uint32_t dom; | ||
81 | PyObject *pyhandle; | ||
82 | xen_domain_handle_t handle; | ||
83 | @@ -336,7 +337,8 @@ static PyObject *pyxc_domain_getinfo(XcObject *self, | ||
84 | PyObject *list, *info_dict, *pyhandle; | ||
85 | |||
86 | uint32_t first_dom = 0; | ||
87 | - int max_doms = 1024, nr_doms, i, j; | ||
88 | + int max_doms = 1024, nr_doms, i; | ||
89 | + size_t j; | ||
90 | xc_dominfo_t *info; | ||
91 | |||
92 | static char *kwd_list[] = { "first_dom", "max_doms", NULL }; | ||
93 | @@ -631,7 +633,8 @@ static PyObject *pyxc_get_device_group(XcObject *self, | ||
94 | { | ||
95 | uint32_t sbdf; | ||
96 | uint32_t max_sdevs, num_sdevs; | ||
97 | - int domid, seg, bus, dev, func, rc, i; | ||
98 | + int domid, seg, bus, dev, func, rc; | ||
99 | + size_t i; | ||
100 | PyObject *Pystr; | ||
101 | char *group_str; | ||
102 | char dev_str[9]; | ||
103 | @@ -971,7 +974,7 @@ static PyObject *pyxc_physinfo(XcObject *self) | ||
104 | { | ||
105 | xc_physinfo_t pinfo; | ||
106 | char cpu_cap[128], virt_caps[128], *p; | ||
107 | - int i; | ||
108 | + size_t i; | ||
109 | const char *virtcap_names[] = { "hvm", "hvm_directio" }; | ||
110 | |||
111 | if ( xc_physinfo(self->xc_handle, &pinfo) != 0 ) | ||
112 | diff --git a/tools/python/xen/lowlevel/xs/xs.c b/tools/python/xen/lowlevel/xs/xs.c | ||
113 | index 9a0acfc25c..ea50f86bc3 100644 | ||
114 | --- a/tools/python/xen/lowlevel/xs/xs.c | ||
115 | +++ b/tools/python/xen/lowlevel/xs/xs.c | ||
116 | @@ -186,7 +186,7 @@ static PyObject *xspy_ls(XsHandle *self, PyObject *args) | ||
117 | Py_END_ALLOW_THREADS | ||
118 | |||
119 | if (xsval) { | ||
120 | - int i; | ||
121 | + size_t i; | ||
122 | PyObject *val = PyList_New(xsval_n); | ||
123 | for (i = 0; i < xsval_n; i++) | ||
124 | #if PY_MAJOR_VERSION >= 3 | ||
125 | @@ -276,7 +276,7 @@ static PyObject *xspy_get_permissions(XsHandle *self, PyObject *args) | ||
126 | struct xs_handle *xh = xshandle(self); | ||
127 | struct xs_permissions *perms; | ||
128 | unsigned int perms_n = 0; | ||
129 | - int i; | ||
130 | + size_t i; | ||
131 | |||
132 | xs_transaction_t th; | ||
133 | char *thstr; | ||
134 | -- | ||
135 | 2.17.1 | ||
136 | |||