From: Andrew Bartlett Date: Mon, 6 May 2019 03:58:49 +0000 (+1200) Subject: build: Remove ndr_PyLong_FromUnsignedLongLong wrapper from NT_STATUS and W_ERROR... X-Git-Tag: tdb-1.4.1~201 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=154370a2e6288d9cf15dd36ecf66fcd8335cfb0b;p=thirdparty%2Fsamba.git build: Remove ndr_PyLong_FromUnsignedLongLong wrapper from NT_STATUS and W_ERROR table generator Signed-off-by: Andrew Bartlett Reviewed-by: Gary Lockyer --- diff --git a/source4/scripting/bin/gen_ntstatus.py b/source4/scripting/bin/gen_ntstatus.py index 7691e7bc5d1..8b4e9650313 100755 --- a/source4/scripting/bin/gen_ntstatus.py +++ b/source4/scripting/bin/gen_ntstatus.py @@ -75,14 +75,6 @@ def generatePythonFile(out_file, errors): out_file.write("#include \n") out_file.write("#include \"python/py3compat.h\"\n") out_file.write("#include \"includes.h\"\n\n") - out_file.write("static inline PyObject *ndr_PyLong_FromUnsignedLongLong(unsigned long long v)\n"); - out_file.write("{\n"); - out_file.write("\tif (v > LONG_MAX) {\n"); - out_file.write("\t\treturn PyLong_FromUnsignedLongLong(v);\n"); - out_file.write("\t} else {\n"); - out_file.write("\t\treturn PyInt_FromLong(v);\n"); - out_file.write("\t}\n"); - out_file.write("}\n\n"); # This is needed to avoid a missing prototype error from the C # compiler. There is never a prototype for this function, it is a # module loaded by python with dlopen() and found with dlsym(). @@ -100,7 +92,7 @@ def generatePythonFile(out_file, errors): out_file.write("\t\treturn NULL;\n\n"); for err in errors: line = """\tPyModule_AddObject(m, \"%s\", - \t\tndr_PyLong_FromUnsignedLongLong(NT_STATUS_V(%s)));\n""" % (err.err_define, err.err_define) + \t\tPyLong_FromUnsignedLongLong(NT_STATUS_V(%s)));\n""" % (err.err_define, err.err_define) out_file.write(line) out_file.write("\n"); out_file.write("\treturn m;\n"); diff --git a/source4/scripting/bin/gen_werror.py b/source4/scripting/bin/gen_werror.py index 6280d2d3883..2e10e5b0259 100755 --- a/source4/scripting/bin/gen_werror.py +++ b/source4/scripting/bin/gen_werror.py @@ -77,14 +77,6 @@ def generatePythonFile(out_file, errors): out_file.write("#include \n") out_file.write("#include \"python/py3compat.h\"\n") out_file.write("#include \"includes.h\"\n\n") - out_file.write("static inline PyObject *ndr_PyLong_FromUnsignedLongLong(unsigned long long v)\n"); - out_file.write("{\n"); - out_file.write("\tif (v > LONG_MAX) {\n"); - out_file.write("\t\treturn PyLong_FromUnsignedLongLong(v);\n"); - out_file.write("\t} else {\n"); - out_file.write("\t\treturn PyInt_FromLong(v);\n"); - out_file.write("\t}\n"); - out_file.write("}\n\n"); # This is needed to avoid a missing prototype error from the C # compiler. There is never a prototype for this function, it is a # module loaded by python with dlopen() and found with dlsym(). @@ -102,7 +94,7 @@ def generatePythonFile(out_file, errors): out_file.write("\t\treturn NULL;\n\n"); for err in errors: line = """\tPyModule_AddObject(m, \"%s\", - \t\tndr_PyLong_FromUnsignedLongLong(W_ERROR_V(%s)));\n""" % (err.err_define, err.err_define) + \t\tPyLong_FromUnsignedLongLong(W_ERROR_V(%s)));\n""" % (err.err_define, err.err_define) out_file.write(line) out_file.write("\n"); out_file.write("\treturn m;\n");