Skip to content

Commit

Permalink
kconfig: Propagate const
Browse files Browse the repository at this point in the history
Commit 2e7a091 made struct file->name a const char*, but forgot to
constify all users of it.

Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Michal Marek <mmarek@suse.cz>
  • Loading branch information
Michal Marek committed Sep 30, 2010
1 parent 8bea754 commit a01ebe1
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions scripts/kconfig/kxgettext.c
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,11 @@ static char *escape(const char* text, char *bf, int len)

struct file_line {
struct file_line *next;
char* file;
int lineno;
const char *file;
int lineno;
};

static struct file_line *file_line__new(char *file, int lineno)
static struct file_line *file_line__new(const char *file, int lineno)
{
struct file_line *self = malloc(sizeof(*self));

Expand All @@ -90,7 +90,8 @@ struct message {

static struct message *message__list;

static struct message *message__new(const char *msg, char *option, char *file, int lineno)
static struct message *message__new(const char *msg, char *option,
const char *file, int lineno)
{
struct message *self = malloc(sizeof(*self));

Expand Down Expand Up @@ -130,7 +131,8 @@ static struct message *mesage__find(const char *msg)
return m;
}

static int message__add_file_line(struct message *self, char *file, int lineno)
static int message__add_file_line(struct message *self, const char *file,
int lineno)
{
int rc = -1;
struct file_line *fl = file_line__new(file, lineno);
Expand All @@ -145,7 +147,8 @@ static int message__add_file_line(struct message *self, char *file, int lineno)
return rc;
}

static int message__add(const char *msg, char *option, char *file, int lineno)
static int message__add(const char *msg, char *option, const char *file,
int lineno)
{
int rc = 0;
char bf[16384];
Expand Down

0 comments on commit a01ebe1

Please sign in to comment.