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.
|
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
|
If you see code in ELinks that doesn't follow these rules, fix it or tell us
|
||||||
about it.
|
about it.
|
||||||
|
|
||||||
|
@ -433,7 +433,7 @@ utf8_step_forward(unsigned char *string, unsigned char *end,
|
|||||||
end = strchr(string, '\0');
|
end = strchr(string, '\0');
|
||||||
|
|
||||||
switch (way) {
|
switch (way) {
|
||||||
case utf8_step_characters:
|
case UTF8_STEP_CHARACTERS:
|
||||||
while (steps < max && current < end) {
|
while (steps < max && current < end) {
|
||||||
++current;
|
++current;
|
||||||
if (utf8_islead(*current))
|
if (utf8_islead(*current))
|
||||||
@ -441,8 +441,8 @@ utf8_step_forward(unsigned char *string, unsigned char *end,
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case utf8_step_cells_fewer:
|
case UTF8_STEP_CELLS_FEWER:
|
||||||
case utf8_step_cells_more:
|
case UTF8_STEP_CELLS_MORE:
|
||||||
while (steps < max) {
|
while (steps < max) {
|
||||||
unicode_val_T u;
|
unicode_val_T u;
|
||||||
unsigned char *prev = current;
|
unsigned char *prev = current;
|
||||||
@ -458,7 +458,7 @@ utf8_step_forward(unsigned char *string, unsigned char *end,
|
|||||||
}
|
}
|
||||||
|
|
||||||
width = unicode_to_cell(u);
|
width = unicode_to_cell(u);
|
||||||
if (way == utf8_step_cells_fewer
|
if (way == UTF8_STEP_CELLS_FEWER
|
||||||
&& steps + width > max) {
|
&& steps + width > max) {
|
||||||
/* Back off. */
|
/* Back off. */
|
||||||
current = prev;
|
current = prev;
|
||||||
@ -500,7 +500,7 @@ utf8_step_backward(unsigned char *string, unsigned char *start,
|
|||||||
if_assert_failed goto invalid_arg;
|
if_assert_failed goto invalid_arg;
|
||||||
|
|
||||||
switch (way) {
|
switch (way) {
|
||||||
case utf8_step_characters:
|
case UTF8_STEP_CHARACTERS:
|
||||||
while (steps < max && current > start) {
|
while (steps < max && current > start) {
|
||||||
--current;
|
--current;
|
||||||
if (utf8_islead(*current))
|
if (utf8_islead(*current))
|
||||||
@ -508,8 +508,8 @@ utf8_step_backward(unsigned char *string, unsigned char *start,
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case utf8_step_cells_fewer:
|
case UTF8_STEP_CELLS_FEWER:
|
||||||
case utf8_step_cells_more:
|
case UTF8_STEP_CELLS_MORE:
|
||||||
while (steps < max) {
|
while (steps < max) {
|
||||||
unsigned char *prev = current;
|
unsigned char *prev = current;
|
||||||
unsigned char *look;
|
unsigned char *look;
|
||||||
@ -531,7 +531,7 @@ utf8_step_backward(unsigned char *string, unsigned char *start,
|
|||||||
} else
|
} else
|
||||||
width = unicode_to_cell(u);
|
width = unicode_to_cell(u);
|
||||||
|
|
||||||
if (way == utf8_step_cells_fewer
|
if (way == UTF8_STEP_CELLS_FEWER
|
||||||
&& steps + width > max) {
|
&& steps + width > max) {
|
||||||
/* Back off. */
|
/* Back off. */
|
||||||
current = prev;
|
current = prev;
|
||||||
|
@ -86,17 +86,17 @@ int utf8_cells2bytes(unsigned char *, int, unsigned char *);
|
|||||||
enum utf8_step {
|
enum utf8_step {
|
||||||
/* Each step is one character, even if it is a combining or
|
/* Each step is one character, even if it is a combining or
|
||||||
* double-width character. */
|
* double-width character. */
|
||||||
utf8_step_characters,
|
UTF8_STEP_CHARACTERS,
|
||||||
|
|
||||||
/* Each step is one cell. If the specified number of steps
|
/* Each step is one cell. If the specified number of steps
|
||||||
* would end in the middle of a double-width character, do not
|
* would end in the middle of a double-width character, do not
|
||||||
* include the character. */
|
* include the character. */
|
||||||
utf8_step_cells_fewer,
|
UTF8_STEP_CELLS_FEWER,
|
||||||
|
|
||||||
/* Each step is one cell. If the specified number of steps
|
/* Each step is one cell. If the specified number of steps
|
||||||
* would end in the middle of a double-width character,
|
* would end in the middle of a double-width character,
|
||||||
* include the whole character. */
|
* include the whole character. */
|
||||||
utf8_step_cells_more
|
UTF8_STEP_CELLS_MORE
|
||||||
};
|
};
|
||||||
unsigned char *utf8_step_forward(unsigned char *, unsigned char *,
|
unsigned char *utf8_step_forward(unsigned char *, unsigned char *,
|
||||||
int, enum utf8_step, int *);
|
int, enum utf8_step, int *);
|
||||||
|
@ -462,8 +462,8 @@ drew_char:
|
|||||||
unsigned char *ptr = fs->value + fs->state;
|
unsigned char *ptr = fs->value + fs->state;
|
||||||
int cells = fc->size;
|
int cells = fc->size;
|
||||||
enum utf8_step how = (fc->type == FC_PASSWORD)
|
enum utf8_step how = (fc->type == FC_PASSWORD)
|
||||||
? utf8_step_characters
|
? UTF8_STEP_CHARACTERS
|
||||||
: utf8_step_cells_fewer;
|
: UTF8_STEP_CELLS_FEWER;
|
||||||
|
|
||||||
/* The insertion point is at the right
|
/* The insertion point is at the right
|
||||||
* side of the scrolled-visible part
|
* side of the scrolled-visible part
|
||||||
|
Loading…
Reference in New Issue
Block a user