Skip to content

Commit

Permalink
Constify.
Browse files Browse the repository at this point in the history
  • Loading branch information
gwsw committed Nov 7, 2023
1 parent 1263a35 commit 312532d
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 13 deletions.
2 changes: 1 addition & 1 deletion cmdbuf.c
Original file line number Diff line number Diff line change
Expand Up @@ -1480,7 +1480,7 @@ static void addhist_init(void *uparam, struct mlist *ml, constant char *string)
if (ml != NULL)
cmd_addhist(ml, string, 0);
else if (string != NULL)
restore_mark((char*)string); /*{{const-issue}}*/
restore_mark(string);
}
#endif /* CMD_HISTORY */

Expand Down
7 changes: 4 additions & 3 deletions command.c
Original file line number Diff line number Diff line change
Expand Up @@ -1234,6 +1234,7 @@ public void commands(void)
LWCHAR c;
int action;
char *cbuf;
constant char *msg;
int newaction;
int save_jump_sline;
int save_search_type;
Expand Down Expand Up @@ -1932,10 +1933,10 @@ public void commands(void)
optgetname = FALSE;
mca_opt_toggle();
c = getcc();
cbuf = opt_toggle_disallowed(c);
if (cbuf != NULL)
msg = opt_toggle_disallowed(c);
if (msg != NULL)
{
error(cbuf, NULL_PARG);
error(msg, NULL_PARG);
break;
}
goto again;
Expand Down
6 changes: 3 additions & 3 deletions mark.c
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,7 @@ public void save_marks(FILE *fout, constant char *hdr)
/*
* Restore one mark from the history file.
*/
public void restore_mark(char *line)
public void restore_mark(constant char *line)
{
struct mark *m;
int ln;
Expand All @@ -408,15 +408,15 @@ public void restore_mark(char *line)
if (m == NULL)
return;
skip_whitespace;
ln = lstrtoi(line, &line, 10);
ln = lstrtoic(line, &line, 10);
if (ln < 0)
return;
if (ln < 1)
ln = 1;
if (ln > sc_height)
ln = sc_height;
skip_whitespace;
pos = lstrtopos(line, &line, 10);
pos = lstrtoposc(line, &line, 10);
if (pos < 0)
return;
skip_whitespace;
Expand Down
6 changes: 3 additions & 3 deletions optfunc.c
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ public void opt__O(int type, constant char *s)
}
#endif

static int toggle_fraction(int *num, long *frac, constant char *s, char *printopt, void (*calc)(void))
static int toggle_fraction(int *num, long *frac, constant char *s, constant char *printopt, void (*calc)(void))
{
int err;
if (s == NULL)
Expand Down Expand Up @@ -188,7 +188,7 @@ static int toggle_fraction(int *num, long *frac, constant char *s, char *printop
return 0;
}

static void query_fraction(int value, long fraction, char *int_msg, char *frac_msg)
static void query_fraction(int value, long fraction, constant char *int_msg, constant char *frac_msg)
{
PARG parg;

Expand Down Expand Up @@ -545,7 +545,7 @@ public void opt__V(int type, constant char *s)
/*
* Parse an MSDOS color descriptor.
*/
static void colordesc(char *s, int *fg_color, int *bg_color)
static void colordesc(constant char *s, int *fg_color, int *bg_color)
{
int fg, bg;
#if MSDOS_COMPILER==WIN32C
Expand Down
6 changes: 3 additions & 3 deletions option.c
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ public void scan_option(constant char *s)
switch (pendopt->otype & OTYPE)
{
case STRING:
(*pendopt->ofunc)(INIT, (char*) s); /*{{const-issue}}*/
(*pendopt->ofunc)(INIT, s);
break;
case NUMBER:
printopt = opt_desc(pendopt);
Expand Down Expand Up @@ -142,7 +142,7 @@ public void scan_option(constant char *s)
* EVERY input file.
*/
plusoption = TRUE;
s = optstring(s, &str, propt('+'), NULL); /*{{const-issue}}*/
s = optstring(s, &str, propt('+'), NULL);
if (s == NULL)
return;
if (*str == '+')
Expand Down Expand Up @@ -519,7 +519,7 @@ public constant char * opt_prompt(struct loption *o)
* If the specified option can be toggled, return NULL.
* Otherwise return an appropriate error message.
*/
public char * opt_toggle_disallowed(int c)
public constant char * opt_toggle_disallowed(int c)
{
switch (c)
{
Expand Down

0 comments on commit 312532d

Please sign in to comment.