Commit c58d03b8 authored by Mike Frysinger's avatar Mike Frysinger

statistics: constify strings

Mark all the read-only strings in this file as const.
parent 9c4b23a9
...@@ -23,14 +23,14 @@ enum State { ...@@ -23,14 +23,14 @@ enum State {
#define normal number #define normal number
struct entry { struct entry {
char *title; const char *title;
char *out; char *out;
enum State type; enum State type;
}; };
struct statedesc { struct statedesc {
int indent; int indent;
char *title; const char *title;
}; };
static struct statedesc states[] = { static struct statedesc states[] = {
...@@ -292,7 +292,7 @@ static struct entry Tcpexttab[] = ...@@ -292,7 +292,7 @@ static struct entry Tcpexttab[] =
}; };
struct tabtab { struct tabtab {
char *title; const char *title;
struct entry *tab; struct entry *tab;
size_t size; size_t size;
int *flag; int *flag;
...@@ -324,7 +324,7 @@ static int cmpentries(const void *a, const void *b) ...@@ -324,7 +324,7 @@ static int cmpentries(const void *a, const void *b)
return strcmp(((struct entry *) a)->title, ((struct entry *) b)->title); return strcmp(((struct entry *) a)->title, ((struct entry *) b)->title);
} }
static void printval(struct tabtab *tab, char *title, unsigned long long val) static void printval(struct tabtab *tab, const char *title, unsigned long long val)
{ {
struct entry *ent = NULL, key; struct entry *ent = NULL, key;
int type; int type;
...@@ -382,7 +382,7 @@ static void printval(struct tabtab *tab, char *title, unsigned long long val) ...@@ -382,7 +382,7 @@ static void printval(struct tabtab *tab, char *title, unsigned long long val)
state = type; state = type;
} }
static struct tabtab *newtable(struct tabtab *tabs, char *title) static struct tabtab *newtable(struct tabtab *tabs, const char *title)
{ {
struct tabtab *t; struct tabtab *t;
static struct tabtab dummytab; static struct tabtab dummytab;
...@@ -457,9 +457,9 @@ formaterr: ...@@ -457,9 +457,9 @@ formaterr:
return -1; return -1;
} }
static void cpytitle(char *original, char *new) static void cpytitle(const char *original, char *new)
{ {
char *ptr = original; const char *ptr = original;
while(*ptr != '6' && *ptr != '\0') { while(*ptr != '6' && *ptr != '\0') {
*new = *ptr; *new = *ptr;
new++; new++;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment