Skip to content

Commit

Permalink
Use lbool type in some more places.
Browse files Browse the repository at this point in the history
  • Loading branch information
gwsw committed Jan 27, 2024
1 parent fcdc61f commit 1f5e990
Show file tree
Hide file tree
Showing 10 changed files with 25 additions and 25 deletions.
4 changes: 2 additions & 2 deletions command.c
Original file line number Diff line number Diff line change
Expand Up @@ -342,15 +342,15 @@ static void exec_mca(void)
/*
* Is a character an erase or kill char?
*/
static int is_erase_char(char c)
static lbool is_erase_char(char c)
{
return (c == erase_char || c == erase2_char || c == kill_char);
}

/*
* Is a character a carriage return or newline?
*/
static int is_newline_char(char c)
static lbool is_newline_char(char c)
{
return (c == '\n' || c == '\r');
}
Expand Down
2 changes: 1 addition & 1 deletion decode.c
Original file line number Diff line number Diff line change
Expand Up @@ -825,7 +825,7 @@ public constant char * lgetenv_ext(constant char *var, unsigned char *env_buf, s
/*
* Is a string null or empty?
*/
public int isnullenv(constant char *s)
public lbool isnullenv(constant char *s)
{
return (s == NULL || *s == '\0');
}
Expand Down
6 changes: 3 additions & 3 deletions filename.c
Original file line number Diff line number Diff line change
Expand Up @@ -763,7 +763,7 @@ public char * lglob(constant char *afilename)
/*
* Does path not represent something in the file system?
*/
public int is_fake_pathname(constant char *path)
public lbool is_fake_pathname(constant char *path)
{
return (strcmp(path, "-") == 0 ||
strcmp(path, FAKE_HELPFILE) == 0 || strcmp(path, FAKE_EMPTYFILE) == 0);
Expand Down Expand Up @@ -990,9 +990,9 @@ public void close_altfile(constant char *altfilename, constant char *filename)
/*
* Is the specified file a directory?
*/
public int is_dir(constant char *filename)
public lbool is_dir(constant char *filename)
{
int isdir = 0;
lbool isdir = FALSE;

#if HAVE_STAT
{
Expand Down
16 changes: 8 additions & 8 deletions line.c
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ static int right_curr;
static int right_column;
static int overstrike; /* Next char should overstrike previous char */
static int last_overstrike = AT_NORMAL;
static int is_null_line; /* There is no current line */
static lbool is_null_line; /* There is no current line */
static LWCHAR pendc;
static POSITION pendpos;
static constant char *end_ansi_chars;
Expand Down Expand Up @@ -243,7 +243,7 @@ public void prewind(void)
overstrike = 0;
last_overstrike = AT_NORMAL;
mbc_buf_len = 0;
is_null_line = 0;
is_null_line = FALSE;
pendc = '\0';
in_hilite = 0;
ansi_in_line = FALSE;
Expand Down Expand Up @@ -564,22 +564,22 @@ public void loadc(void)
/*
* Is a character the end of an ANSI escape sequence?
*/
public int is_ansi_end(LWCHAR ch)
public lbool is_ansi_end(LWCHAR ch)
{
if (!is_ascii_char(ch))
return (0);
return (FALSE);
return (strchr(end_ansi_chars, (char) ch) != NULL);
}

/*
* Can a char appear in an ANSI escape sequence, before the end char?
*/
public int is_ansi_middle(LWCHAR ch)
public lbool is_ansi_middle(LWCHAR ch)
{
if (!is_ascii_char(ch))
return (0);
return (FALSE);
if (is_ansi_end(ch))
return (0);
return (FALSE);
return (strchr(mid_ansi_chars, (char) ch) != NULL);
}

Expand Down Expand Up @@ -1432,7 +1432,7 @@ public int gline(size_t i, int *ap)
*/
public void null_line(void)
{
is_null_line = 1;
is_null_line = TRUE;
cshift = 0;
}

Expand Down
2 changes: 1 addition & 1 deletion option.c
Original file line number Diff line number Diff line change
Expand Up @@ -552,7 +552,7 @@ public constant char * opt_toggle_disallowed(int c)
* In that case, the current option is taken to be the string for
* the previous option.
*/
public int isoptpending(void)
public lbool isoptpending(void)
{
return (pendopt != NULL);
}
Expand Down
10 changes: 5 additions & 5 deletions opttbl.c
Original file line number Diff line number Diff line change
Expand Up @@ -795,15 +795,15 @@ public struct loption * findopt(int c)
/*
*
*/
static int is_optchar(char c)
static lbool is_optchar(char c)
{
if (ASCII_IS_UPPER(c))
return 1;
return TRUE;
if (ASCII_IS_LOWER(c))
return 1;
return TRUE;
if (c == '-')
return 1;
return 0;
return TRUE;
return FALSE;
}

/*
Expand Down
2 changes: 1 addition & 1 deletion pattern.c
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ public int valid_pattern(char *pattern)
/*
* Is a compiled pattern null?
*/
public int is_null_pattern(PATTERN_TYPE pattern)
public lbool is_null_pattern(PATTERN_TYPE pattern)
{
#if HAVE_GNU_REGEX
return (pattern == NULL);
Expand Down
2 changes: 1 addition & 1 deletion screen.c
Original file line number Diff line number Diff line change
Expand Up @@ -2717,7 +2717,7 @@ public void at_switch(int attr)
}
}

public int is_at_equiv(int attr1, int attr2)
public lbool is_at_equiv(int attr1, int attr2)
{
attr1 = apply_at_specials(attr1);
attr2 = apply_at_specials(attr2);
Expand Down
4 changes: 2 additions & 2 deletions search.c
Original file line number Diff line number Diff line change
Expand Up @@ -2344,10 +2344,10 @@ public void set_filter_pattern(constant char *pattern, int search_type)
/*
* Is there a line filter in effect?
*/
public int is_filtering(void)
public lbool is_filtering(void)
{
if (ch_getflags() & CH_HELPFILE)
return (0);
return (FALSE);
return (filter_infos != NULL);
}
#endif
Expand Down
2 changes: 1 addition & 1 deletion ttyin.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public int tty;
extern int sigs;
#if LESSTEST
public char *ttyin_name = NULL;
public int is_lesstest(void)
public lbool is_lesstest(void)
{
return ttyin_name != NULL;
}
Expand Down

0 comments on commit 1f5e990

Please sign in to comment.