summaryrefslogtreecommitdiff
path: root/source4/scripting
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2019-05-06 15:58:49 +1200
committerGary Lockyer <gary@samba.org>2019-05-06 05:46:11 +0000
commit154370a2e6288d9cf15dd36ecf66fcd8335cfb0b (patch)
tree30c60fe2d80f2185d93d097d22095e2b9989c45b /source4/scripting
parent4229c278533ed637f048be876c1ab58b07b2a842 (diff)
downloadsamba-154370a2e6288d9cf15dd36ecf66fcd8335cfb0b.tar.gz
build: Remove ndr_PyLong_FromUnsignedLongLong wrapper from NT_STATUS and W_ERROR table generator
Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
Diffstat (limited to 'source4/scripting')
-rwxr-xr-xsource4/scripting/bin/gen_ntstatus.py10
-rwxr-xr-xsource4/scripting/bin/gen_werror.py10
2 files changed, 2 insertions, 18 deletions
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 <Python.h>\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 <Python.h>\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");