Skip to content

Commit

Permalink
A little tweaking of types.
Browse files Browse the repository at this point in the history
  • Loading branch information
gwsw committed Dec 2, 2023
1 parent 6e9f84a commit 0bcc2cb
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 19 deletions.
19 changes: 9 additions & 10 deletions command.c
Original file line number Diff line number Diff line change
Expand Up @@ -508,7 +508,7 @@ static int mca_opt_char(char c)
/*
* Display a prompt appropriate for the option parameter.
*/
start_mca(A_OPT_TOGGLE, opt_prompt(curropt), (void*)NULL, 0);
start_mca(A_OPT_TOGGLE, opt_prompt(curropt), NULL, 0);
return (MCA_MORE);
}

Expand Down Expand Up @@ -1392,7 +1392,7 @@ public void commands(void)
/*
* First digit of a number.
*/
start_mca(A_DIGIT, ":", (void*)NULL, CF_QUIT_ON_ERASE);
start_mca(A_DIGIT, ":", NULL, CF_QUIT_ON_ERASE);
goto again;

case A_F_WINDOW:
Expand Down Expand Up @@ -1973,7 +1973,7 @@ public void commands(void)
/*
* Set an initial command for new files.
*/
start_mca(A_FIRSTCMD, "+", (void*)NULL, 0);
start_mca(A_FIRSTCMD, "+", NULL, 0);
c = getcc();
goto again;

Expand All @@ -2000,7 +2000,7 @@ public void commands(void)
*/
if (ch_getflags() & CH_HELPFILE)
break;
start_mca(A_SETMARK, "set mark: ", (void*)NULL, 0);
start_mca(A_SETMARK, "set mark: ", NULL, 0);
c = getcc();
if (is_erase_char(c) || is_newline_char(c))
break;
Expand All @@ -2012,7 +2012,7 @@ public void commands(void)
/*
* Clear a mark.
*/
start_mca(A_CLRMARK, "clear mark: ", (void*)NULL, 0);
start_mca(A_CLRMARK, "clear mark: ", NULL, 0);
c = getcc();
if (is_erase_char(c) || is_newline_char(c))
break;
Expand All @@ -2024,7 +2024,7 @@ public void commands(void)
/*
* Jump to a marked position.
*/
start_mca(A_GOMARK, "goto mark: ", (void*)NULL, 0);
start_mca(A_GOMARK, "goto mark: ", NULL, 0);
c = getcc();
if (is_erase_char(c) || is_newline_char(c))
break;
Expand All @@ -2039,7 +2039,7 @@ public void commands(void)
#if PIPEC
if (secure_allow(SF_PIPE))
{
start_mca(A_PIPE, "|mark: ", (void*)NULL, 0);
start_mca(A_PIPE, "|mark: ", NULL, 0);
c = getcc();
if (is_erase_char(c))
break;
Expand All @@ -2058,7 +2058,7 @@ public void commands(void)

case A_B_BRACKET:
case A_F_BRACKET:
start_mca(action, "Brackets: ", (void*)NULL, 0);
start_mca(action, "Brackets: ", NULL, 0);
c = getcc();
goto again;

Expand Down Expand Up @@ -2117,8 +2117,7 @@ public void commands(void)
if (mca != A_PREFIX)
{
cmd_reset();
start_mca(A_PREFIX, " ", (void*)NULL,
CF_QUIT_ON_ERASE);
start_mca(A_PREFIX, " ", NULL, CF_QUIT_ON_ERASE);
(void) cmd_char(c);
}
c = getcc();
Expand Down
2 changes: 1 addition & 1 deletion main.c
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ extern int first_time;

#if MSDOS_COMPILER==WIN32C && (defined(MINGW) || defined(_MSC_VER))
/* malloc'ed 0-terminated utf8 of 0-terminated wide ws, or null on errors */
static char *utf8_from_wide(const wchar_t *ws)
static char *utf8_from_wide(constant wchar_t *ws)
{
char *u8 = NULL;
int n = WideCharToMultiByte(CP_UTF8, 0, ws, -1, NULL, 0, NULL, NULL);
Expand Down
4 changes: 2 additions & 2 deletions optfunc.c
Original file line number Diff line number Diff line change
Expand Up @@ -1000,7 +1000,7 @@ public void opt_intr(int type, constant char *s)
* Return -1 if the list entry is missing or empty.
* Updates *sp to point to the first char of the next number in the list.
*/
public int next_cnum(constant char **sp, constant char *printopt, const char *errmsg, lbool *errp)
public int next_cnum(constant char **sp, constant char *printopt, constant char *errmsg, lbool *errp)
{
int n;
*errp = FALSE;
Expand Down Expand Up @@ -1028,7 +1028,7 @@ public int next_cnum(constant char **sp, constant char *printopt, const char *er
* Parse a parameter to the --header option.
* Value is "L,C,N", where each field is a decimal number or empty.
*/
static lbool parse_header(const char *s, int *lines, int *cols, POSITION *start_pos)
static lbool parse_header(constant char *s, int *lines, int *cols, POSITION *start_pos)
{
int n;
lbool err;
Expand Down
2 changes: 1 addition & 1 deletion output.c
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ typedef struct t_sgr {
t_color bg;
} t_sgr;

static const t_sgr SGR_DEFAULT; /* = {0} */
static constant t_sgr SGR_DEFAULT; /* = {0} */

static void update_sgr(t_sgr *sgr, long code)
{
Expand Down
12 changes: 8 additions & 4 deletions search.c
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,8 @@ struct hilite_node
};
struct hilite_storage
{
int capacity;
int used;
size_t capacity;
size_t used;
struct hilite_storage *next;
struct hilite_node *nodes;
};
Expand Down Expand Up @@ -587,6 +587,10 @@ public POSITION prev_unfiltered(POSITION pos)
return (pos);
}

/*
* Set the hshift for the line starting at line_pos so that the string
* between start_off and end_off is visible on the screen.
*/
static void shift_visible(POSITION line_pos, size_t start_off, size_t end_off)
{
POSITION start_pos = line_pos + start_off;
Expand Down Expand Up @@ -674,7 +678,7 @@ public int is_hilited_attr(POSITION pos, POSITION epos, int nohide, int *p_match
*/
static struct hilite_storage * hlist_getstorage(struct hilite_tree *anchor)
{
int capacity = 1;
size_t capacity = 1;
struct hilite_storage *s;

if (anchor->current)
Expand All @@ -685,7 +689,7 @@ static struct hilite_storage * hlist_getstorage(struct hilite_tree *anchor)
}

s = (struct hilite_storage *) ecalloc(1, sizeof(struct hilite_storage));
s->nodes = (struct hilite_node *) ecalloc((size_t) capacity, sizeof(struct hilite_node));
s->nodes = (struct hilite_node *) ecalloc(capacity, sizeof(struct hilite_node));
s->capacity = capacity;
s->used = 0;
s->next = NULL;
Expand Down
2 changes: 1 addition & 1 deletion xbuf.c
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public void xbuf_add_byte(struct xbuffer *xbuf, unsigned char b)
}
xbuf->data = data;
}
xbuf->data[xbuf->end++] = (unsigned char) b;
xbuf->data[xbuf->end++] = b;
}

/*
Expand Down

0 comments on commit 0bcc2cb

Please sign in to comment.