aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/nvim/main.c6
-rw-r--r--src/nvim/mark.c34
-rw-r--r--src/nvim/mbyte.c30
-rw-r--r--src/nvim/memline.c52
-rw-r--r--src/nvim/menu.c8
5 files changed, 65 insertions, 65 deletions
diff --git a/src/nvim/main.c b/src/nvim/main.c
index 069c253bff..50ec6c1d88 100644
--- a/src/nvim/main.c
+++ b/src/nvim/main.c
@@ -583,9 +583,9 @@ void getout(int exitval)
{
exiting = true;
- /* When running in Ex mode an error causes us to exit with a non-zero exit
- * code. POSIX requires this, although it's not 100% clear from the
- * standard. */
+ // When running in Ex mode an error causes us to exit with a non-zero exit
+ // code. POSIX requires this, although it's not 100% clear from the
+ // standard.
if (exmode_active) {
exitval += ex_exitval;
}
diff --git a/src/nvim/mark.c b/src/nvim/mark.c
index edec85c0b2..2bbe2788d3 100644
--- a/src/nvim/mark.c
+++ b/src/nvim/mark.c
@@ -121,8 +121,8 @@ int setmark_pos(int c, pos_T *pos, int fnum)
return OK;
}
- /* Allow setting '[ and '] for an autocommand that simulates reading a
- * file. */
+ // Allow setting '[ and '] for an autocommand that simulates reading a
+ // file.
if (c == '[') {
buf->b_op_start = *pos;
return OK;
@@ -338,8 +338,8 @@ pos_T *getmark_buf_fnum(buf_T *buf, int c, bool changefile, int *fnum)
posp = NULL;
- /* Check for special key, can't be a mark name and might cause islower()
- * to crash. */
+ // Check for special key, can't be a mark name and might cause islower()
+ // to crash.
if (c < 0) {
return posp;
}
@@ -434,9 +434,9 @@ pos_T *getmark_buf_fnum(buf_T *buf, int c, bool changefile, int *fnum)
}
pos_copy.lnum = -1; // can't get file
} else {
- pos_copy.lnum = 0; /* mark exists, but is not valid in
- current buffer */
+ pos_copy.lnum = 0; // mark exists, but is not valid in
}
+ // current buffer
}
}
@@ -457,10 +457,10 @@ pos_T *getnextmark(pos_T *startpos, int dir, int begin_line)
pos = *startpos;
- /* When searching backward and leaving the cursor on the first non-blank,
- * position must be in a previous line.
- * When searching forward and leaving the cursor on the first non-blank,
- * position must be in a next line. */
+ // When searching backward and leaving the cursor on the first non-blank,
+ // position must be in a previous line.
+ // When searching forward and leaving the cursor on the first non-blank,
+ // position must be in a next line.
if (dir == BACKWARD && begin_line) {
pos.col = 0;
} else if (dir == FORWARD && begin_line) {
@@ -569,8 +569,8 @@ int check_mark(pos_T *pos)
return FAIL;
}
if (pos->lnum <= 0) {
- /* lnum is negative if mark is in another file can can't get that
- * file, error message already give then. */
+ // lnum is negative if mark is in another file can can't get that
+ // file, error message already give then.
if (pos->lnum == 0) {
EMSG(_(e_marknotset));
}
@@ -1057,9 +1057,9 @@ static void mark_adjust_internal(linenr_T line1, linenr_T line2, long amount, lo
*/
FOR_ALL_TAB_WINDOWS(tab, win) {
if (!cmdmod.lockmarks) {
- /* Marks in the jumplist. When deleting lines, this may create
- * duplicate marks in the jumplist, they will be removed later. */
- for (i = 0; i < win->w_jumplistlen; ++i) {
+ // Marks in the jumplist. When deleting lines, this may create
+ // duplicate marks in the jumplist, they will be removed later.
+ for (i = 0; i < win->w_jumplistlen; i++) {
if (win->w_jumplist[i].fmark.fnum == fnum) {
one_adjust_nodel(&(win->w_jumplist[i].fmark.mark.lnum));
}
@@ -1082,8 +1082,8 @@ static void mark_adjust_internal(linenr_T line1, linenr_T line2, long amount, lo
one_adjust_nodel(&(win->w_old_visual_lnum));
}
- /* topline and cursor position for windows with the same buffer
- * other than the current window */
+ // topline and cursor position for windows with the same buffer
+ // other than the current window
if (win != curwin) {
if (win->w_topline >= line1 && win->w_topline <= line2) {
if (amount == MAXLNUM) { // topline is deleted
diff --git a/src/nvim/mbyte.c b/src/nvim/mbyte.c
index 253ddfc253..62cc3b56ed 100644
--- a/src/nvim/mbyte.c
+++ b/src/nvim/mbyte.c
@@ -190,9 +190,9 @@ enc_canon_table[] =
#define IDX_BIG5 29
{ "big5", ENC_DBCS, DBCS_CHT },
- /* MS-DOS and MS-Windows codepages are included here, so that they can be
- * used on Unix too. Most of them are similar to ISO-8859 encodings, but
- * not exactly the same. */
+ // MS-DOS and MS-Windows codepages are included here, so that they can be
+ // used on Unix too. Most of them are similar to ISO-8859 encodings, but
+ // not exactly the same.
#define IDX_CP437 30
{ "cp437", ENC_8BIT, 437 }, // like iso-8859-1
#define IDX_CP737 31
@@ -1066,8 +1066,8 @@ bool utf_printable(int c)
*/
return iswprint(c);
#else
- /* Sorted list of non-overlapping intervals.
- * 0xd800-0xdfff is reserved for UTF-16, actually illegal. */
+ // Sorted list of non-overlapping intervals.
+ // 0xd800-0xdfff is reserved for UTF-16, actually illegal.
static struct interval nonprint[] =
{
{ 0x070f, 0x070f }, { 0x180b, 0x180e }, { 0x200b, 0x200f }, { 0x202a, 0x202e },
@@ -1354,12 +1354,12 @@ static int utf_strnicmp(const char_u *s1, const char_u *s2, size_t n1, size_t n2
return c1 == 0 ? -1 : 1;
}
- /* Continue with bytewise comparison to produce some result that
- * would make comparison operations involving this function transitive.
- *
- * If only one string had an error, comparison should be made with
- * folded version of the other string. In this case it is enough
- * to fold just one character to determine the result of comparison. */
+ // Continue with bytewise comparison to produce some result that
+ // would make comparison operations involving this function transitive.
+ //
+ // If only one string had an error, comparison should be made with
+ // folded version of the other string. In this case it is enough
+ // to fold just one character to determine the result of comparison.
if (c1 != -1 && c2 == -1) {
n1 = utf_char2bytes(utf_fold(c1), buffer);
@@ -1637,8 +1637,8 @@ int utf_head_off(const char_u *base, const char_u *p)
while (q > base && (*q & 0xc0) == 0x80) {
--q;
}
- /* Check for illegal sequence. Do allow an illegal byte after where we
- * started. */
+ // Check for illegal sequence. Do allow an illegal byte after where we
+ // started.
len = utf8len_tab[*q];
if (len != (int)(s - q + 1) && len != (int)(p - q + 1)) {
return 0;
@@ -2335,8 +2335,8 @@ static char_u *iconv_string(const vimconv_T *const vcp, char_u *str, size_t slen
fromlen = slen;
for (;; ) {
if (len == 0 || ICONV_ERRNO == ICONV_E2BIG) {
- /* Allocate enough room for most conversions. When re-allocating
- * increase the buffer size. */
+ // Allocate enough room for most conversions. When re-allocating
+ // increase the buffer size.
len = len + fromlen * 2 + 40;
p = xmalloc(len);
if (done > 0) {
diff --git a/src/nvim/memline.c b/src/nvim/memline.c
index 69598bbdda..9bc39f5e32 100644
--- a/src/nvim/memline.c
+++ b/src/nvim/memline.c
@@ -200,17 +200,17 @@ struct block0 {
*/
#define b0_flags b0_fname[B0_FNAME_SIZE_ORG - 2]
-/* The lowest two bits contain the fileformat. Zero means it's not set
- * (compatible with Vim 6.x), otherwise it's EOL_UNIX + 1, EOL_DOS + 1 or
- * EOL_MAC + 1. */
+// The lowest two bits contain the fileformat. Zero means it's not set
+// (compatible with Vim 6.x), otherwise it's EOL_UNIX + 1, EOL_DOS + 1 or
+// EOL_MAC + 1.
#define B0_FF_MASK 3
-/* Swap file is in directory of edited file. Used to find the file from
- * different mount points. */
+// Swap file is in directory of edited file. Used to find the file from
+// different mount points.
#define B0_SAME_DIR 4
-/* The 'fileencoding' is at the end of b0_fname[], with a NUL in front of it.
- * When empty there is only the NUL. */
+// The 'fileencoding' is at the end of b0_fname[], with a NUL in front of it.
+// When empty there is only the NUL.
#define B0_HAS_FENC 8
#define STACK_INCR 5 // nr of entries added to ml_stack at a time
@@ -524,9 +524,9 @@ void ml_open_file(buf_T *buf)
// Flush block zero, so others can read it
if (mf_sync(mfp, MFS_ZERO) == OK) {
- /* Mark all blocks that should be in the swapfile as dirty.
- * Needed for when the 'swapfile' option was reset, so that
- * the swap file was deleted, and then on again. */
+ // Mark all blocks that should be in the swapfile as dirty.
+ // Needed for when the 'swapfile' option was reset, so that
+ // the swap file was deleted, and then on again.
mf_set_dirty(mfp);
break;
}
@@ -580,8 +580,8 @@ void ml_close(buf_T *buf, int del_file)
XFREE_CLEAR(buf->b_ml.ml_chunksize);
buf->b_ml.ml_mfp = NULL;
- /* Reset the "recovered" flag, give the ATTENTION prompt the next time
- * this buffer is loaded. */
+ // Reset the "recovered" flag, give the ATTENTION prompt the next time
+ // this buffer is loaded.
buf->b_flags &= ~BF_RECOVERED;
}
@@ -860,8 +860,8 @@ void ml_recover(bool checkext)
/*
* open the memfile from the old swap file
*/
- p = vim_strsave(fname_used); /* save "fname_used" for the message:
- mf_open() will consume "fname_used"! */
+ p = vim_strsave(fname_used); // save "fname_used" for the message:
+ // mf_open() will consume "fname_used"!
mfp = mf_open(fname_used, O_RDONLY);
fname_used = p;
if (mfp == NULL || mfp->mf_fd < 0) {
@@ -1199,8 +1199,8 @@ void ml_recover(bool checkext)
* Line ml_line_count + 1 in the dummy empty line.
*/
if (orig_file_status != OK || curbuf->b_ml.ml_line_count != lnum * 2 + 1) {
- /* Recovering an empty file results in two lines and the first line is
- * empty. Don't set the modified flag then. */
+ // Recovering an empty file results in two lines and the first line is
+ // empty. Don't set the modified flag then.
if (!(curbuf->b_ml.ml_line_count == 2 && *ml_get(1) == NUL)) {
changed_internal();
buf_inc_changedtick(curbuf);
@@ -1306,8 +1306,8 @@ int recover_names(char_u *fname, int list, int nr, char_u **fname_out)
if (fname != NULL) {
#ifdef HAVE_READLINK
- /* Expand symlink in the file name, because the swap file is created
- * with the actual file instead of with the symlink. */
+ // Expand symlink in the file name, because the swap file is created
+ // with the actual file instead of with the symlink.
if (resolve_symlink(fname, fname_buf) == OK) {
fname_res = fname_buf;
} else
@@ -1762,9 +1762,9 @@ void ml_preserve(buf_T *buf, int message, bool do_fsync)
return;
}
- /* We only want to stop when interrupted here, not when interrupted
- * before. */
- got_int = FALSE;
+ // We only want to stop when interrupted here, not when interrupted
+ // before.
+ got_int = false;
ml_flush_line(buf); // flush buffered line
(void)ml_find_line(buf, (linenr_T)0, ML_FLUSH); // flush locked block
@@ -3224,9 +3224,9 @@ int resolve_symlink(const char_u *fname, char_u *buf)
ret = readlink((char *)tmp, (char *)buf, MAXPATHL - 1);
if (ret <= 0) {
if (errno == EINVAL || errno == ENOENT) {
- /* Found non-symlink or not existing file, stop here.
- * When at the first level use the unmodified name, skip the
- * call to vim_FullName(). */
+ // Found non-symlink or not existing file, stop here.
+ // When at the first level use the unmodified name, skip the
+ // call to vim_FullName().
if (depth == 1) {
return FAIL;
}
@@ -4202,8 +4202,8 @@ long ml_find_line_or_offset(buf_T *buf, linenr_T lnum, long *offp, bool no_ff)
size += lnum - 1;
}
- /* Don't count the last line break if 'noeol' and ('bin' or
- * 'nofixeol'). */
+ // Don't count the last line break if 'noeol' and ('bin' or
+ // 'nofixeol').
if ((!buf->b_p_fixeol || buf->b_p_bin) && !buf->b_p_eol
&& lnum > buf->b_ml.ml_line_count) {
size -= ffdos + 1;
diff --git a/src/nvim/menu.c b/src/nvim/menu.c
index de8503f9d0..acea557a6e 100644
--- a/src/nvim/menu.c
+++ b/src/nvim/menu.c
@@ -343,8 +343,8 @@ static int add_menu_path(const char_u *const menu_path, vimmenu_T *menuarg,
}
menup = &menu->next;
- /* Count menus, to find where this one needs to be inserted.
- * Ignore menus that are not in the menubar (PopUp and Toolbar) */
+ // Count menus, to find where this one needs to be inserted.
+ // Ignore menus that are not in the menubar (PopUp and Toolbar)
if (parent != NULL || menu_is_menubar(menu->name)) {
if (menu->priority <= pri_tab[pri_idx]) {
lower_pri = menup;
@@ -596,8 +596,8 @@ static int remove_menu(vimmenu_T **menup, char_u *name, int modes, bool silent)
break;
}
- /* Remove the menu item for the given mode[s]. If the menu item
- * is no longer valid in ANY mode, delete it */
+ // Remove the menu item for the given mode[s]. If the menu item
+ // is no longer valid in ANY mode, delete it
menu->modes &= ~modes;
if (modes & MENU_TIP_MODE) {
free_menu_string(menu, MENU_INDEX_TIP);