Skip to content

Commit 119f67d

Browse files
authored
gh-103167: Fix -Wstrict-prototypes warnings by using (void) for functions with no args (GH-103168)
1 parent 1a8f862 commit 119f67d

File tree

7 files changed

+16
-16
lines changed

7 files changed

+16
-16
lines changed

Modules/_tkinter.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ Copyright (C) 1994 Steen Lumholt.
121121
#define WAIT_FOR_STDIN
122122

123123
static PyObject *
124-
_get_tcl_lib_path()
124+
_get_tcl_lib_path(void)
125125
{
126126
static PyObject *tcl_library_path = NULL;
127127
static int already_checked = 0;

Modules/posixmodule.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8546,7 +8546,7 @@ os_setpgrp_impl(PyObject *module)
85468546
#include <processsnapshot.h>
85478547

85488548
static PyObject*
8549-
win32_getppid()
8549+
win32_getppid(void)
85508550
{
85518551
DWORD error;
85528552
PyObject* result = NULL;
@@ -13330,7 +13330,7 @@ static int has_ShellExecute = -1;
1333013330
static HINSTANCE (CALLBACK *Py_ShellExecuteW)(HWND, LPCWSTR, LPCWSTR, LPCWSTR,
1333113331
LPCWSTR, INT);
1333213332
static int
13333-
check_ShellExecute()
13333+
check_ShellExecute(void)
1333413334
{
1333513335
HINSTANCE hShell32;
1333613336

PC/launcher.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -449,7 +449,7 @@ locate_pythons_for_key(HKEY root, REGSAM flags)
449449
}
450450

451451
static void
452-
locate_store_pythons()
452+
locate_store_pythons(void)
453453
{
454454
#if defined(_M_X64)
455455
/* 64bit process, so look in native registry */
@@ -466,7 +466,7 @@ locate_store_pythons()
466466
}
467467

468468
static void
469-
locate_venv_python()
469+
locate_venv_python(void)
470470
{
471471
static wchar_t venv_python[MAX_PATH];
472472
INSTALLED_PYTHON * ip;
@@ -495,7 +495,7 @@ locate_venv_python()
495495
}
496496

497497
static void
498-
locate_all_pythons()
498+
locate_all_pythons(void)
499499
{
500500
/* venv Python is highest priority */
501501
locate_venv_python();
@@ -694,7 +694,7 @@ static wchar_t wrapped_script_path[MAX_PATH];
694694
* valid wrapped script file.
695695
*/
696696
static void
697-
locate_wrapped_script()
697+
locate_wrapped_script(void)
698698
{
699699
wchar_t * p;
700700
size_t plen;
@@ -1034,7 +1034,7 @@ read_config_file(wchar_t * config_path)
10341034
}
10351035
}
10361036

1037-
static void read_commands()
1037+
static void read_commands(void)
10381038
{
10391039
if (launcher_ini_path[0])
10401040
read_config_file(launcher_ini_path);
@@ -1684,7 +1684,7 @@ wcsdup_pad(const wchar_t *s, int padding, int *newlen)
16841684
}
16851685

16861686
static wchar_t *
1687-
get_process_name()
1687+
get_process_name(void)
16881688
{
16891689
DWORD bufferLen = MAX_PATH;
16901690
DWORD len = bufferLen;

PC/launcher2.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ typedef BOOL (*PIsWow64Process2)(HANDLE, USHORT*, USHORT*);
132132

133133

134134
USHORT
135-
_getNativeMachine()
135+
_getNativeMachine(void)
136136
{
137137
static USHORT _nativeMachine = IMAGE_FILE_MACHINE_UNKNOWN;
138138
if (_nativeMachine == IMAGE_FILE_MACHINE_UNKNOWN) {
@@ -163,14 +163,14 @@ _getNativeMachine()
163163

164164

165165
bool
166-
isAMD64Host()
166+
isAMD64Host(void)
167167
{
168168
return _getNativeMachine() == IMAGE_FILE_MACHINE_AMD64;
169169
}
170170

171171

172172
bool
173-
isARM64Host()
173+
isARM64Host(void)
174174
{
175175
return _getNativeMachine() == IMAGE_FILE_MACHINE_ARM64;
176176
}

Python/ceval_gil.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -467,7 +467,7 @@ void _PyEval_SetSwitchInterval(unsigned long microseconds)
467467
gil->interval = microseconds;
468468
}
469469

470-
unsigned long _PyEval_GetSwitchInterval()
470+
unsigned long _PyEval_GetSwitchInterval(void)
471471
{
472472
struct _gil_runtime_state *gil = &_PyRuntime.ceval.gil;
473473
return gil->interval;

Python/initconfig.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2355,13 +2355,13 @@ config_usage(int error, const wchar_t* program)
23552355
}
23562356

23572357
static void
2358-
config_envvars_usage()
2358+
config_envvars_usage(void)
23592359
{
23602360
printf(usage_envvars, (wint_t)DELIM, (wint_t)DELIM, PYTHONHOMEHELP);
23612361
}
23622362

23632363
static void
2364-
config_xoptions_usage()
2364+
config_xoptions_usage(void)
23652365
{
23662366
puts(usage_xoptions);
23672367
}

Python/sysmodule.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1488,7 +1488,7 @@ static PyStructSequence_Desc windows_version_desc = {
14881488
};
14891489

14901490
static PyObject *
1491-
_sys_getwindowsversion_from_kernel32()
1491+
_sys_getwindowsversion_from_kernel32(void)
14921492
{
14931493
#ifndef MS_WINDOWS_DESKTOP
14941494
return NULL;

0 commit comments

Comments
 (0)