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
This commit is contained in:
Victor Stinner 2017-12-05 15:12:41 +01:00 committed by GitHub
parent ae342cf7de
commit 33c377ed9b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 12 additions and 51 deletions

View file

@ -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 {