]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-40268: Remove unused osdefs.h includes (GH-19532)
authorVictor Stinner <vstinner@python.org>
Wed, 15 Apr 2020 01:24:57 +0000 (03:24 +0200)
committerGitHub <noreply@github.com>
Wed, 15 Apr 2020 01:24:57 +0000 (03:24 +0200)
When the include is needed, add required symbol in a comment.

13 files changed:
Modules/_tracemalloc.c
Modules/getpath.c
Modules/posixmodule.c
Modules/syslogmodule.c
Objects/exceptions.c
PC/getpathp.c
Python/fileutils.c
Python/import.c
Python/pathconfig.c
Python/pylifecycle.c
Python/pythonrun.c
Python/sysmodule.c
Python/traceback.c

index 691de07b9b3c6aa521524a8a0411142229b7e012..dbae107c2da2042ab2788702b92dd607b2edb243 100644 (file)
@@ -4,7 +4,6 @@
 #include "pycore_traceback.h"
 #include "hashtable.h"
 #include "frameobject.h"
-#include "osdefs.h"
 
 #include "clinic/_tracemalloc.c.h"
 /*[clinic input]
index 1dd8dd0134e7c627263a90a13d8a87982e9ef5fa..94e06b3e3e86bb82d499ae9724d3a61fe3acceac 100644 (file)
@@ -4,7 +4,7 @@
 #include "pycore_fileutils.h"
 #include "pycore_initconfig.h"
 #include "pycore_pathconfig.h"
-#include "osdefs.h"
+#include "osdefs.h"               // DELIM
 
 #include <sys/types.h>
 #include <string.h>
index f5beb092401301f64fea266854ba428fa7e2214f..89f9757c515bb80436d81f4f8da7768421b49f9f 100644 (file)
@@ -312,11 +312,11 @@ extern char        *ctermid_r(char *);
 #ifndef IO_REPARSE_TAG_MOUNT_POINT
 #define IO_REPARSE_TAG_MOUNT_POINT (0xA0000003L)
 #endif
-#include "osdefs.h"
+#include "osdefs.h"               // SEP
 #include <malloc.h>
 #include <windows.h>
-#include <shellapi.h>   /* for ShellExecute() */
-#include <lmcons.h>     /* for UNLEN */
+#include <shellapi.h>             // ShellExecute()
+#include <lmcons.h>               // UNLEN
 #define HAVE_SYMLINK
 #endif /* _MSC_VER */
 
index 24517925c32eb08e8a2cde7f3e63fc0fb20651ac..11718e277432f05dd4eb7dec5a70e1c4c717d273 100644 (file)
@@ -50,7 +50,7 @@ Revision history:
 /* syslog module */
 
 #include "Python.h"
-#include "osdefs.h"
+#include "osdefs.h"               // SEP
 
 #include <syslog.h>
 
index 69a6b5c284dfaed4749118daa4eda16f7c22ee7f..ca917b436c4bb71561a57a5e561d65f51b67dad8 100644 (file)
@@ -9,7 +9,7 @@
 #include "pycore_initconfig.h"
 #include "pycore_object.h"
 #include "structmember.h"         // PyMemberDef
-#include "osdefs.h"
+#include "osdefs.h"               // SEP
 
 
 /* Compatibility aliases */
@@ -1435,11 +1435,13 @@ my_basename(PyObject *name)
     size = PyUnicode_GET_LENGTH(name);
     offset = 0;
     for(i=0; i < size; i++) {
-        if (PyUnicode_READ(kind, data, i) == SEP)
+        if (PyUnicode_READ(kind, data, i) == SEP) {
             offset = i + 1;
+        }
     }
-    if (offset != 0)
+    if (offset != 0) {
         return PyUnicode_Substring(name, offset, size);
+    }
     else {
         Py_INCREF(name);
         return name;
index 24a9323e6e67e9595e4b8879aa95899289dd66e6..d23d2bbde809f73db8842ef09bcdf2ff13731de8 100644 (file)
@@ -80,9 +80,9 @@
 
 
 #include "Python.h"
-#include "pycore_initconfig.h"   /* PyStatus */
-#include "pycore_pathconfig.h"   /* _PyPathConfig */
-#include "osdefs.h"
+#include "pycore_initconfig.h"    // PyStatus
+#include "pycore_pathconfig.h"    // _PyPathConfig
+#include "osdefs.h"               // SEP, ALTSEP
 #include <wchar.h>
 
 #ifndef MS_WINDOWS
index 19ead9d676c7fce3fd60e0ac55fed68f9b7c50a1..439bc351596f7aa5dffaf6744cfab54ed3e4d79d 100644 (file)
@@ -1,6 +1,6 @@
 #include "Python.h"
 #include "pycore_fileutils.h"
-#include "osdefs.h"
+#include "osdefs.h"               // SEP
 #include <locale.h>
 
 #ifdef MS_WINDOWS
index a2aa4afa18a72899c4244ede2d4fba08ff102f92..a8743458dd5c966903ff8fd16646bf8da117742b 100644 (file)
@@ -16,7 +16,6 @@
 #include "marshal.h"
 #include "code.h"
 #include "frameobject.h"
-#include "osdefs.h"
 #include "importdl.h"
 #include "pydtrace.h"
 
index 6ebfdac3fd2d38a7a171e071d209b8eed44a8ff1..fe3ac3ee3d8121cd5c336696c47397b528f15077 100644 (file)
@@ -1,7 +1,7 @@
 /* Path configuration like module_search_path (sys.path) */
 
 #include "Python.h"
-#include "osdefs.h"
+#include "osdefs.h"               // DELIM
 #include "pycore_initconfig.h"
 #include "pycore_fileutils.h"
 #include "pycore_pathconfig.h"
index 9c13274dac04dd85bccc47cd41b0dbf7ca4eb475..688ee0c133b1ea9b19cd56bbee121e210f65b5bf 100644 (file)
@@ -26,7 +26,6 @@
 #include "symtable.h"
 #include "ast.h"
 #include "marshal.h"
-#include "osdefs.h"
 #include <locale.h>
 
 #ifdef HAVE_SIGNAL_H
index 246669994c4dd0eeb0f231af240250c9371dcb41..d6bc88320358c402d0f45e1ba1a49066137565a5 100644 (file)
@@ -27,7 +27,6 @@
 #include "symtable.h"
 #include "ast.h"
 #include "marshal.h"
-#include "osdefs.h"
 #include <locale.h>
 
 #ifdef HAVE_SIGNAL_H
index 4e67325318aaf577bcc7ba0cef2b65d0c6bcfaee..92ea5e7d637b9441406324f06a7621d86e49c103 100644 (file)
@@ -26,9 +26,9 @@ Data members:
 #include "pycore_pymem.h"         // _PyMem_SetDefaultAllocator()
 #include "pycore_pystate.h"       // _PyThreadState_GET()
 #include "pycore_tupleobject.h"
-#include "pydtrace.h"
 
-#include "osdefs.h"
+#include "pydtrace.h"
+#include "osdefs.h"               // DELIM
 #include <locale.h>
 
 #ifdef MS_WINDOWS
index e3397ecfe48f50e4546953ae3f6c7c28ef5ab4a2..85e9124bb6a683fc2f1423a89eecacb9cf857361 100644 (file)
@@ -6,7 +6,7 @@
 #include "code.h"
 #include "frameobject.h"
 #include "structmember.h"         // PyMemberDef
-#include "osdefs.h"
+#include "osdefs.h"               // SEP
 #ifdef HAVE_FCNTL_H
 #include <fcntl.h>
 #endif