From 195dda1e069382cdedad55145b1b034bae3716e0 Mon Sep 17 00:00:00 2001 From: "Darryl L. Miles" Date: Sat, 12 Oct 2024 13:57:08 +0100 Subject: [PATCH] debug/hist.c: constify and add prototype --- debug/debug.h | 8 ++++---- debug/hist.c | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/debug/debug.h b/debug/debug.h index 7030dbd5..b7268fe5 100644 --- a/debug/debug.h +++ b/debug/debug.h @@ -54,7 +54,7 @@ typedef struct histogram int hi_max; /* Largest item in the histogram*/ int hi_min; /* Smallest item in the histogram*/ int hi_cum; /* Cumulative item total */ - char * hi_title; /* Histogram identifier */ + const char * hi_title; /* Histogram identifier */ bool hi_ptrKeys; /* TRUE if title is a pointer */ int * hi_data; /* Buckets for histogram counts */ struct histogram * hi_next; /* Linked list to next histogram*/ @@ -68,9 +68,9 @@ extern struct debugClient debugClients[]; #define DebugIsSet(cid, f) debugClients[(spointertype) cid].dc_flags[f].df_value /* procedures */ -extern void HistCreate(char *name, int ptrKeys, int low, int step, int bins); -extern void HistAdd(char *name, int ptrKeys, int value); -extern void HistPrint(char *name); +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 HistPrint(const char *name); extern ClientData DebugAddClient(char *name, int maxflags); extern int DebugAddFlag(ClientData clientID, char *name); extern void DebugShow(ClientData clientID); diff --git a/debug/hist.c b/debug/hist.c index 589dbe7b..5ec53800 100644 --- a/debug/hist.c +++ b/debug/hist.c @@ -51,7 +51,7 @@ Histogram * hist_list = (Histogram *) NULL; */ Histogram * histFind(name, ptrKeys) - char * name; + const char * name; bool ptrKeys; { Histogram * h; @@ -82,7 +82,7 @@ histFind(name, ptrKeys) */ void HistCreate(name, ptrKeys, low, step, bins) - char * name; /* Name for histogram add and print */ + 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 */ @@ -135,7 +135,7 @@ HistCreate(name, ptrKeys, low, step, bins) */ void HistAdd(name, ptrKeys, value) - char * name; /* Identifier for the histogram */ + const char * name; /* Identifier for the histogram */ bool ptrKeys; /* TRUE if the name is a pointer*/ int value; /* Value to index the column */ { @@ -177,7 +177,7 @@ HistAdd(name, ptrKeys, value) */ void HistPrint(name) - char * name; + const char * name; { FILE * fp, * fopen(); Histogram * h;