mirror of
https://github.com/rkd77/elinks.git
synced 2024-12-04 14:46:47 -05:00
Names of enum constants should be in upper case.
Requested by Miciah.
This commit is contained in:
parent
40b6edc69d
commit
7809efa1b5
@ -495,6 +495,8 @@ Please write sizeof(something) instead of sizeof something.
|
||||
|
||||
Use assert() and assertm() where applicable. It will prevent hidden bugs.
|
||||
|
||||
Names of enum constants should be in upper case.
|
||||
|
||||
If you see code in ELinks that doesn't follow these rules, fix it or tell us
|
||||
about it.
|
||||
|
||||
|
@ -433,7 +433,7 @@ utf8_step_forward(unsigned char *string, unsigned char *end,
|
||||
end = strchr(string, '\0');
|
||||
|
||||
switch (way) {
|
||||
case utf8_step_characters:
|
||||
case UTF8_STEP_CHARACTERS:
|
||||
while (steps < max && current < end) {
|
||||
++current;
|
||||
if (utf8_islead(*current))
|
||||
@ -441,8 +441,8 @@ utf8_step_forward(unsigned char *string, unsigned char *end,
|
||||
}
|
||||
break;
|
||||
|
||||
case utf8_step_cells_fewer:
|
||||
case utf8_step_cells_more:
|
||||
case UTF8_STEP_CELLS_FEWER:
|
||||
case UTF8_STEP_CELLS_MORE:
|
||||
while (steps < max) {
|
||||
unicode_val_T u;
|
||||
unsigned char *prev = current;
|
||||
@ -458,7 +458,7 @@ utf8_step_forward(unsigned char *string, unsigned char *end,
|
||||
}
|
||||
|
||||
width = unicode_to_cell(u);
|
||||
if (way == utf8_step_cells_fewer
|
||||
if (way == UTF8_STEP_CELLS_FEWER
|
||||
&& steps + width > max) {
|
||||
/* Back off. */
|
||||
current = prev;
|
||||
@ -500,7 +500,7 @@ utf8_step_backward(unsigned char *string, unsigned char *start,
|
||||
if_assert_failed goto invalid_arg;
|
||||
|
||||
switch (way) {
|
||||
case utf8_step_characters:
|
||||
case UTF8_STEP_CHARACTERS:
|
||||
while (steps < max && current > start) {
|
||||
--current;
|
||||
if (utf8_islead(*current))
|
||||
@ -508,8 +508,8 @@ utf8_step_backward(unsigned char *string, unsigned char *start,
|
||||
}
|
||||
break;
|
||||
|
||||
case utf8_step_cells_fewer:
|
||||
case utf8_step_cells_more:
|
||||
case UTF8_STEP_CELLS_FEWER:
|
||||
case UTF8_STEP_CELLS_MORE:
|
||||
while (steps < max) {
|
||||
unsigned char *prev = current;
|
||||
unsigned char *look;
|
||||
@ -531,7 +531,7 @@ utf8_step_backward(unsigned char *string, unsigned char *start,
|
||||
} else
|
||||
width = unicode_to_cell(u);
|
||||
|
||||
if (way == utf8_step_cells_fewer
|
||||
if (way == UTF8_STEP_CELLS_FEWER
|
||||
&& steps + width > max) {
|
||||
/* Back off. */
|
||||
current = prev;
|
||||
|
@ -86,17 +86,17 @@ int utf8_cells2bytes(unsigned char *, int, unsigned char *);
|
||||
enum utf8_step {
|
||||
/* Each step is one character, even if it is a combining or
|
||||
* double-width character. */
|
||||
utf8_step_characters,
|
||||
UTF8_STEP_CHARACTERS,
|
||||
|
||||
/* Each step is one cell. If the specified number of steps
|
||||
* would end in the middle of a double-width character, do not
|
||||
* include the character. */
|
||||
utf8_step_cells_fewer,
|
||||
UTF8_STEP_CELLS_FEWER,
|
||||
|
||||
/* Each step is one cell. If the specified number of steps
|
||||
* would end in the middle of a double-width character,
|
||||
* include the whole character. */
|
||||
utf8_step_cells_more
|
||||
UTF8_STEP_CELLS_MORE
|
||||
};
|
||||
unsigned char *utf8_step_forward(unsigned char *, unsigned char *,
|
||||
int, enum utf8_step, int *);
|
||||
|
@ -462,8 +462,8 @@ drew_char:
|
||||
unsigned char *ptr = fs->value + fs->state;
|
||||
int cells = fc->size;
|
||||
enum utf8_step how = (fc->type == FC_PASSWORD)
|
||||
? utf8_step_characters
|
||||
: utf8_step_cells_fewer;
|
||||
? UTF8_STEP_CHARACTERS
|
||||
: UTF8_STEP_CELLS_FEWER;
|
||||
|
||||
/* The insertion point is at the right
|
||||
* side of the scrolled-visible part
|
||||
|
Loading…
Reference in New Issue
Block a user