tcltk: convert K&R function definitions to ANSI C
Convert the old-style (K&R) function definitions in tcltk/ to ANSI C prototypes, formatted in the project's convention: the return type on its own line and each parameter on its own line, indented four spaces, with the original parameter comments retained. Builds cleanly under GCC 16 / C23 (with the -std=gnu17 build change). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
parent
8f12f94f7f
commit
314978eec5
|
|
@ -18,8 +18,8 @@
|
|||
/*----------------------------------------------------------------------*/
|
||||
|
||||
int
|
||||
magic_AppInit(interp)
|
||||
Tcl_Interp *interp;
|
||||
magic_AppInit(
|
||||
Tcl_Interp *interp)
|
||||
{
|
||||
if (Tcl_Init(interp) == TCL_ERROR) {
|
||||
return TCL_ERROR;
|
||||
|
|
@ -42,9 +42,9 @@ magic_AppInit(interp)
|
|||
/*----------------------------------------------------------------------*/
|
||||
|
||||
int
|
||||
main(argc, argv)
|
||||
int argc;
|
||||
char **argv;
|
||||
main(
|
||||
int argc,
|
||||
char **argv)
|
||||
{
|
||||
Tcl_Main(argc, argv, magic_AppInit);
|
||||
return 0;
|
||||
|
|
|
|||
|
|
@ -44,8 +44,8 @@
|
|||
/*----------------------------------------------------------------------*/
|
||||
|
||||
int
|
||||
magic_AppInit(interp)
|
||||
Tcl_Interp *interp;
|
||||
magic_AppInit(
|
||||
Tcl_Interp *interp)
|
||||
{
|
||||
if (Tcl_Init(interp) == TCL_ERROR) {
|
||||
return TCL_ERROR;
|
||||
|
|
@ -68,9 +68,9 @@ magic_AppInit(interp)
|
|||
/*----------------------------------------------------------------------*/
|
||||
|
||||
int
|
||||
main(argc, argv)
|
||||
int argc;
|
||||
char **argv;
|
||||
main(
|
||||
int argc,
|
||||
char **argv)
|
||||
{
|
||||
Tk_Main(argc, argv, magic_AppInit);
|
||||
return 0;
|
||||
|
|
|
|||
|
|
@ -85,8 +85,8 @@ void RegisterTkCommands();
|
|||
/*--------------------------------------------------------------*/
|
||||
|
||||
int
|
||||
TagVerify(keyword)
|
||||
char *keyword;
|
||||
TagVerify(
|
||||
char *keyword)
|
||||
{
|
||||
char *croot, *postcmd;
|
||||
HashEntry *entry;
|
||||
|
|
@ -107,11 +107,11 @@ TagVerify(keyword)
|
|||
/*--------------------------------------------------------------*/
|
||||
|
||||
int
|
||||
TagCallback(interp, tkpath, argc, argv)
|
||||
Tcl_Interp *interp;
|
||||
char *tkpath;
|
||||
int argc; /* original command's number of arguments */
|
||||
char *argv[]; /* original command's argument list */
|
||||
TagCallback(
|
||||
Tcl_Interp *interp,
|
||||
char *tkpath,
|
||||
int argc, /* original command's number of arguments */
|
||||
char *argv[]) /* original command's argument list */
|
||||
{
|
||||
int argidx, result = TCL_OK;
|
||||
char *postcmd, *substcmd, *newcmd, *sptr, *sres;
|
||||
|
|
@ -582,7 +582,9 @@ _tk_dispatch(ClientData clientData,
|
|||
/*--------------------------------------------------------------*/
|
||||
|
||||
void
|
||||
MakeWindowCommand(char *wname, MagWindow *mw)
|
||||
MakeWindowCommand(
|
||||
char *wname,
|
||||
MagWindow *mw)
|
||||
{
|
||||
char *tclcmdstr;
|
||||
|
||||
|
|
@ -601,7 +603,8 @@ MakeWindowCommand(char *wname, MagWindow *mw)
|
|||
|
||||
#ifdef HAVE_SETRLIMIT
|
||||
static int
|
||||
process_rlimit_nofile_ensure(rlim_t nofile)
|
||||
process_rlimit_nofile_ensure(
|
||||
rlim_t nofile)
|
||||
{
|
||||
struct rlimit rlim;
|
||||
int err = getrlimit(RLIMIT_NOFILE, &rlim);
|
||||
|
|
@ -948,10 +951,10 @@ _magic_startup(ClientData clientData,
|
|||
/*--------------------------------------------------------------*/
|
||||
|
||||
int
|
||||
TxDialog(prompt, responses, defresp)
|
||||
const char *prompt;
|
||||
const char * const *responses;
|
||||
int defresp;
|
||||
TxDialog(
|
||||
const char *prompt,
|
||||
const char * const *responses,
|
||||
int defresp)
|
||||
{
|
||||
Tcl_Obj *objPtr;
|
||||
int code, result, pos;
|
||||
|
|
@ -1044,10 +1047,10 @@ TxSetPrompt(
|
|||
/*--------------------------------------------------------------*/
|
||||
|
||||
char *
|
||||
TxGetLinePfix(dest, maxChars, prefix)
|
||||
char *dest;
|
||||
int maxChars;
|
||||
char *prefix;
|
||||
TxGetLinePfix(
|
||||
char *dest,
|
||||
int maxChars,
|
||||
char *prefix)
|
||||
{
|
||||
Tcl_Obj *objPtr;
|
||||
int charsStored;
|
||||
|
|
@ -1104,8 +1107,8 @@ TxGetLinePfix(dest, maxChars, prefix)
|
|||
/*--------------------------------------------------------------*/
|
||||
|
||||
void
|
||||
TxDispatch(f)
|
||||
FILE *f; /* Under Tcl, we never call this with NULL */
|
||||
TxDispatch(
|
||||
FILE *f) /* Under Tcl, we never call this with NULL */
|
||||
{
|
||||
if (f == NULL)
|
||||
{
|
||||
|
|
@ -1129,8 +1132,8 @@ TxDispatch(f)
|
|||
/*--------------------------------------------------------------*/
|
||||
|
||||
void
|
||||
TxParseString(str)
|
||||
const char *str;
|
||||
TxParseString(
|
||||
const char *str)
|
||||
{
|
||||
const char *reply;
|
||||
|
||||
|
|
@ -1224,7 +1227,10 @@ TxFlush()
|
|||
/*--------------------------------------------------------------*/
|
||||
|
||||
int
|
||||
Tcl_printf(FILE *f, const char *fmt, va_list args_in)
|
||||
Tcl_printf(
|
||||
FILE *f,
|
||||
const char *fmt,
|
||||
va_list args_in)
|
||||
{
|
||||
va_list args;
|
||||
static char outstr[128] = "puts -nonewline std";
|
||||
|
|
@ -1318,8 +1324,8 @@ Tcl_printf(FILE *f, const char *fmt, va_list args_in)
|
|||
/*--------------------------------------------------------------*/
|
||||
|
||||
char *
|
||||
Tcl_escape(instring)
|
||||
char *instring;
|
||||
Tcl_escape(
|
||||
char *instring)
|
||||
{
|
||||
char *newstr;
|
||||
int nchars = 0;
|
||||
|
|
@ -1368,11 +1374,11 @@ Tcl_escape(instring)
|
|||
/*--------------------------------------------------------------*/
|
||||
|
||||
int
|
||||
TerminalInputProc(instanceData, buf, toRead, errorCodePtr)
|
||||
ClientData instanceData;
|
||||
char *buf;
|
||||
int toRead;
|
||||
int *errorCodePtr;
|
||||
TerminalInputProc(
|
||||
ClientData instanceData,
|
||||
char *buf,
|
||||
int toRead,
|
||||
int *errorCodePtr)
|
||||
{
|
||||
FileState *fsPtr = (FileState *)instanceData;
|
||||
int bytesRead, i, tlen;
|
||||
|
|
@ -1417,8 +1423,8 @@ TerminalInputProc(instanceData, buf, toRead, errorCodePtr)
|
|||
/*--------------------------------------------------------------*/
|
||||
|
||||
int
|
||||
Tclmagic_Init(interp)
|
||||
Tcl_Interp *interp;
|
||||
Tclmagic_Init(
|
||||
Tcl_Interp *interp)
|
||||
{
|
||||
const char *cadroot;
|
||||
|
||||
|
|
@ -1475,8 +1481,8 @@ Tclmagic_Init(interp)
|
|||
/*--------------------------------------------------------------*/
|
||||
|
||||
int
|
||||
Tclmagic_SafeInit(interp)
|
||||
Tcl_Interp *interp;
|
||||
Tclmagic_SafeInit(
|
||||
Tcl_Interp *interp)
|
||||
{
|
||||
return Tclmagic_Init(interp);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue