summaryrefslogtreecommitdiffstats
path: root/Include/pystate.h
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2017-12-05 14:12:41 (GMT)
committerGitHub <noreply@github.com>2017-12-05 14:12:41 (GMT)
commit33c377ed9b6cb3b9493005314c4e0cfa7517ea65 (patch)
tree57c547459a63179830eba576c4ea2959a605c117 /Include/pystate.h
parentae342cf7deebdcf2035f4064609b32b2102dadcf (diff)
downloadcpython-33c377ed9b6cb3b9493005314c4e0cfa7517ea65.zip
cpython-33c377ed9b6cb3b9493005314c4e0cfa7517ea65.tar.gz
cpython-33c377ed9b6cb3b9493005314c4e0cfa7517ea65.tar.bz2
bpo-32030: Simplify _PyCoreConfig_INIT macro (#4728)
* Simplify _PyCoreConfig_INIT, _PyMainInterpreterConfig_INIT, _PyPathConfig_INIT macros: no need to set fields to 0/NULL, it's redundant (the C language sets them to 0/NULL for us). * Fix typo: pymain_run_statup() => pymain_run_startup() * Remove a few XXX/TODO
Diffstat (limited to 'Include/pystate.h')
-rw-r--r--Include/pystate.h22
1 files changed, 4 insertions, 18 deletions
diff --git a/Include/pystate.h b/Include/pystate.h
index 1d8aab6..cf45b05 100644
--- a/Include/pystate.h
+++ b/Include/pystate.h
@@ -38,19 +38,8 @@ typedef struct {
int show_alloc_count; /* -X showalloccount */
} _PyCoreConfig;
-#define _PyCoreConfig_INIT \
- (_PyCoreConfig){\
- .ignore_environment = 0, \
- .use_hash_seed = -1, \
- .hash_seed = 0, \
- ._disable_importlib = 0, \
- .allocator = NULL, \
- .dev_mode = 0, \
- .faulthandler = 0, \
- .tracemalloc = 0, \
- .import_time = 0, \
- .show_ref_count = 0, \
- .show_alloc_count = 0}
+#define _PyCoreConfig_INIT (_PyCoreConfig){.use_hash_seed = -1}
+/* Note: _PyCoreConfig_INIT sets other fields to 0/NULL */
/* Placeholders while working on the new configuration API
*
@@ -69,11 +58,8 @@ typedef struct {
} _PyMainInterpreterConfig;
#define _PyMainInterpreterConfig_INIT \
- (_PyMainInterpreterConfig){\
- .install_signal_handlers = -1, \
- .module_search_path_env = NULL, \
- .home = NULL, \
- .program_name = NULL}
+ (_PyMainInterpreterConfig){.install_signal_handlers = -1}
+/* Note: _PyMainInterpreterConfig_INIT sets other fields to 0/NULL */
typedef struct _is {