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-20 19:16:14 +02:00
parent 1d54153ee0
commit df27579f54
4 changed files with 45 additions and 45 deletions

View File

@@ -1461,9 +1461,9 @@ static void create_windows(mparm_T *parmp)
did_emsg = FALSE; // avoid hit-enter prompt did_emsg = FALSE; // avoid hit-enter prompt
getout(1); getout(1);
} }
/* We can't close the window, it would disturb what // We can't close the window, it would disturb what
* happens next. Clear the file name and set the arg // happens next. Clear the file name and set the arg
* index to -1 to delete it later. */ // index to -1 to delete it later.
setfname(curbuf, NULL, NULL, false); setfname(curbuf, NULL, NULL, false);
curwin->w_arg_idx = -1; curwin->w_arg_idx = -1;
swap_exists_action = SEA_NONE; swap_exists_action = SEA_NONE;
@@ -1553,8 +1553,8 @@ static void edit_buffers(mparm_T *parmp, char_u *cwd)
// happen when vimrc contains ":sall"). // happen when vimrc contains ":sall").
if (curbuf == firstwin->w_buffer || curbuf->b_ffname == NULL) { if (curbuf == firstwin->w_buffer || curbuf->b_ffname == NULL) {
curwin->w_arg_idx = arg_idx; curwin->w_arg_idx = arg_idx;
/* Edit file from arg list, if there is one. When "Quit" selected // Edit file from arg list, if there is one. When "Quit" selected
* at the ATTENTION prompt close the window. */ // at the ATTENTION prompt close the window.
swap_exists_did_quit = false; swap_exists_did_quit = false;
(void)do_ecmd(0, arg_idx < GARGCOUNT (void)do_ecmd(0, arg_idx < GARGCOUNT
? alist_name(&GARGLIST[arg_idx]) : NULL, ? alist_name(&GARGLIST[arg_idx]) : NULL,

View File

@@ -675,16 +675,16 @@ static int utf_safe_read_char_adv(const char_u **s, size_t *n)
} }
if (k <= *n) { if (k <= *n) {
/* We have a multibyte sequence and it isn't truncated by buffer // We have a multibyte sequence and it isn't truncated by buffer
* limits so utf_ptr2char() is safe to use. Or the first byte is // limits so utf_ptr2char() is safe to use. Or the first byte is
* illegal (k=0), and it's also safe to use utf_ptr2char(). */ // illegal (k=0), and it's also safe to use utf_ptr2char().
c = utf_ptr2char(*s); c = utf_ptr2char(*s);
/* On failure, utf_ptr2char() returns the first byte, so here we // On failure, utf_ptr2char() returns the first byte, so here we
* check equality with the first byte. The only non-ASCII character // check equality with the first byte. The only non-ASCII character
* which equals the first byte of its own UTF-8 representation is // which equals the first byte of its own UTF-8 representation is
* U+00C3 (UTF-8: 0xC3 0x83), so need to check that special case too. // U+00C3 (UTF-8: 0xC3 0x83), so need to check that special case too.
* It's safe even if n=1, else we would have k=2 > n. */ // It's safe even if n=1, else we would have k=2 > n.
if (c != (int)(**s) || (c == 0xC3 && (*s)[1] == 0x83)) { if (c != (int)(**s) || (c == 0xC3 && (*s)[1] == 0x83)) {
// byte sequence was successfully decoded // byte sequence was successfully decoded
*s += k; *s += k;
@@ -1582,8 +1582,8 @@ void show_utf8(void)
int clen; int clen;
int i; int i;
/* Get the byte length of the char under the cursor, including composing // Get the byte length of the char under the cursor, including composing
* characters. */ // characters.
line = get_cursor_pos_ptr(); line = get_cursor_pos_ptr();
len = utfc_ptr2len(line); len = utfc_ptr2len(line);
if (len == 0) { if (len == 0) {
@@ -1625,8 +1625,8 @@ int utf_head_off(const char_u *base, const char_u *p)
return 0; return 0;
} }
/* Skip backwards over trailing bytes: 10xx.xxxx // Skip backwards over trailing bytes: 10xx.xxxx
* Skip backwards again if on a composing char. */ // Skip backwards again if on a composing char.
const char_u *q; const char_u *q;
for (q = p;; --q) { for (q = p;; --q) {
// Move s to the last byte of this char. // Move s to the last byte of this char.
@@ -1915,8 +1915,8 @@ void utf_find_illegal(void)
} }
while (*p != NUL) { while (*p != NUL) {
/* Illegal means that there are not enough trail bytes (checked by // Illegal means that there are not enough trail bytes (checked by
* utf_ptr2len()) or too many of them (overlong sequence). */ // utf_ptr2len()) or too many of them (overlong sequence).
len = utf_ptr2len(p); len = utf_ptr2len(p);
if (*p >= 0x80 && (len == 1 if (*p >= 0x80 && (len == 1
|| utf_char2len(utf_ptr2char(p)) != len)) { || utf_char2len(utf_ptr2char(p)) != len)) {

View File

@@ -106,8 +106,8 @@ struct pointer_block {
uint16_t pb_id; // ID for pointer block: PTR_ID uint16_t pb_id; // ID for pointer block: PTR_ID
uint16_t pb_count; // number of pointers in this block uint16_t pb_count; // number of pointers in this block
uint16_t pb_count_max; // maximum value for pb_count uint16_t pb_count_max; // maximum value for pb_count
PTR_EN pb_pointer[1]; /* list of pointers to blocks (actually longer) PTR_EN pb_pointer[1]; // list of pointers to blocks (actually longer)
* followed by empty space until end of page */ // followed by empty space until end of page
}; };
/* /*
@@ -1333,8 +1333,8 @@ int recover_names(char_u *fname, int list, int nr, char_u **fname_out)
if (dir_name[0] == '.' && dir_name[1] == NUL) { // check current dir if (dir_name[0] == '.' && dir_name[1] == NUL) { // check current dir
if (fname == NULL) { if (fname == NULL) {
names[0] = vim_strsave((char_u *)"*.sw?"); names[0] = vim_strsave((char_u *)"*.sw?");
/* For Unix names starting with a dot are special. MS-Windows // For Unix names starting with a dot are special. MS-Windows
* supports this too, on some file systems. */ // supports this too, on some file systems.
names[1] = vim_strsave((char_u *)".*.sw?"); names[1] = vim_strsave((char_u *)".*.sw?");
names[2] = vim_strsave((char_u *)".sw?"); names[2] = vim_strsave((char_u *)".sw?");
num_names = 3; num_names = 3;
@@ -1343,11 +1343,11 @@ int recover_names(char_u *fname, int list, int nr, char_u **fname_out)
} }
} else { // check directory dir_name } else { // check directory dir_name
if (fname == NULL) { if (fname == NULL) {
names[0] = (char_u *)concat_fnames((char *)dir_name, "*.sw?", TRUE); names[0] = (char_u *)concat_fnames((char *)dir_name, "*.sw?", true);
/* For Unix names starting with a dot are special. MS-Windows // For Unix names starting with a dot are special. MS-Windows
* supports this too, on some file systems. */ // supports this too, on some file systems.
names[1] = (char_u *)concat_fnames((char *)dir_name, ".*.sw?", TRUE); names[1] = (char_u *)concat_fnames((char *)dir_name, ".*.sw?", true);
names[2] = (char_u *)concat_fnames((char *)dir_name, ".sw?", TRUE); names[2] = (char_u *)concat_fnames((char *)dir_name, ".sw?", true);
num_names = 3; num_names = 3;
} else { } else {
int len = (int)STRLEN(dir_name); int len = (int)STRLEN(dir_name);
@@ -3377,8 +3377,8 @@ static void attention_message(buf_T *buf, char_u *fname)
MSG_PUTS(_(" NEWER than swap file!\n")); MSG_PUTS(_(" NEWER than swap file!\n"));
} }
} }
/* Some of these messages are long to allow translation to // Some of these messages are long to allow translation to
* other languages. */ // other languages.
MSG_PUTS(_("\n(1) Another program may be editing the same file. If this is" MSG_PUTS(_("\n(1) Another program may be editing the same file. If this is"
" the case,\n be careful not to end up with two different" " the case,\n be careful not to end up with two different"
" instances of the same\n file when making changes." " instances of the same\n file when making changes."
@@ -3551,7 +3551,7 @@ static char *findswapname(buf_T *buf, char **dirp, char *old_fname, bool *found_
} }
// give the ATTENTION message when there is an old swap file // give the ATTENTION message when there is an old swap file
// for the current file, and the buffer was not recovered. */ // for the current file, and the buffer was not recovered.
if (differ == false && !(curbuf->b_flags & BF_RECOVERED) if (differ == false && !(curbuf->b_flags & BF_RECOVERED)
&& vim_strchr(p_shm, SHM_ATTENTION) == NULL) { && vim_strchr(p_shm, SHM_ATTENTION) == NULL) {
int choice = 0; int choice = 0;

View File

@@ -305,8 +305,8 @@ static int add_menu_path(const char_u *const menu_path, vimmenu_T *menuarg,
parent = NULL; parent = NULL;
name = path_name; name = path_name;
while (*name) { while (*name) {
/* Get name of this element in the menu hierarchy, and the simplified // Get name of this element in the menu hierarchy, and the simplified
* name (without mnemonic and accelerator text). */ // name (without mnemonic and accelerator text).
next_name = menu_name_skip(name); next_name = menu_name_skip(name);
map_to = menutrans_lookup(name, (int)STRLEN(name)); map_to = menutrans_lookup(name, (int)STRLEN(name));
if (map_to != NULL) { if (map_to != NULL) {
@@ -481,8 +481,8 @@ erret:
xfree(path_name); xfree(path_name);
xfree(dname); xfree(dname);
/* Delete any empty submenu we added before discovering the error. Repeat // Delete any empty submenu we added before discovering the error. Repeat
* for higher levels. */ // for higher levels.
while (parent != NULL && parent->children == NULL) { while (parent != NULL && parent->children == NULL) {
if (parent->parent == NULL) { if (parent->parent == NULL) {
menup = root_menu_ptr; menup = root_menu_ptr;
@@ -650,8 +650,8 @@ static void free_menu(vimmenu_T **menup)
menu = *menup; menu = *menup;
/* Don't change *menup until after calling gui_mch_destroy_menu(). The // Don't change *menup until after calling gui_mch_destroy_menu(). The
* MacOS code needs the original structure to properly delete the menu. */ // MacOS code needs the original structure to properly delete the menu.
*menup = menu->next; *menup = menu->next;
xfree(menu->name); xfree(menu->name);
xfree(menu->dname); xfree(menu->dname);
@@ -1122,8 +1122,8 @@ char_u *get_menu_names(expand_T *xp, int idx)
should_advance = true; should_advance = true;
} }
} }
/* hack on menu separators: use a 'magic' char for the separator // hack on menu separators: use a 'magic' char for the separator
* so that '.' in names gets escaped properly */ // so that '.' in names gets escaped properly
STRCAT(tbuffer, "\001"); STRCAT(tbuffer, "\001");
str = tbuffer; str = tbuffer;
} else { } else {
@@ -1404,10 +1404,10 @@ static void execute_menu(const exarg_T *eap, vimmenu_T *menu)
mode = "Visual"; mode = "Visual";
idx = MENU_INDEX_VISUAL; idx = MENU_INDEX_VISUAL;
/* GEDDES: This is not perfect - but it is a // GEDDES: This is not perfect - but it is a
* quick way of detecting whether we are doing this from a // quick way of detecting whether we are doing this from a
* selection - see if the range matches up with the visual // selection - see if the range matches up with the visual
* select start and end. */ // select start and end.
if ((curbuf->b_visual.vi_start.lnum == eap->line1) if ((curbuf->b_visual.vi_start.lnum == eap->line1)
&& (curbuf->b_visual.vi_end.lnum) == eap->line2) { && (curbuf->b_visual.vi_end.lnum) == eap->line2) {
// Set it up for visual mode - equivalent to gv. // Set it up for visual mode - equivalent to gv.
@@ -1434,8 +1434,8 @@ static void execute_menu(const exarg_T *eap, vimmenu_T *menu)
check_cursor(); check_cursor();
/* Adjust the cursor to make sure it is in the correct pos // Adjust the cursor to make sure it is in the correct pos
* for exclusive mode */ // for exclusive mode
if (*p_sel == 'e' && gchar_cursor() != NUL) { if (*p_sel == 'e' && gchar_cursor() != NUL) {
curwin->w_cursor.col++; curwin->w_cursor.col++;
} }