Skip to content

Commit 19808e9

Browse files
committed
python: Fix discarded const qualifier in json_to_python.
There is a warning while building JSON extension code: ovs/_json.c: In function 'json_to_python': ovs/_json.c:121:49: warning: passing argument 1 of 'json_to_python' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers] 121 | PyObject *item = json_to_python(json_array_at(json, i)); | ^~~~~~~~~~~~~~~~~~~~~~ ovs/_json.c:81:29: note: expected 'struct json *' but argument is of type 'const struct json *' 81 | json_to_python(struct json *json) | ~~~~~~~~~~~~~^~~~ The warning can be seen in the CI job for the debian package build. Fixes: 1de4a08 ("json: Use functions to access json arrays.") Acked-by: Eelco Chaudron <echaudro@redhat.com> Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
1 parent d65a5a7 commit 19808e9

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

python/ovs/_json.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ Parser_is_done(json_ParserObject * self)
7878
}
7979

8080
static PyObject *
81-
json_to_python(struct json *json)
81+
json_to_python(const struct json *json)
8282
{
8383
switch (json->type) {
8484
case JSON_NULL:

0 commit comments

Comments
 (0)