Some typo fixes reported by Clang. This is tested on Linux (Alpine and Artix) and FreeBSD.
This commit is contained in:
parent
57719279c7
commit
2b043fbad0
1 changed files with 5 additions and 4 deletions
|
|
@ -85,7 +85,8 @@ static int starts_with_kw(const char *s, const char *kw) {
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Compute how many indentation levels (2 spaces per level) are still open.
|
/* Compute how many indentation levels (2 spaces per level) are still open.
|
||||||
* Only counts significant lines (non-blank, not comment-only), and ignores text inside /* ... *\/ block comments. */
|
* Only counts significant lines (non-blank, not comment-only),
|
||||||
|
* and ignores text inside \/* ... *\/ block comments. */
|
||||||
static int compute_open_indent_blocks(const char *buf) {
|
static int compute_open_indent_blocks(const char *buf) {
|
||||||
int in_block_comment = 0;
|
int in_block_comment = 0;
|
||||||
int open = 0;
|
int open = 0;
|
||||||
|
|
@ -131,7 +132,7 @@ static int compute_open_indent_blocks(const char *buf) {
|
||||||
/* // comment-only line */
|
/* // comment-only line */
|
||||||
continue;
|
continue;
|
||||||
} else if (t[1] == '*') {
|
} else if (t[1] == '*') {
|
||||||
/* /* start of block comment */
|
/* start of block comment */
|
||||||
in_block_comment = 1;
|
in_block_comment = 1;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
@ -157,8 +158,8 @@ static int compute_open_indent_blocks(const char *buf) {
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Detect if current buffer looks incomplete:
|
/* Detect if current buffer looks incomplete:
|
||||||
* - Unclosed quotes (' or ") with escapes
|
* - Unclosed quotes (\' or \") with escapes
|
||||||
* - Unclosed block comment /* ... *\/
|
* - Unclosed block comment \/* ... *\/
|
||||||
* - Parentheses not balanced
|
* - Parentheses not balanced
|
||||||
* - Last significant line is a block header (if/else/while/for/fun)
|
* - Last significant line is a block header (if/else/while/for/fun)
|
||||||
* - Line ends with an operator/comma
|
* - Line ends with an operator/comma
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue