aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/indent_c.c
diff options
context:
space:
mode:
authorDundar Göc <gocdundar@gmail.com>2022-08-26 23:11:25 +0200
committerDundar Göc <gocdundar@gmail.com>2022-08-29 15:48:56 +0200
commit58f30a326f34319801e7921f32c83e8320d85f6c (patch)
treec0afa78a82826ad837869b56dc3493b55d3b4195 /src/nvim/indent_c.c
parent92bc11a891538e5c306915bffef437f097572d09 (diff)
downloadrneovim-58f30a326f34319801e7921f32c83e8320d85f6c.tar.gz
rneovim-58f30a326f34319801e7921f32c83e8320d85f6c.tar.bz2
rneovim-58f30a326f34319801e7921f32c83e8320d85f6c.zip
refactor: replace char_u with char
Work on https://github.com/neovim/neovim/issues/459
Diffstat (limited to 'src/nvim/indent_c.c')
-rw-r--r--src/nvim/indent_c.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/src/nvim/indent_c.c b/src/nvim/indent_c.c
index 128eea915d..8ef6667374 100644
--- a/src/nvim/indent_c.c
+++ b/src/nvim/indent_c.c
@@ -212,16 +212,14 @@ int is_pos_in_string(const char_u *line, colnr_T col)
* Below "XXX" means that this function may unlock the current line.
*/
-/*
- * Return true if the string "line" starts with a word from 'cinwords'.
- */
-bool cin_is_cinword(const char_u *line)
+/// @return true if the string "line" starts with a word from 'cinwords'.
+bool cin_is_cinword(const char *line)
{
bool retval = false;
size_t cinw_len = STRLEN(curbuf->b_p_cinw) + 1;
char_u *cinw_buf = xmalloc(cinw_len);
- line = (char_u *)skipwhite((char *)line);
+ line = skipwhite((char *)line);
for (char *cinw = curbuf->b_p_cinw; *cinw;) {
size_t len = copy_option_part(&cinw, (char *)cinw_buf, cinw_len, ",");
@@ -2021,7 +2019,7 @@ int get_c_indent(void)
if (trypos == NULL && curwin->w_cursor.lnum > 1) {
// There may be a statement before the comment, search from the end
// of the line for a comment start.
- linecomment_pos.col = check_linecomment(ml_get(curwin->w_cursor.lnum - 1));
+ linecomment_pos.col = check_linecomment((char *)ml_get(curwin->w_cursor.lnum - 1));
if (linecomment_pos.col != MAXCOL) {
trypos = &linecomment_pos;
trypos->lnum = curwin->w_cursor.lnum - 1;
@@ -2854,7 +2852,7 @@ int get_c_indent(void)
if (n) {
amount = n;
l = after_label(get_cursor_line_ptr());
- if (l != NULL && cin_is_cinword(l)) {
+ if (l != NULL && cin_is_cinword((char *)l)) {
if (theline[0] == '{') {
amount += curbuf->b_ind_open_extra;
} else {
@@ -3108,7 +3106,7 @@ int get_c_indent(void)
* Check if we are after an "if", "while", etc.
* Also allow " } else".
*/
- if (cin_is_cinword(l) || cin_iselse((char_u *)skipwhite((char *)l))) {
+ if (cin_is_cinword((char *)l) || cin_iselse((char_u *)skipwhite((char *)l))) {
// Found an unterminated line after an if (), line up
// with the last one.
// if (cond)