vim-patch:8.1.2388: using old C style comments

Problem:    Using old C style comments.
Solution:   Use // comments where appropriate.
4ba37b5833
This commit is contained in:
Dundar Göc 2021-10-06 10:50:53 +02:00
parent 86f32dfcdd
commit 3b3e2244db
5 changed files with 65 additions and 65 deletions

View File

@ -583,9 +583,9 @@ void getout(int exitval)
{ {
exiting = true; exiting = true;
/* When running in Ex mode an error causes us to exit with a non-zero exit // 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 // code. POSIX requires this, although it's not 100% clear from the
* standard. */ // standard.
if (exmode_active) { if (exmode_active) {
exitval += ex_exitval; exitval += ex_exitval;
} }

View File

@ -121,8 +121,8 @@ int setmark_pos(int c, pos_T *pos, int fnum)
return OK; return OK;
} }
/* Allow setting '[ and '] for an autocommand that simulates reading a // Allow setting '[ and '] for an autocommand that simulates reading a
* file. */ // file.
if (c == '[') { if (c == '[') {
buf->b_op_start = *pos; buf->b_op_start = *pos;
return OK; return OK;
@ -338,8 +338,8 @@ pos_T *getmark_buf_fnum(buf_T *buf, int c, bool changefile, int *fnum)
posp = NULL; posp = NULL;
/* Check for special key, can't be a mark name and might cause islower() // Check for special key, can't be a mark name and might cause islower()
* to crash. */ // to crash.
if (c < 0) { if (c < 0) {
return posp; 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 pos_copy.lnum = -1; // can't get file
} else { } else {
pos_copy.lnum = 0; /* mark exists, but is not valid in pos_copy.lnum = 0; // mark exists, but is not valid in
current buffer */
} }
// current buffer
} }
} }
@ -457,10 +457,10 @@ pos_T *getnextmark(pos_T *startpos, int dir, int begin_line)
pos = *startpos; pos = *startpos;
/* When searching backward and leaving the cursor on the first non-blank, // When searching backward and leaving the cursor on the first non-blank,
* position must be in a previous line. // position must be in a previous line.
* When searching forward and leaving the cursor on the first non-blank, // When searching forward and leaving the cursor on the first non-blank,
* position must be in a next line. */ // position must be in a next line.
if (dir == BACKWARD && begin_line) { if (dir == BACKWARD && begin_line) {
pos.col = 0; pos.col = 0;
} else if (dir == FORWARD && begin_line) { } else if (dir == FORWARD && begin_line) {
@ -569,8 +569,8 @@ int check_mark(pos_T *pos)
return FAIL; return FAIL;
} }
if (pos->lnum <= 0) { if (pos->lnum <= 0) {
/* lnum is negative if mark is in another file can can't get that // lnum is negative if mark is in another file can can't get that
* file, error message already give then. */ // file, error message already give then.
if (pos->lnum == 0) { if (pos->lnum == 0) {
EMSG(_(e_marknotset)); 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) { FOR_ALL_TAB_WINDOWS(tab, win) {
if (!cmdmod.lockmarks) { if (!cmdmod.lockmarks) {
/* Marks in the jumplist. When deleting lines, this may create // Marks in the jumplist. When deleting lines, this may create
* duplicate marks in the jumplist, they will be removed later. */ // duplicate marks in the jumplist, they will be removed later.
for (i = 0; i < win->w_jumplistlen; ++i) { for (i = 0; i < win->w_jumplistlen; i++) {
if (win->w_jumplist[i].fmark.fnum == fnum) { if (win->w_jumplist[i].fmark.fnum == fnum) {
one_adjust_nodel(&(win->w_jumplist[i].fmark.mark.lnum)); 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)); one_adjust_nodel(&(win->w_old_visual_lnum));
} }
/* topline and cursor position for windows with the same buffer // topline and cursor position for windows with the same buffer
* other than the current window */ // other than the current window
if (win != curwin) { if (win != curwin) {
if (win->w_topline >= line1 && win->w_topline <= line2) { if (win->w_topline >= line1 && win->w_topline <= line2) {
if (amount == MAXLNUM) { // topline is deleted if (amount == MAXLNUM) { // topline is deleted

View File

@ -190,9 +190,9 @@ enc_canon_table[] =
#define IDX_BIG5 29 #define IDX_BIG5 29
{ "big5", ENC_DBCS, DBCS_CHT }, { "big5", ENC_DBCS, DBCS_CHT },
/* MS-DOS and MS-Windows codepages are included here, so that they can be // 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 // used on Unix too. Most of them are similar to ISO-8859 encodings, but
* not exactly the same. */ // not exactly the same.
#define IDX_CP437 30 #define IDX_CP437 30
{ "cp437", ENC_8BIT, 437 }, // like iso-8859-1 { "cp437", ENC_8BIT, 437 }, // like iso-8859-1
#define IDX_CP737 31 #define IDX_CP737 31
@ -1066,8 +1066,8 @@ bool utf_printable(int c)
*/ */
return iswprint(c); return iswprint(c);
#else #else
/* Sorted list of non-overlapping intervals. // Sorted list of non-overlapping intervals.
* 0xd800-0xdfff is reserved for UTF-16, actually illegal. */ // 0xd800-0xdfff is reserved for UTF-16, actually illegal.
static struct interval nonprint[] = static struct interval nonprint[] =
{ {
{ 0x070f, 0x070f }, { 0x180b, 0x180e }, { 0x200b, 0x200f }, { 0x202a, 0x202e }, { 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; return c1 == 0 ? -1 : 1;
} }
/* Continue with bytewise comparison to produce some result that // Continue with bytewise comparison to produce some result that
* would make comparison operations involving this function transitive. // would make comparison operations involving this function transitive.
* //
* If only one string had an error, comparison should be made with // If only one string had an error, comparison should be made with
* folded version of the other string. In this case it is enough // folded version of the other string. In this case it is enough
* to fold just one character to determine the result of comparison. */ // to fold just one character to determine the result of comparison.
if (c1 != -1 && c2 == -1) { if (c1 != -1 && c2 == -1) {
n1 = utf_char2bytes(utf_fold(c1), buffer); 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) { while (q > base && (*q & 0xc0) == 0x80) {
--q; --q;
} }
/* Check for illegal sequence. Do allow an illegal byte after where we // Check for illegal sequence. Do allow an illegal byte after where we
* started. */ // started.
len = utf8len_tab[*q]; len = utf8len_tab[*q];
if (len != (int)(s - q + 1) && len != (int)(p - q + 1)) { if (len != (int)(s - q + 1) && len != (int)(p - q + 1)) {
return 0; return 0;
@ -2335,8 +2335,8 @@ static char_u *iconv_string(const vimconv_T *const vcp, char_u *str, size_t slen
fromlen = slen; fromlen = slen;
for (;; ) { for (;; ) {
if (len == 0 || ICONV_ERRNO == ICONV_E2BIG) { if (len == 0 || ICONV_ERRNO == ICONV_E2BIG) {
/* Allocate enough room for most conversions. When re-allocating // Allocate enough room for most conversions. When re-allocating
* increase the buffer size. */ // increase the buffer size.
len = len + fromlen * 2 + 40; len = len + fromlen * 2 + 40;
p = xmalloc(len); p = xmalloc(len);
if (done > 0) { if (done > 0) {

View File

@ -200,17 +200,17 @@ struct block0 {
*/ */
#define b0_flags b0_fname[B0_FNAME_SIZE_ORG - 2] #define b0_flags b0_fname[B0_FNAME_SIZE_ORG - 2]
/* The lowest two bits contain the fileformat. Zero means it's not set // 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 // (compatible with Vim 6.x), otherwise it's EOL_UNIX + 1, EOL_DOS + 1 or
* EOL_MAC + 1. */ // EOL_MAC + 1.
#define B0_FF_MASK 3 #define B0_FF_MASK 3
/* Swap file is in directory of edited file. Used to find the file from // Swap file is in directory of edited file. Used to find the file from
* different mount points. */ // different mount points.
#define B0_SAME_DIR 4 #define B0_SAME_DIR 4
/* The 'fileencoding' is at the end of b0_fname[], with a NUL in front of it. // The 'fileencoding' is at the end of b0_fname[], with a NUL in front of it.
* When empty there is only the NUL. */ // When empty there is only the NUL.
#define B0_HAS_FENC 8 #define B0_HAS_FENC 8
#define STACK_INCR 5 // nr of entries added to ml_stack at a time #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 // Flush block zero, so others can read it
if (mf_sync(mfp, MFS_ZERO) == OK) { if (mf_sync(mfp, MFS_ZERO) == OK) {
/* Mark all blocks that should be in the swapfile as dirty. // Mark all blocks that should be in the swapfile as dirty.
* Needed for when the 'swapfile' option was reset, so that // Needed for when the 'swapfile' option was reset, so that
* the swap file was deleted, and then on again. */ // the swap file was deleted, and then on again.
mf_set_dirty(mfp); mf_set_dirty(mfp);
break; break;
} }
@ -580,8 +580,8 @@ void ml_close(buf_T *buf, int del_file)
XFREE_CLEAR(buf->b_ml.ml_chunksize); XFREE_CLEAR(buf->b_ml.ml_chunksize);
buf->b_ml.ml_mfp = NULL; buf->b_ml.ml_mfp = NULL;
/* Reset the "recovered" flag, give the ATTENTION prompt the next time // Reset the "recovered" flag, give the ATTENTION prompt the next time
* this buffer is loaded. */ // this buffer is loaded.
buf->b_flags &= ~BF_RECOVERED; buf->b_flags &= ~BF_RECOVERED;
} }
@ -860,8 +860,8 @@ void ml_recover(bool checkext)
/* /*
* open the memfile from the old swap file * open the memfile from the old swap file
*/ */
p = vim_strsave(fname_used); /* save "fname_used" for the message: p = vim_strsave(fname_used); // save "fname_used" for the message:
mf_open() will consume "fname_used"! */ // mf_open() will consume "fname_used"!
mfp = mf_open(fname_used, O_RDONLY); mfp = mf_open(fname_used, O_RDONLY);
fname_used = p; fname_used = p;
if (mfp == NULL || mfp->mf_fd < 0) { 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. * Line ml_line_count + 1 in the dummy empty line.
*/ */
if (orig_file_status != OK || curbuf->b_ml.ml_line_count != lnum * 2 + 1) { 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 // Recovering an empty file results in two lines and the first line is
* empty. Don't set the modified flag then. */ // empty. Don't set the modified flag then.
if (!(curbuf->b_ml.ml_line_count == 2 && *ml_get(1) == NUL)) { if (!(curbuf->b_ml.ml_line_count == 2 && *ml_get(1) == NUL)) {
changed_internal(); changed_internal();
buf_inc_changedtick(curbuf); 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) { if (fname != NULL) {
#ifdef HAVE_READLINK #ifdef HAVE_READLINK
/* Expand symlink in the file name, because the swap file is created // Expand symlink in the file name, because the swap file is created
* with the actual file instead of with the symlink. */ // with the actual file instead of with the symlink.
if (resolve_symlink(fname, fname_buf) == OK) { if (resolve_symlink(fname, fname_buf) == OK) {
fname_res = fname_buf; fname_res = fname_buf;
} else } else
@ -1762,9 +1762,9 @@ void ml_preserve(buf_T *buf, int message, bool do_fsync)
return; return;
} }
/* We only want to stop when interrupted here, not when interrupted // We only want to stop when interrupted here, not when interrupted
* before. */ // before.
got_int = FALSE; got_int = false;
ml_flush_line(buf); // flush buffered line ml_flush_line(buf); // flush buffered line
(void)ml_find_line(buf, (linenr_T)0, ML_FLUSH); // flush locked block (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); ret = readlink((char *)tmp, (char *)buf, MAXPATHL - 1);
if (ret <= 0) { if (ret <= 0) {
if (errno == EINVAL || errno == ENOENT) { if (errno == EINVAL || errno == ENOENT) {
/* Found non-symlink or not existing file, stop here. // Found non-symlink or not existing file, stop here.
* When at the first level use the unmodified name, skip the // When at the first level use the unmodified name, skip the
* call to vim_FullName(). */ // call to vim_FullName().
if (depth == 1) { if (depth == 1) {
return FAIL; 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; size += lnum - 1;
} }
/* Don't count the last line break if 'noeol' and ('bin' or // Don't count the last line break if 'noeol' and ('bin' or
* 'nofixeol'). */ // 'nofixeol').
if ((!buf->b_p_fixeol || buf->b_p_bin) && !buf->b_p_eol if ((!buf->b_p_fixeol || buf->b_p_bin) && !buf->b_p_eol
&& lnum > buf->b_ml.ml_line_count) { && lnum > buf->b_ml.ml_line_count) {
size -= ffdos + 1; size -= ffdos + 1;

View File

@ -343,8 +343,8 @@ static int add_menu_path(const char_u *const menu_path, vimmenu_T *menuarg,
} }
menup = &menu->next; menup = &menu->next;
/* Count menus, to find where this one needs to be inserted. // Count menus, to find where this one needs to be inserted.
* Ignore menus that are not in the menubar (PopUp and Toolbar) */ // Ignore menus that are not in the menubar (PopUp and Toolbar)
if (parent != NULL || menu_is_menubar(menu->name)) { if (parent != NULL || menu_is_menubar(menu->name)) {
if (menu->priority <= pri_tab[pri_idx]) { if (menu->priority <= pri_tab[pri_idx]) {
lower_pri = menup; lower_pri = menup;
@ -596,8 +596,8 @@ static int remove_menu(vimmenu_T **menup, char_u *name, int modes, bool silent)
break; break;
} }
/* Remove the menu item for the given mode[s]. If the menu item // Remove the menu item for the given mode[s]. If the menu item
* is no longer valid in ANY mode, delete it */ // is no longer valid in ANY mode, delete it
menu->modes &= ~modes; menu->modes &= ~modes;
if (modes & MENU_TIP_MODE) { if (modes & MENU_TIP_MODE) {
free_menu_string(menu, MENU_INDEX_TIP); free_menu_string(menu, MENU_INDEX_TIP);