build: Remove ndr_PyLong_FromUnsignedLongLong wrapper from NT_STATUS and W_ERROR...
authorAndrew Bartlett <abartlet@samba.org>
Mon, 6 May 2019 03:58:49 +0000 (15:58 +1200)
committerGary Lockyer <gary@samba.org>
Mon, 6 May 2019 05:46:11 +0000 (05:46 +0000)
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
source4/scripting/bin/gen_ntstatus.py
source4/scripting/bin/gen_werror.py

index 7691e7bc5d1daf238919a07ae1bc555cebe25d21..8b4e96503132a09bd3e877f7fe2489ab7be983e6 100755 (executable)
@@ -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");
index 6280d2d388379538fde047ff2e6df07418c004a4..2e10e5b02596cf9d92d8bd135ab79a1d22860252 100755 (executable)
@@ -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");