Bunch of minor ANSIfications: 'void initfunc()' -> 'void initfunc(void)',

and a couple of functions that were missed in the previous batches. Not
terribly tested, but very carefully scrutinized, three times.

All these were found by the little findkrc.py that I posted to python-dev,
which means there might be more lurking. Cases such as this:

long
func(a, b)
	long a;
	long b; /* flagword */
{

and other cases where the last ; in the argument list isn't followed by a
newline and an opening curly bracket. Regexps to catch all are welcome, of
course ;)
This commit is contained in:
Thomas Wouters 2000-07-21 06:00:07 +00:00
parent ff4df6d6fb
commit f3f33dcf03
59 changed files with 103 additions and 117 deletions

View File

@ -624,7 +624,7 @@ static PyMethodDef _codecs_functions[] = {
};
DL_EXPORT(void)
init_codecs()
init_codecs(void)
{
Py_InitModule("_codecs", _codecs_functions);
}

View File

@ -1270,9 +1270,7 @@ static PyMethodDef PyCursesWindow_Methods[] = {
};
static PyObject *
PyCursesWindow_GetAttr(self, name)
PyCursesWindowObject *self;
char *name;
PyCursesWindow_GetAttr(PyCursesWindowObject *self, char *name)
{
return Py_FindMethod(PyCursesWindow_Methods, (PyObject *)self, name);
}
@ -2161,7 +2159,7 @@ static PyMethodDef PyCurses_methods[] = {
/* Initialization function for the module */
void
init_curses()
init_curses(void)
{
PyObject *m, *d, *v;

View File

@ -400,7 +400,7 @@ static struct PyMethodDef PyLocale_Methods[] = {
};
DL_EXPORT(void)
init_locale()
init_locale(void)
{
PyObject *m, *d, *x;

View File

@ -2097,7 +2097,7 @@ void
#if defined(WIN32)
__declspec(dllexport)
#endif
init_sre()
init_sre(void)
{
/* Patch object types */
Pattern_Type.ob_type = Match_Type.ob_type =

View File

@ -1912,9 +1912,7 @@ Tkinter_Flatten(PyObject* self, PyObject* args)
}
static PyObject *
Tkinter_Create(self, args)
PyObject *self;
PyObject *args;
Tkinter_Create(PyObject *self, PyObject *args)
{
char *screenName = NULL;
char *baseName = NULL;
@ -1967,7 +1965,7 @@ MyFileProc(void *clientData, int mask)
static PyThreadState *event_tstate = NULL;
static int
EventHook()
EventHook(void)
{
#ifndef MS_WINDOWS
int tfile;
@ -2026,7 +2024,7 @@ EventHook()
#endif
static void
EnableEventHook()
EnableEventHook(void)
{
#ifdef WAIT_FOR_STDIN
if (PyOS_InputHook == NULL) {
@ -2039,7 +2037,7 @@ EnableEventHook()
}
static void
DisableEventHook()
DisableEventHook(void)
{
#ifdef WAIT_FOR_STDIN
if (Tk_GetNumMainWindows() == 0 && PyOS_InputHook == EventHook) {
@ -2071,7 +2069,7 @@ ins_string(PyObject *d, char *name, char *val)
DL_EXPORT(void)
init_tkinter()
init_tkinter(void)
{
PyObject *m, *d;
@ -2218,7 +2216,7 @@ init_tkinter_shlib(CFragInitBlockPtr data)
** the resources from the application. Again, we ignore errors.
*/
static
mac_addlibresources()
mac_addlibresources(void)
{
if ( !loaded_from_shlib )
return;

View File

@ -2037,7 +2037,7 @@ static char al_module_documentation[] =
;
void
inital()
inital(void)
{
PyObject *m, *d, *x;

View File

@ -1407,7 +1407,7 @@ statichere PyTypeObject Arraytype = {
};
DL_EXPORT(void)
initarray()
initarray(void)
{
PyObject *m, *d;

View File

@ -284,10 +284,7 @@ audioop_rms(PyObject *self, PyObject *args)
return PyInt_FromLong(val);
}
static double _sum2(a, b, len)
short *a;
short *b;
int len;
static double _sum2(short *a, short *b, int len)
{
int i;
double sum = 0.0;
@ -899,8 +896,7 @@ audioop_lin2lin(PyObject *self, PyObject *args)
}
static int
gcd(a, b)
int a, b;
gcd(int a, int b)
{
while (b > 0) {
int tmp = a % b;
@ -1344,7 +1340,7 @@ static PyMethodDef audioop_methods[] = {
};
DL_EXPORT(void)
initaudioop()
initaudioop(void)
{
PyObject *m, *d;
m = Py_InitModule("audioop", audioop_methods);

View File

@ -899,7 +899,7 @@ static struct PyMethodDef binascii_module_methods[] = {
static char doc_binascii[] = "Conversion between binary data and ASCII";
DL_EXPORT(void)
initbinascii()
initbinascii(void)
{
PyObject *m, *d, *x;

View File

@ -766,7 +766,7 @@ static PyMethodDef CD_methods[] = {
};
void
initcd()
initcd(void)
{
PyObject *m, *d;

View File

@ -978,7 +978,7 @@ static PyMethodDef cl_methods[] = {
#endif
void
initcl()
initcl(void)
{
PyObject *m, *d, *x;

View File

@ -316,7 +316,7 @@ Return the hyperbolic tangent of x.";
/* And now the glue to make them available from Python: */
static PyObject *
math_error()
math_error(void)
{
if (errno == EDOM)
PyErr_SetString(PyExc_ValueError, "math domain error");
@ -394,7 +394,7 @@ static PyMethodDef cmath_methods[] = {
};
DL_EXPORT(void)
initcmath()
initcmath(void)
{
PyObject *m, *d, *v;

View File

@ -36,7 +36,7 @@ static PyMethodDef crypt_methods[] = {
};
DL_EXPORT(void)
initcrypt()
initcrypt(void)
{
Py_InitModule("crypt", crypt_methods);
}

View File

@ -191,7 +191,7 @@ static PyMethodDef dl_methods[] = {
};
void
initdl()
initdl(void)
{
PyObject *m, *d, *x;

View File

@ -70,7 +70,7 @@ To map error codes to error messages, use the function os.strerror(),\n\
e.g. os.strerror(2) could return 'No such file or directory'.";
DL_EXPORT(void)
initerrno()
initerrno(void)
{
PyObject *m, *d, *de;
m = Py_InitModule3("errno", errno_methods, errno__doc__);

View File

@ -312,7 +312,7 @@ all_ins(PyObject* d)
}
DL_EXPORT(void)
initfcntl()
initfcntl(void)
{
PyObject *m, *d;

View File

@ -2133,7 +2133,7 @@ static PyMethodDef forms_methods[] = {
};
DL_EXPORT(void)
initfl()
initfl(void)
{
Py_InitModule("fl", forms_methods);
foreground();

View File

@ -278,7 +278,7 @@ static PyMethodDef fm_methods[] = {
void
initfm()
initfm(void)
{
Py_InitModule("fm", fm_methods);
fminit();

View File

@ -30,7 +30,7 @@
const char *
Py_GetBuildInfo()
Py_GetBuildInfo(void)
{
static char buildinfo[50];
sprintf(buildinfo, "#%d, %.20s, %.9s", BUILD, DATE, TIME);

View File

@ -347,7 +347,7 @@ search_for_exec_prefix(char *argv0_path, char *home)
static void
calculate_path()
calculate_path(void)
{
extern char *Py_GetProgramName();
@ -572,7 +572,7 @@ calculate_path()
/* External interface */
char *
Py_GetPath()
Py_GetPath(void)
{
if (!module_search_path)
calculate_path();
@ -580,7 +580,7 @@ Py_GetPath()
}
char *
Py_GetPrefix()
Py_GetPrefix(void)
{
if (!module_search_path)
calculate_path();
@ -588,7 +588,7 @@ Py_GetPrefix()
}
char *
Py_GetExecPrefix()
Py_GetExecPrefix(void)
{
if (!module_search_path)
calculate_path();
@ -596,7 +596,7 @@ Py_GetExecPrefix()
}
char *
Py_GetProgramFullPath()
Py_GetProgramFullPath(void)
{
if (!module_search_path)
calculate_path();

View File

@ -7633,7 +7633,7 @@ static struct PyMethodDef gl_methods[] = {
};
void
initgl()
initgl(void)
{
(void) Py_InitModule("gl", gl_methods);
}

View File

@ -132,7 +132,7 @@ complete membership information.)";
DL_EXPORT(void)
initgrp()
initgrp(void)
{
Py_InitModule3("grp", grp_methods, grp__doc__);
}

View File

@ -706,7 +706,7 @@ static PyMethodDef imageop_methods[] = {
DL_EXPORT(void)
initimageop()
initimageop(void)
{
PyObject *m, *d;
m = Py_InitModule("imageop", imageop_methods);

View File

@ -509,7 +509,7 @@ static PyMethodDef imgfile_methods[] = {
void
initimgfile()
initimgfile(void)
{
PyObject *m, *d;
m = Py_InitModule("imgfile", imgfile_methods);

View File

@ -384,7 +384,7 @@ static PyMethodDef linuxaudiodev_methods[] = {
};
void
initlinuxaudiodev()
initlinuxaudiodev(void)
{
PyObject *m, *d, *x;

View File

@ -38,7 +38,7 @@ extern double modf (double, double *);
#endif
static PyObject *
math_error()
math_error(void)
{
if (errno == EDOM)
PyErr_SetString(PyExc_ValueError, "math domain error");
@ -259,7 +259,7 @@ static char module_doc [] =
mathematical functions defined by the C standard.";
DL_EXPORT(void)
initmath()
initmath(void)
{
PyObject *m, *d, *v;

View File

@ -31,7 +31,7 @@ staticforward PyTypeObject MD5type;
#define is_md5object(v) ((v)->ob_type == &MD5type)
static md5object *
newmd5object()
newmd5object(void)
{
md5object *md5p;
@ -236,7 +236,7 @@ static PyMethodDef md5_functions[] = {
/* Initialize this module. */
DL_EXPORT(void)
initmd5()
initmd5(void)
{
PyObject *m, *d;

View File

@ -94,7 +94,7 @@ static const char initialiser_name[] = "mpz";
/* #define MPZ_DEBUG */
static mpzobject *
newmpzobject()
newmpzobject(void)
{
mpzobject *mpzp;
@ -1632,8 +1632,7 @@ static PyMethodDef mpz_functions[] = {
#ifdef MP_TEST_ALLOC
#define MP_TEST_SIZE 4
static const char mp_test_magic[MP_TEST_SIZE] = {'\xAA','\xAA','\xAA','\xAA'};
static mp_test_error( location )
int *location;
static mp_test_error(int *location)
{
/* assumptions: *alloc returns address divisible by 4,
mpz_* routines allocate in chunks divisible by four */
@ -1716,7 +1715,7 @@ void mp_free(void *ptr, size_t size)
/* Initialize this module. */
DL_EXPORT(void)
initmpz()
initmpz(void)
{
PyObject *module;
PyObject *dict;

View File

@ -195,7 +195,7 @@ char new_doc[] =
You need to know a great deal about the interpreter to use this!";
DL_EXPORT(void)
initnew()
initnew(void)
{
Py_InitModule4("new", new_methods, new_doc, (PyObject *)NULL,
PYTHON_API_VERSION);

View File

@ -295,7 +295,7 @@ nisproc_maplist_2(domainname *argp, CLIENT *clnt)
static
nismaplist *
nis_maplist ()
nis_maplist (void)
{
nisresp_maplist *list;
char *dom;
@ -371,7 +371,7 @@ static PyMethodDef nis_methods[] = {
};
void
initnis ()
initnis (void)
{
PyObject *m, *d;
m = Py_InitModule("nis", nis_methods);

View File

@ -247,7 +247,7 @@ spam2(delslice,__delslice__,
/* Initialization function for the module (*must* be called initoperator) */
DL_EXPORT(void)
initoperator()
initoperator(void)
{
/* Create the module and add the functions */
Py_InitModule4("operator", operator_methods, operator_doc,

View File

@ -629,7 +629,7 @@ insint(PyObject *d, char *name, int value)
/* Initialization function for the module (*must* be called initpcre) */
DL_EXPORT(void)
initpcre()
initpcre(void)
{
PyObject *m, *d;

View File

@ -284,7 +284,7 @@ extern char **environ;
#endif /* !_MSC_VER */
static PyObject *
convertenviron()
convertenviron(void)
{
PyObject *d;
char **e;
@ -344,7 +344,7 @@ convertenviron()
/* Set a POSIX-specific error from errno, and return NULL */
static PyObject *
posix_error()
posix_error(void)
{
return PyErr_SetFromErrno(PyExc_OSError);
}
@ -1916,9 +1916,7 @@ static char posix_getppid__doc__[] =
Return the parent's process id.";
static PyObject *
posix_getppid(self, args)
PyObject *self;
PyObject *args;
posix_getppid(PyObject *self, PyObject *args)
{
if (!PyArg_ParseTuple(args, ":getppid"))
return NULL;
@ -2856,7 +2854,7 @@ posix_symlink(PyObject *self, PyObject *args)
#if defined(PYCC_VACPP) && defined(PYOS_OS2)
static long
system_uptime()
system_uptime(void)
{
ULONG value = 0;
@ -5196,8 +5194,7 @@ static int insertvalues(PyObject *d)
#endif
static int
all_ins(d)
PyObject* d;
all_ins(PyObject *d)
{
#ifdef F_OK
if (ins(d, "F_OK", (long)F_OK)) return -1;
@ -5295,7 +5292,7 @@ all_ins(d)
#endif
DL_EXPORT(void)
INITFUNC()
INITFUNC(void)
{
PyObject *m, *d, *v;

View File

@ -137,7 +137,7 @@ static PyMethodDef pwd_methods[] = {
};
DL_EXPORT(void)
initpwd()
initpwd(void)
{
Py_InitModule4("pwd", pwd_methods, pwd__doc__,
(PyObject *)NULL, PYTHON_API_VERSION);

View File

@ -396,7 +396,7 @@ flex_complete(char *text, int start, int end)
/* Helper to initialize GNU readline properly. */
static void
setup_readline()
setup_readline(void)
{
rl_readline_name = "python";
/* Force rebind of TAB to insert-tab */
@ -485,7 +485,7 @@ static char doc_module[] =
"Importing this module enables command line editing using GNU readline.";
DL_EXPORT(void)
initreadline()
initreadline(void)
{
PyObject *m;

View File

@ -657,7 +657,7 @@ static struct PyMethodDef regex_global_methods[] = {
};
DL_EXPORT(void)
initregex()
initregex(void)
{
PyObject *m, *d, *v;
int i;

View File

@ -446,7 +446,7 @@ static int regexp_ansi_sequences;
unsigned char re_syntax_table[256];
void re_compile_initialize()
void re_compile_initialize(void)
{
int a;

View File

@ -183,7 +183,7 @@ ins(PyObject *dict, char *name, int value)
/* errors will be checked by initresource() */
}
void initresource()
void initresource(void)
{
PyObject *m, *d;

View File

@ -755,7 +755,7 @@ rgbimg_methods[] = {
DL_EXPORT(void)
initrgbimg()
initrgbimg(void)
{
PyObject *m, *d;
m = Py_InitModule("rgbimg", rgbimg_methods);

View File

@ -618,7 +618,7 @@ rotor_methods[] = {
DL_EXPORT(void)
initrotor()
initrotor(void)
{
(void)Py_InitModule("rotor", rotor_methods);
}

View File

@ -337,7 +337,7 @@ static char module_doc[] =
On Windows, only sockets are supported; on Unix, all file descriptors.";
DL_EXPORT(void)
initselect()
initselect(void)
{
PyObject *m, *d;
m = Py_InitModule3("select", select_methods, module_doc);

View File

@ -59,7 +59,7 @@ static PyMethodDef sgi_methods[] = {
void
initsgi()
initsgi(void)
{
Py_InitModule("sgi", sgi_methods);
}

View File

@ -350,7 +350,7 @@ staticforward PyTypeObject SHAtype;
static SHAobject *
newSHAobject()
newSHAobject(void)
{
return (SHAobject *)PyObject_New(SHAobject, &SHAtype);
}
@ -538,7 +538,7 @@ static struct PyMethodDef SHA_functions[] = {
Py_XDECREF(o); }
void
initsha()
initsha(void)
{
PyObject *d, *m;

View File

@ -312,7 +312,7 @@ A signal handler function is called with two arguments:\n\
the first is the signal number, the second is the interrupted stack frame.";
DL_EXPORT(void)
initsignal()
initsignal(void)
{
PyObject *m, *d, *x;
int i;
@ -553,7 +553,7 @@ initsignal()
}
static void
finisignal()
finisignal(void)
{
int i;
PyObject *func;
@ -583,7 +583,7 @@ finisignal()
/* Declared in pyerrors.h */
int
PyErr_CheckSignals()
PyErr_CheckSignals(void)
{
int i;
PyObject *f;
@ -623,7 +623,7 @@ PyErr_CheckSignals()
* Declared in pyerrors.h
*/
void
PyErr_SetInterrupt()
PyErr_SetInterrupt(void)
{
is_tripped++;
Handlers[SIGINT].tripped = 1;
@ -631,20 +631,20 @@ PyErr_SetInterrupt()
}
void
PyOS_InitInterrupts()
PyOS_InitInterrupts(void)
{
initsignal();
_PyImport_FixupExtension("signal", "signal");
}
void
PyOS_FiniInterrupts()
PyOS_FiniInterrupts(void)
{
finisignal();
}
int
PyOS_InterruptOccurred()
PyOS_InterruptOccurred(void)
{
if (Handlers[SIGINT].tripped) {
#ifdef WITH_THREAD
@ -658,7 +658,7 @@ PyOS_InterruptOccurred()
}
void
PyOS_AfterFork()
PyOS_AfterFork(void)
{
#ifdef WITH_THREAD
main_thread = PyThread_get_thread_ident();

View File

@ -228,7 +228,7 @@ static PyObject *SSLErrorObject;
and return a NULL pointer from a function. */
static PyObject *
PySocket_Err()
PySocket_Err(void)
{
#ifdef MS_WINDOWS
if (WSAGetLastError()) {
@ -1437,9 +1437,7 @@ Return the IP address (a string of the form '255.255.255.255') for a host.";
/* Convenience function common to gethostbyname_ex and gethostbyaddr */
static PyObject *
gethost_common(h, addr)
struct hostent *h;
struct sockaddr_in *addr;
gethost_common(struct hostent *h, struct sockaddr_in *addr)
{
char **pch;
PyObject *rtn_tuple = (PyObject *)NULL;
@ -2185,13 +2183,13 @@ insint(PyObject *d, char *name, int value)
/* Additional initialization and cleanup for NT/Windows */
static void
NTcleanup()
NTcleanup(void)
{
WSACleanup();
}
static int
NTinit()
NTinit(void)
{
WSADATA WSAData;
int ret;
@ -2225,13 +2223,13 @@ NTinit()
/* Additional initialization and cleanup for OS/2 */
static void
OS2cleanup()
OS2cleanup(void)
{
/* No cleanup is necessary for OS/2 Sockets */
}
static int
OS2init()
OS2init(void)
{
char reason[64];
int rc = sock_init();

View File

@ -167,7 +167,7 @@ static PyMethodDef SoundexMethods[] =
/* Register the method table.
*/
DL_EXPORT(void)
initsoundex()
initsoundex(void)
{
(void) Py_InitModule4("soundex",
SoundexMethods,

View File

@ -1180,7 +1180,7 @@ strop_methods[] = {
DL_EXPORT(void)
initstrop()
initstrop(void)
{
PyObject *m, *d, *s;
char buf[256];

View File

@ -1222,7 +1222,7 @@ static PyMethodDef struct_methods[] = {
/* Module initialization */
DL_EXPORT(void)
initstruct()
initstruct(void)
{
PyObject *m, *d;

View File

@ -482,7 +482,7 @@ static PyMethodDef sunaudiodev_methods[] = {
};
void
initsunaudiodev()
initsunaudiodev(void)
{
PyObject *m, *d;

View File

@ -41,7 +41,7 @@ static PyObject *newcaptureobject(svobject *, void *, int);
/* Set a SV-specific error from svideo_errno and return NULL */
static PyObject *
sv_error()
sv_error(void)
{
PyErr_SetString(SvError, svStrerror(svideo_errno));
return NULL;
@ -961,7 +961,7 @@ static PyMethodDef sv_methods[] = {
};
void
initsv()
initsv(void)
{
PyObject *m, *d;

View File

@ -168,7 +168,7 @@ ins(PyObject *d, char *s, long x)
/* Initialization function for the module */
DL_EXPORT(void)
initsyslog()
initsyslog(void)
{
PyObject *m, *d;

View File

@ -100,7 +100,7 @@ static void NotifierExitHandler _ANSI_ARGS_((ClientData clientData));
*/
static void
InitNotifier()
InitNotifier(void)
{
initialized = 1;
memset(&notifier, 0, sizeof(notifier));
@ -507,7 +507,7 @@ Tcl_ServiceEvent(flags)
*/
int
Tcl_GetServiceMode()
Tcl_GetServiceMode(void)
{
if (!initialized) {
InitNotifier();
@ -799,7 +799,7 @@ Tcl_DoOneEvent(flags)
*/
int
Tcl_ServiceAll()
Tcl_ServiceAll(void)
{
int result = 0;
EventSource *sourcePtr;
@ -894,7 +894,7 @@ Tcl_ServiceAll()
*/
int
PyTcl_WaitUntilEvent()
PyTcl_WaitUntilEvent(void)
{
int flags = TCL_ALL_EVENTS;
int result = 0, oldMode;

View File

@ -288,7 +288,7 @@ static PyMethodDef termios_methods[] =
};
DL_EXPORT(void)
PyInit_termios()
PyInit_termios(void)
{
PyObject *m, *d;

View File

@ -34,7 +34,7 @@ typedef struct {
staticforward PyTypeObject Locktype;
static lockobject *
newlockobject()
newlockobject(void)
{
lockobject *self;
self = PyObject_New(lockobject, &Locktype);
@ -377,7 +377,7 @@ unlock it. A thread attempting to lock a lock that it has already locked\n\
will block until another thread unlocks it. Deadlocks may ensue.";
DL_EXPORT(void)
initthread()
initthread(void)
{
PyObject *m, *d;

View File

@ -107,7 +107,7 @@ static PyObject *moddict;
static long timezone;
static void
initmactimezone()
initmactimezone(void)
{
MachineLocation loc;
long delta;
@ -579,7 +579,7 @@ strptime() -- parse string to time tuple according to format specification\n\
DL_EXPORT(void)
inittime()
inittime(void)
{
PyObject *m, *d;
char *p;
@ -667,7 +667,7 @@ inittime()
/* Implement floattime() for various platforms */
static double
floattime()
floattime(void)
{
/* There are three ways to get the time:
(1) gettimeofday() -- resolution in microseconds

View File

@ -69,7 +69,7 @@ static PyMethodDef timing_methods[] = {
};
DL_EXPORT(void) inittiming()
DL_EXPORT(void) inittiming(void)
{
(void)Py_InitModule("timing", timing_methods);
if (PyErr_Occurred())

View File

@ -273,7 +273,7 @@ static PyMethodDef unicodedata_functions[] = {
};
DL_EXPORT(void)
initunicodedata()
initunicodedata(void)
{
Py_InitModule("unicodedata", unicodedata_functions);
}

View File

@ -202,7 +202,7 @@ static PyMethodDef xx_methods[] = {
/* Initialization function for the module (*must* be called initxx) */
DL_EXPORT(void)
initxx()
initxx(void)
{
PyObject *m, *d;

View File

@ -829,7 +829,7 @@ static char zlib_module_documentation[]=
;
DL_EXPORT(void)
PyInit_zlib()
PyInit_zlib(void)
{
PyObject *m, *d, *ver;
Comptype.ob_type = &PyType_Type;