diff options
author | Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> | 2018-03-29 23:24:03 -0700 |
---|---|---|
committer | Nick Coghlan <ncoghlan@gmail.com> | 2018-03-30 16:24:03 +1000 |
commit | 2961717986201d639b60de51e5f2e9aa2573856c (patch) | |
tree | fd16eaea9e2b8d311f2b4dd3bd5c1f3180bdbf3d /Programs | |
parent | faa6f5c74ca56d4cc0dd9db78d5c8e864b617d0c (diff) | |
download | cpython-git-2961717986201d639b60de51e5f2e9aa2573856c.tar.gz |
bpo-33182: Fix pointer types in _testembed (GH-6310) (GH-6311)
(cherry picked from commit 69f5c73311a61b05485b19626935bf240ad31c5b)
Co-authored-by: Nick Coghlan <ncoghlan@gmail.com>
Diffstat (limited to 'Programs')
-rw-r--r-- | Programs/_testembed.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/Programs/_testembed.c b/Programs/_testembed.c index 09b7bf6d94..7406470ae6 100644 --- a/Programs/_testembed.c +++ b/Programs/_testembed.c @@ -166,16 +166,18 @@ static int test_pre_initialization_api(void) /* bpo-33042: Ensure embedding apps can predefine sys module options */ static int test_pre_initialization_sys_options(void) { - /* We allocate a couple of the option dynamically, and then delete + /* We allocate a couple of the options dynamically, and then delete * them before calling Py_Initialize. This ensures the interpreter isn't * relying on the caller to keep the passed in strings alive. */ - wchar_t *static_warnoption = L"once"; - wchar_t *static_xoption = L"also_not_an_option=2"; + const wchar_t *static_warnoption = L"once"; + const wchar_t *static_xoption = L"also_not_an_option=2"; size_t warnoption_len = wcslen(static_warnoption); size_t xoption_len = wcslen(static_xoption); - wchar_t *dynamic_once_warnoption = calloc(warnoption_len+1, sizeof(wchar_t)); - wchar_t *dynamic_xoption = calloc(xoption_len+1, sizeof(wchar_t)); + wchar_t *dynamic_once_warnoption = \ + (wchar_t *) calloc(warnoption_len+1, sizeof(wchar_t)); + wchar_t *dynamic_xoption = \ + (wchar_t *) calloc(xoption_len+1, sizeof(wchar_t)); wcsncpy(dynamic_once_warnoption, static_warnoption, warnoption_len+1); wcsncpy(dynamic_xoption, static_xoption, xoption_len+1); |