1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2025-07-02 20:42:30 +03:00

Remove bogus casts.

* Casting a string literal to `char *` and then immediately passing or
  assigning the result to a `const char *` makes no sense.
* There is no need to cast `int` to `Py_ssize_t` as they have the same
  sign and the latter is at least as wide as the former.
This commit is contained in:
Dag-Erling Smørgrav
2025-05-24 01:00:25 +02:00
parent 7c9b55356d
commit 8ea253b895
2 changed files with 178 additions and 201 deletions

View File

@ -889,7 +889,7 @@ def print_function_wrapper(name, output, export, include):
include.write("PyObject * ")
include.write("libxml_%s(PyObject *self, PyObject *args);\n" % (name))
export.write(" { (char *)\"%s\", libxml_%s, METH_VARARGS, NULL },\n" %
export.write(" { \"%s\", libxml_%s, METH_VARARGS, NULL },\n" %
(name, name))
if file == "python":
@ -926,7 +926,7 @@ def print_function_wrapper(name, output, export, include):
name)
output.write(" return(NULL);\n")
if format != "":
output.write("\n if (!PyArg_ParseTuple(args, (char *)\"%s\"%s))\n" %
output.write("\n if (!PyArg_ParseTuple(args, \"%s\"%s))\n" %
(format, format_args))
output.write(" return(NULL);\n")
if c_convert != "":