mirror of
https://github.com/MidnightCommander/mc
synced 2025-01-18 09:19:24 +03:00
src/edit/syntax.c (syntax_keyword_t, context_rule_t): use gboolean for boolean fields.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
This commit is contained in:
parent
000235c7ee
commit
516eca2658
@ -97,7 +97,7 @@ typedef struct
|
|||||||
char *keyword;
|
char *keyword;
|
||||||
char *whole_word_chars_left;
|
char *whole_word_chars_left;
|
||||||
char *whole_word_chars_right;
|
char *whole_word_chars_right;
|
||||||
long line_start;
|
gboolean line_start;
|
||||||
int color;
|
int color;
|
||||||
} syntax_keyword_t;
|
} syntax_keyword_t;
|
||||||
|
|
||||||
@ -107,9 +107,9 @@ typedef struct
|
|||||||
unsigned char first_left;
|
unsigned char first_left;
|
||||||
char *right;
|
char *right;
|
||||||
unsigned char first_right;
|
unsigned char first_right;
|
||||||
char line_start_left;
|
gboolean line_start_left;
|
||||||
char line_start_right;
|
gboolean line_start_right;
|
||||||
int between_delimiters;
|
gboolean between_delimiters;
|
||||||
char *whole_word_chars_left;
|
char *whole_word_chars_left;
|
||||||
char *whole_word_chars_right;
|
char *whole_word_chars_right;
|
||||||
char *keyword_first_chars;
|
char *keyword_first_chars;
|
||||||
@ -243,7 +243,7 @@ subst_defines (GTree * defines, char **argv, char **argv_end)
|
|||||||
|
|
||||||
static off_t
|
static off_t
|
||||||
compare_word_to_right (const WEdit * edit, off_t i, const char *text,
|
compare_word_to_right (const WEdit * edit, off_t i, const char *text,
|
||||||
const char *whole_left, const char *whole_right, long line_start)
|
const char *whole_left, const char *whole_right, gboolean line_start)
|
||||||
{
|
{
|
||||||
const unsigned char *p, *q;
|
const unsigned char *p, *q;
|
||||||
int c, d, j;
|
int c, d, j;
|
||||||
@ -252,7 +252,7 @@ compare_word_to_right (const WEdit * edit, off_t i, const char *text,
|
|||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
c = xx_tolower (edit, edit_buffer_get_byte (&edit->buffer, i - 1));
|
c = xx_tolower (edit, edit_buffer_get_byte (&edit->buffer, i - 1));
|
||||||
if ((line_start != 0 && c != '\n') || (whole_left != NULL && strchr (whole_left, c) != NULL))
|
if ((line_start && c != '\n') || (whole_left != NULL && strchr (whole_left, c) != NULL))
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
for (p = (const unsigned char *) text, q = p + strlen ((const char *) p); p < q; p++, i++)
|
for (p = (const unsigned char *) text, q = p + strlen ((const char *) p); p < q; p++, i++)
|
||||||
@ -1048,7 +1048,7 @@ edit_read_syntax_rules (WEdit * edit, FILE * f, char **args, int args_size)
|
|||||||
if (strcmp (*a, "exclusive") == 0)
|
if (strcmp (*a, "exclusive") == 0)
|
||||||
{
|
{
|
||||||
a++;
|
a++;
|
||||||
c->between_delimiters = 1;
|
c->between_delimiters = TRUE;
|
||||||
}
|
}
|
||||||
check_a;
|
check_a;
|
||||||
if (strcmp (*a, "whole") == 0)
|
if (strcmp (*a, "whole") == 0)
|
||||||
@ -1071,7 +1071,7 @@ edit_read_syntax_rules (WEdit * edit, FILE * f, char **args, int args_size)
|
|||||||
if (strcmp (*a, "linestart") == 0)
|
if (strcmp (*a, "linestart") == 0)
|
||||||
{
|
{
|
||||||
a++;
|
a++;
|
||||||
c->line_start_left = 1;
|
c->line_start_left = TRUE;
|
||||||
}
|
}
|
||||||
check_a;
|
check_a;
|
||||||
c->left = g_strdup (*a++);
|
c->left = g_strdup (*a++);
|
||||||
@ -1079,7 +1079,7 @@ edit_read_syntax_rules (WEdit * edit, FILE * f, char **args, int args_size)
|
|||||||
if (strcmp (*a, "linestart") == 0)
|
if (strcmp (*a, "linestart") == 0)
|
||||||
{
|
{
|
||||||
a++;
|
a++;
|
||||||
c->line_start_right = 1;
|
c->line_start_right = TRUE;
|
||||||
}
|
}
|
||||||
check_a;
|
check_a;
|
||||||
c->right = g_strdup (*a++);
|
c->right = g_strdup (*a++);
|
||||||
@ -1147,7 +1147,7 @@ edit_read_syntax_rules (WEdit * edit, FILE * f, char **args, int args_size)
|
|||||||
if (strcmp (*a, "linestart") == 0)
|
if (strcmp (*a, "linestart") == 0)
|
||||||
{
|
{
|
||||||
a++;
|
a++;
|
||||||
k->line_start = 1;
|
k->line_start = TRUE;
|
||||||
}
|
}
|
||||||
check_a;
|
check_a;
|
||||||
if (strcmp (*a, "whole") == 0)
|
if (strcmp (*a, "whole") == 0)
|
||||||
|
Loading…
Reference in New Issue
Block a user