debug: convert K&R function definitions to ANSI C

Convert the old-style (K&R) function definitions in debug/ 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.

Corrects the HistCreate / HistAdd declarations in debug.h to use bool
for the ptrKeys parameter, matching their definitions.

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:
Andreas Wendleder 2026-06-10 03:49:16 +02:00
parent c74eaf4ee8
commit 132155c942
No known key found for this signature in database
GPG Key ID: 588785BFDFB01ABD
3 changed files with 30 additions and 30 deletions

View File

@ -68,8 +68,8 @@ extern struct debugClient debugClients[];
#define DebugIsSet(cid, f) debugClients[(spointertype) cid].dc_flags[f].df_value
/* procedures */
extern void HistCreate(const char *name, int ptrKeys, int low, int step, int bins);
extern void HistAdd(const char *name, int ptrKeys, int value);
extern void HistCreate(const char *name, bool ptrKeys, int low, int step, int bins);
extern void HistAdd(const char *name, bool ptrKeys, int value);
extern void HistPrint(const char *name);
extern ClientData DebugAddClient(const char *name, int maxflags);
extern int DebugAddFlag(ClientData clientID, const char *name);

View File

@ -56,9 +56,9 @@ int debugNumClients = 0;
*/
ClientData
DebugAddClient(name, maxflags)
const char *name;
int maxflags;
DebugAddClient(
const char *name,
int maxflags)
{
struct debugClient *dc;
@ -112,9 +112,9 @@ DebugAddClient(name, maxflags)
*/
int
DebugAddFlag(clientID, name)
ClientData clientID; /* Client identifier from DebugAddClient */
const char *name; /* Name of debugging flag */
DebugAddFlag(
ClientData clientID, /* Client identifier from DebugAddClient */
const char *name) /* Name of debugging flag */
{
int id = (int) CD2INT(clientID);
struct debugClient *dc;
@ -156,8 +156,8 @@ DebugAddFlag(clientID, name)
*/
void
DebugShow(clientID)
ClientData clientID;
DebugShow(
ClientData clientID)
{
int id = (int) CD2INT(clientID);
struct debugClient *dc;
@ -195,11 +195,11 @@ DebugShow(clientID)
*/
void
DebugSet(clientID, argc, argv, value)
ClientData clientID;
int argc;
char *argv[];
bool value;
DebugSet(
ClientData clientID,
int argc,
char *argv[],
int value)
{
bool badFlag = FALSE;
int id = (int) CD2INT(clientID);

View File

@ -50,9 +50,9 @@ Histogram * hist_list = (Histogram *) NULL;
* ----------------------------------------------------------------------------
*/
Histogram *
histFind(name, ptrKeys)
const char * name;
bool ptrKeys;
histFind(
const char * name,
bool ptrKeys)
{
Histogram * h;
for(h=hist_list; h!=(Histogram *) NULL; h=h->hi_next)
@ -81,12 +81,12 @@ histFind(name, ptrKeys)
* ----------------------------------------------------------------------------
*/
void
HistCreate(name, ptrKeys, low, step, bins)
const char * name; /* Name for histogram add and print */
bool ptrKeys; /* TRUE if name is a character pointer*/
int low; /* The lowest value for the histogram */
int step; /* The increment for each bin */
int bins; /* The numbe of bins in the histogram */
HistCreate(
const char * name, /* Name for histogram add and print */
bool ptrKeys, /* TRUE if name is a character pointer*/
int low, /* The lowest value for the histogram */
int step, /* The increment for each bin */
int bins) /* The numbe of bins in the histogram */
{
Histogram * new;
int i;
@ -134,10 +134,10 @@ HistCreate(name, ptrKeys, low, step, bins)
* ----------------------------------------------------------------------------
*/
void
HistAdd(name, ptrKeys, value)
const char * name; /* Identifier for the histogram */
bool ptrKeys; /* TRUE if the name is a pointer*/
int value; /* Value to index the column */
HistAdd(
const char * name, /* Identifier for the histogram */
bool ptrKeys, /* TRUE if the name is a pointer*/
int value) /* Value to index the column */
{
Histogram * h;
@ -176,8 +176,8 @@ HistAdd(name, ptrKeys, value)
* ----------------------------------------------------------------------------
*/
void
HistPrint(name)
const char * name;
HistPrint(
const char * name)
{
FILE * fp, * fopen();
Histogram * h;