vim-patch:8.1.2366: using old C style comments

Problem:    Using old C style comments.
Solution:   Use // comments where appropriate.
9bf703d46a
This commit is contained in:
Jan Edmund Lazo
2020-03-21 12:15:04 -04:00
parent 81db53edec
commit 2ec6fec20b
7 changed files with 279 additions and 291 deletions

View File

@@ -23,26 +23,26 @@
#define NL '\012' #define NL '\012'
#define NL_STR "\012" #define NL_STR "\012"
#define FF '\014' #define FF '\014'
#define CAR '\015' /* CR is used by Mac OS X */ #define CAR '\015' // CR is used by Mac OS X
#define ESC '\033' #define ESC '\033'
#define ESC_STR "\033" #define ESC_STR "\033"
#define DEL 0x7f #define DEL 0x7f
#define DEL_STR "\177" #define DEL_STR "\177"
#define CSI 0x9b // Control Sequence Introducer #define CSI 0x9b // Control Sequence Introducer
#define CSI_STR "\233" #define CSI_STR "\233"
#define DCS 0x90 /* Device Control String */ #define DCS 0x90 // Device Control String
#define STERM 0x9c /* String Terminator */ #define STERM 0x9c // String Terminator
#define POUND 0xA3 #define POUND 0xA3
#define Ctrl_chr(x) (TOUPPER_ASC(x) ^ 0x40) /* '?' -> DEL, '@' -> ^@, etc. */ #define Ctrl_chr(x) (TOUPPER_ASC(x) ^ 0x40) // '?' -> DEL, '@' -> ^@, etc.
#define Meta(x) ((x) | 0x80) #define Meta(x) ((x) | 0x80)
#define CTRL_F_STR "\006" #define CTRL_F_STR "\006"
#define CTRL_H_STR "\010" #define CTRL_H_STR "\010"
#define CTRL_V_STR "\026" #define CTRL_V_STR "\026"
#define Ctrl_AT 0 /* @ */ #define Ctrl_AT 0 // @
#define Ctrl_A 1 #define Ctrl_A 1
#define Ctrl_B 2 #define Ctrl_B 2
#define Ctrl_C 3 #define Ctrl_C 3
@@ -69,16 +69,14 @@
#define Ctrl_X 24 #define Ctrl_X 24
#define Ctrl_Y 25 #define Ctrl_Y 25
#define Ctrl_Z 26 #define Ctrl_Z 26
/* CTRL- [ Left Square Bracket == ESC*/ // CTRL- [ Left Square Bracket == ESC
#define Ctrl_BSL 28 /* \ BackSLash */ #define Ctrl_BSL 28 // \ BackSLash
#define Ctrl_RSB 29 /* ] Right Square Bracket */ #define Ctrl_RSB 29 // ] Right Square Bracket
#define Ctrl_HAT 30 /* ^ */ #define Ctrl_HAT 30 // ^
#define Ctrl__ 31 #define Ctrl__ 31
/* // Character that separates dir names in a path.
* Character that separates dir names in a path.
*/
#ifdef BACKSLASH_IN_FILENAME #ifdef BACKSLASH_IN_FILENAME
# define PATHSEP psepc # define PATHSEP psepc
# define PATHSEPSTR pseps # define PATHSEPSTR pseps
@@ -168,4 +166,4 @@ static inline bool ascii_isspace(int c)
return (c >= 9 && c <= 13) || c == ' '; return (c >= 9 && c <= 13) || c == ' ';
} }
#endif /* NVIM_ASCII_H */ #endif // NVIM_ASCII_H

View File

@@ -67,14 +67,14 @@ typedef struct {
* off off w_botline not valid * off off w_botline not valid
* on off not possible * on off not possible
*/ */
#define VALID_WROW 0x01 /* w_wrow (window row) is valid */ #define VALID_WROW 0x01 // w_wrow (window row) is valid
#define VALID_WCOL 0x02 /* w_wcol (window col) is valid */ #define VALID_WCOL 0x02 // w_wcol (window col) is valid
#define VALID_VIRTCOL 0x04 /* w_virtcol (file col) is valid */ #define VALID_VIRTCOL 0x04 // w_virtcol (file col) is valid
#define VALID_CHEIGHT 0x08 /* w_cline_height and w_cline_folded valid */ #define VALID_CHEIGHT 0x08 // w_cline_height and w_cline_folded valid
#define VALID_CROW 0x10 /* w_cline_row is valid */ #define VALID_CROW 0x10 // w_cline_row is valid
#define VALID_BOTLINE 0x20 /* w_botine and w_empty_rows are valid */ #define VALID_BOTLINE 0x20 // w_botine and w_empty_rows are valid
#define VALID_BOTLINE_AP 0x40 /* w_botine is approximated */ #define VALID_BOTLINE_AP 0x40 // w_botine is approximated
#define VALID_TOPLINE 0x80 /* w_topline is valid (for cursor position) */ #define VALID_TOPLINE 0x80 // w_topline is valid (for cursor position)
// flags for b_flags // flags for b_flags
#define BF_RECOVERED 0x01 // buffer has been recovered #define BF_RECOVERED 0x01 // buffer has been recovered
@@ -92,7 +92,7 @@ typedef struct {
#define BF_DUMMY 0x80 // dummy buffer, only used internally #define BF_DUMMY 0x80 // dummy buffer, only used internally
#define BF_PRESERVED 0x100 // ":preserve" was used #define BF_PRESERVED 0x100 // ":preserve" was used
/* Mask to check for flags that prevent normal writing */ // Mask to check for flags that prevent normal writing
#define BF_WRITE_MASK (BF_NOTEDITED + BF_NEW + BF_READERR) #define BF_WRITE_MASK (BF_NOTEDITED + BF_NEW + BF_READERR)
typedef struct window_S win_T; typedef struct window_S win_T;
@@ -160,11 +160,11 @@ typedef struct
*/ */
typedef struct { typedef struct {
int wo_arab; int wo_arab;
# define w_p_arab w_onebuf_opt.wo_arab /* 'arabic' */ # define w_p_arab w_onebuf_opt.wo_arab // 'arabic'
int wo_bri; int wo_bri;
# define w_p_bri w_onebuf_opt.wo_bri // 'breakindent' # define w_p_bri w_onebuf_opt.wo_bri // 'breakindent'
char_u *wo_briopt; char_u *wo_briopt;
# define w_p_briopt w_onebuf_opt.wo_briopt /* 'breakindentopt' */ # define w_p_briopt w_onebuf_opt.wo_briopt // 'breakindentopt'
int wo_diff; int wo_diff;
# define w_p_diff w_onebuf_opt.wo_diff // 'diff' # define w_p_diff w_onebuf_opt.wo_diff // 'diff'
char_u *wo_fdc; char_u *wo_fdc;
@@ -172,78 +172,80 @@ typedef struct {
char_u *wo_fdc_save; char_u *wo_fdc_save;
# define w_p_fdc_save w_onebuf_opt.wo_fdc_save // 'fdc' saved for diff mode # define w_p_fdc_save w_onebuf_opt.wo_fdc_save // 'fdc' saved for diff mode
int wo_fen; int wo_fen;
# define w_p_fen w_onebuf_opt.wo_fen /* 'foldenable' */ # define w_p_fen w_onebuf_opt.wo_fen // 'foldenable'
int wo_fen_save; int wo_fen_save;
# define w_p_fen_save w_onebuf_opt.wo_fen_save /* 'foldenable' saved for diff mode */ // 'foldenable' saved for diff mode
# define w_p_fen_save w_onebuf_opt.wo_fen_save
char_u *wo_fdi; char_u *wo_fdi;
# define w_p_fdi w_onebuf_opt.wo_fdi /* 'foldignore' */ # define w_p_fdi w_onebuf_opt.wo_fdi // 'foldignore'
long wo_fdl; long wo_fdl;
# define w_p_fdl w_onebuf_opt.wo_fdl /* 'foldlevel' */ # define w_p_fdl w_onebuf_opt.wo_fdl // 'foldlevel'
int wo_fdl_save; int wo_fdl_save;
# define w_p_fdl_save w_onebuf_opt.wo_fdl_save /* 'foldlevel' state saved for diff mode */ // 'foldlevel' state saved for diff mode
# define w_p_fdl_save w_onebuf_opt.wo_fdl_save
char_u *wo_fdm; char_u *wo_fdm;
# define w_p_fdm w_onebuf_opt.wo_fdm /* 'foldmethod' */ # define w_p_fdm w_onebuf_opt.wo_fdm // 'foldmethod'
char_u *wo_fdm_save; char_u *wo_fdm_save;
# define w_p_fdm_save w_onebuf_opt.wo_fdm_save /* 'fdm' saved for diff mode */ # define w_p_fdm_save w_onebuf_opt.wo_fdm_save // 'fdm' saved for diff mode
long wo_fml; long wo_fml;
# define w_p_fml w_onebuf_opt.wo_fml /* 'foldminlines' */ # define w_p_fml w_onebuf_opt.wo_fml // 'foldminlines'
long wo_fdn; long wo_fdn;
# define w_p_fdn w_onebuf_opt.wo_fdn /* 'foldnestmax' */ # define w_p_fdn w_onebuf_opt.wo_fdn // 'foldnestmax'
char_u *wo_fde; char_u *wo_fde;
# define w_p_fde w_onebuf_opt.wo_fde /* 'foldexpr' */ # define w_p_fde w_onebuf_opt.wo_fde // 'foldexpr'
char_u *wo_fdt; char_u *wo_fdt;
# define w_p_fdt w_onebuf_opt.wo_fdt /* 'foldtext' */ # define w_p_fdt w_onebuf_opt.wo_fdt // 'foldtext'
char_u *wo_fmr; char_u *wo_fmr;
# define w_p_fmr w_onebuf_opt.wo_fmr /* 'foldmarker' */ # define w_p_fmr w_onebuf_opt.wo_fmr // 'foldmarker'
int wo_lbr; int wo_lbr;
# define w_p_lbr w_onebuf_opt.wo_lbr /* 'linebreak' */ # define w_p_lbr w_onebuf_opt.wo_lbr // 'linebreak'
int wo_list; int wo_list;
#define w_p_list w_onebuf_opt.wo_list /* 'list' */ #define w_p_list w_onebuf_opt.wo_list // 'list'
int wo_nu; int wo_nu;
#define w_p_nu w_onebuf_opt.wo_nu /* 'number' */ #define w_p_nu w_onebuf_opt.wo_nu // 'number'
int wo_rnu; int wo_rnu;
#define w_p_rnu w_onebuf_opt.wo_rnu /* 'relativenumber' */ #define w_p_rnu w_onebuf_opt.wo_rnu // 'relativenumber'
long wo_nuw; long wo_nuw;
# define w_p_nuw w_onebuf_opt.wo_nuw /* 'numberwidth' */ # define w_p_nuw w_onebuf_opt.wo_nuw // 'numberwidth'
int wo_wfh; int wo_wfh;
# define w_p_wfh w_onebuf_opt.wo_wfh /* 'winfixheight' */ # define w_p_wfh w_onebuf_opt.wo_wfh // 'winfixheight'
int wo_wfw; int wo_wfw;
# define w_p_wfw w_onebuf_opt.wo_wfw /* 'winfixwidth' */ # define w_p_wfw w_onebuf_opt.wo_wfw // 'winfixwidth'
int wo_pvw; int wo_pvw;
# define w_p_pvw w_onebuf_opt.wo_pvw /* 'previewwindow' */ # define w_p_pvw w_onebuf_opt.wo_pvw // 'previewwindow'
int wo_rl; int wo_rl;
# define w_p_rl w_onebuf_opt.wo_rl /* 'rightleft' */ # define w_p_rl w_onebuf_opt.wo_rl // 'rightleft'
char_u *wo_rlc; char_u *wo_rlc;
# define w_p_rlc w_onebuf_opt.wo_rlc /* 'rightleftcmd' */ # define w_p_rlc w_onebuf_opt.wo_rlc // 'rightleftcmd'
long wo_scr; long wo_scr;
#define w_p_scr w_onebuf_opt.wo_scr /* 'scroll' */ #define w_p_scr w_onebuf_opt.wo_scr // 'scroll'
int wo_spell; int wo_spell;
# define w_p_spell w_onebuf_opt.wo_spell /* 'spell' */ # define w_p_spell w_onebuf_opt.wo_spell // 'spell'
int wo_cuc; int wo_cuc;
# define w_p_cuc w_onebuf_opt.wo_cuc /* 'cursorcolumn' */ # define w_p_cuc w_onebuf_opt.wo_cuc // 'cursorcolumn'
int wo_cul; int wo_cul;
# define w_p_cul w_onebuf_opt.wo_cul /* 'cursorline' */ # define w_p_cul w_onebuf_opt.wo_cul // 'cursorline'
char_u *wo_cc; char_u *wo_cc;
# define w_p_cc w_onebuf_opt.wo_cc /* 'colorcolumn' */ # define w_p_cc w_onebuf_opt.wo_cc // 'colorcolumn'
char_u *wo_stl; char_u *wo_stl;
#define w_p_stl w_onebuf_opt.wo_stl /* 'statusline' */ #define w_p_stl w_onebuf_opt.wo_stl // 'statusline'
int wo_scb; int wo_scb;
# define w_p_scb w_onebuf_opt.wo_scb /* 'scrollbind' */ # define w_p_scb w_onebuf_opt.wo_scb // 'scrollbind'
int wo_diff_saved; /* options were saved for starting diff mode */ int wo_diff_saved; // options were saved for starting diff mode
# define w_p_diff_saved w_onebuf_opt.wo_diff_saved # define w_p_diff_saved w_onebuf_opt.wo_diff_saved
int wo_scb_save; /* 'scrollbind' saved for diff mode*/ int wo_scb_save; // 'scrollbind' saved for diff mode
# define w_p_scb_save w_onebuf_opt.wo_scb_save # define w_p_scb_save w_onebuf_opt.wo_scb_save
int wo_wrap; int wo_wrap;
#define w_p_wrap w_onebuf_opt.wo_wrap /* 'wrap' */ #define w_p_wrap w_onebuf_opt.wo_wrap // 'wrap'
int wo_wrap_save; /* 'wrap' state saved for diff mode*/ int wo_wrap_save; // 'wrap' state saved for diff mode
# define w_p_wrap_save w_onebuf_opt.wo_wrap_save # define w_p_wrap_save w_onebuf_opt.wo_wrap_save
char_u *wo_cocu; /* 'concealcursor' */ char_u *wo_cocu; // 'concealcursor'
# define w_p_cocu w_onebuf_opt.wo_cocu # define w_p_cocu w_onebuf_opt.wo_cocu
long wo_cole; /* 'conceallevel' */ long wo_cole; // 'conceallevel'
# define w_p_cole w_onebuf_opt.wo_cole # define w_p_cole w_onebuf_opt.wo_cole
int wo_crb; int wo_crb;
# define w_p_crb w_onebuf_opt.wo_crb /* 'cursorbind' */ # define w_p_crb w_onebuf_opt.wo_crb // 'cursorbind'
int wo_crb_save; /* 'cursorbind' state saved for diff mode*/ int wo_crb_save; // 'cursorbind' state saved for diff mode
# define w_p_crb_save w_onebuf_opt.wo_crb_save # define w_p_crb_save w_onebuf_opt.wo_crb_save
char_u *wo_scl; char_u *wo_scl;
# define w_p_scl w_onebuf_opt.wo_scl // 'signcolumn' # define w_p_scl w_onebuf_opt.wo_scl // 'signcolumn'
@@ -271,14 +273,14 @@ typedef struct {
* most-recently-used order. * most-recently-used order.
*/ */
struct wininfo_S { struct wininfo_S {
wininfo_T *wi_next; /* next entry or NULL for last entry */ wininfo_T *wi_next; // next entry or NULL for last entry
wininfo_T *wi_prev; /* previous entry or NULL for first entry */ wininfo_T *wi_prev; // previous entry or NULL for first entry
win_T *wi_win; /* pointer to window that did set wi_fpos */ win_T *wi_win; // pointer to window that did set wi_fpos
pos_T wi_fpos; /* last cursor position in the file */ pos_T wi_fpos; // last cursor position in the file
bool wi_optset; /* true when wi_opt has useful values */ bool wi_optset; // true when wi_opt has useful values
winopt_T wi_opt; /* local window options */ winopt_T wi_opt; // local window options
bool wi_fold_manual; /* copy of w_fold_manual */ bool wi_fold_manual; // copy of w_fold_manual
garray_T wi_folds; /* clone of w_folds */ garray_T wi_folds; // clone of w_folds
}; };
/* /*
@@ -288,8 +290,8 @@ struct wininfo_S {
* TODO: move struct arglist to another header * TODO: move struct arglist to another header
*/ */
typedef struct arglist { typedef struct arglist {
garray_T al_ga; /* growarray with the array of file names */ garray_T al_ga; // growarray with the array of file names
int al_refcount; /* number of windows using this arglist */ int al_refcount; // number of windows using this arglist
int id; ///< id of this arglist int id; ///< id of this arglist
} alist_T; } alist_T;
@@ -301,8 +303,8 @@ typedef struct arglist {
* TODO: move aentry_T to another header * TODO: move aentry_T to another header
*/ */
typedef struct argentry { typedef struct argentry {
char_u *ae_fname; /* file name as specified */ char_u *ae_fname; // file name as specified
int ae_fnum; /* buffer number with expanded file name */ int ae_fnum; // buffer number with expanded file name
} aentry_T; } aentry_T;
# define ALIST(win) (win)->w_alist # define ALIST(win) (win)->w_alist
@@ -318,21 +320,21 @@ typedef struct argentry {
* Used for the typeahead buffer: typebuf. * Used for the typeahead buffer: typebuf.
*/ */
typedef struct { typedef struct {
char_u *tb_buf; /* buffer for typed characters */ char_u *tb_buf; // buffer for typed characters
char_u *tb_noremap; /* mapping flags for characters in tb_buf[] */ char_u *tb_noremap; // mapping flags for characters in tb_buf[]
int tb_buflen; /* size of tb_buf[] */ int tb_buflen; // size of tb_buf[]
int tb_off; /* current position in tb_buf[] */ int tb_off; // current position in tb_buf[]
int tb_len; /* number of valid bytes in tb_buf[] */ int tb_len; // number of valid bytes in tb_buf[]
int tb_maplen; /* nr of mapped bytes in tb_buf[] */ int tb_maplen; // nr of mapped bytes in tb_buf[]
int tb_silent; /* nr of silently mapped bytes in tb_buf[] */ int tb_silent; // nr of silently mapped bytes in tb_buf[]
int tb_no_abbr_cnt; /* nr of bytes without abbrev. in tb_buf[] */ int tb_no_abbr_cnt; // nr of bytes without abbrev. in tb_buf[]
int tb_change_cnt; /* nr of time tb_buf was changed; never zero */ int tb_change_cnt; // nr of time tb_buf was changed; never zero
} typebuf_T; } typebuf_T;
/* Struct to hold the saved typeahead for save_typeahead(). */ // Struct to hold the saved typeahead for save_typeahead().
typedef struct { typedef struct {
typebuf_T save_typebuf; typebuf_T save_typebuf;
int typebuf_valid; /* TRUE when save_typebuf valid */ int typebuf_valid; // TRUE when save_typebuf valid
int old_char; int old_char;
int old_mod_mask; int old_mod_mask;
buffheader_T save_readbuf1; buffheader_T save_readbuf1;
@@ -363,15 +365,15 @@ struct mapblock {
*/ */
struct stl_hlrec { struct stl_hlrec {
char_u *start; char_u *start;
int userhl; /* 0: no HL, 1-9: User HL, < 0 for syn ID */ int userhl; // 0: no HL, 1-9: User HL, < 0 for syn ID
}; };
/* values for b_syn_spell: what to do with toplevel text */ // values for b_syn_spell: what to do with toplevel text
#define SYNSPL_DEFAULT 0 /* spell check if @Spell not defined */ #define SYNSPL_DEFAULT 0 // spell check if @Spell not defined
#define SYNSPL_TOP 1 /* spell check toplevel text */ #define SYNSPL_TOP 1 // spell check toplevel text
#define SYNSPL_NOTOP 2 /* don't spell check toplevel text */ #define SYNSPL_NOTOP 2 // don't spell check toplevel text
/* avoid #ifdefs for when b_spell is not available */ // avoid #ifdefs for when b_spell is not available
# define B_SPELL(buf) ((buf)->b_spell) # define B_SPELL(buf) ((buf)->b_spell)
typedef struct qf_info_S qf_info_T; typedef struct qf_info_S qf_info_T;
@@ -380,10 +382,10 @@ typedef struct qf_info_S qf_info_T;
* Used for :syntime: timing of executing a syntax pattern. * Used for :syntime: timing of executing a syntax pattern.
*/ */
typedef struct { typedef struct {
proftime_T total; /* total time used */ proftime_T total; // total time used
proftime_T slowest; /* time of slowest call */ proftime_T slowest; // time of slowest call
long count; /* nr of times used */ long count; // nr of times used
long match; /* nr of times matched */ long match; // nr of times matched
} syn_time_T; } syn_time_T;
/* /*
@@ -411,25 +413,23 @@ typedef struct {
char_u *b_syn_linecont_pat; // line continuation pattern char_u *b_syn_linecont_pat; // line continuation pattern
regprog_T *b_syn_linecont_prog; // line continuation program regprog_T *b_syn_linecont_prog; // line continuation program
syn_time_T b_syn_linecont_time; syn_time_T b_syn_linecont_time;
int b_syn_linecont_ic; /* ignore-case flag for above */ int b_syn_linecont_ic; // ignore-case flag for above
int b_syn_topgrp; /* for ":syntax include" */ int b_syn_topgrp; // for ":syntax include"
int b_syn_conceal; /* auto-conceal for :syn cmds */ int b_syn_conceal; // auto-conceal for :syn cmds
int b_syn_folditems; /* number of patterns with the HL_FOLD int b_syn_folditems; // number of patterns with the HL_FOLD
flag set */ // flag set
/* // b_sst_array[] contains the state stack for a number of lines, for the
* b_sst_array[] contains the state stack for a number of lines, for the // start of that line (col == 0). This avoids having to recompute the
* start of that line (col == 0). This avoids having to recompute the // syntax state too often.
* syntax state too often. // b_sst_array[] is allocated to hold the state for all displayed lines,
* b_sst_array[] is allocated to hold the state for all displayed lines, // and states for 1 out of about 20 other lines.
* and states for 1 out of about 20 other lines. // b_sst_array pointer to an array of synstate_T
* b_sst_array pointer to an array of synstate_T // b_sst_len number of entries in b_sst_array[]
* b_sst_len number of entries in b_sst_array[] // b_sst_first pointer to first used entry in b_sst_array[] or NULL
* b_sst_first pointer to first used entry in b_sst_array[] or NULL // b_sst_firstfree pointer to first free entry in b_sst_array[] or NULL
* b_sst_firstfree pointer to first free entry in b_sst_array[] or NULL // b_sst_freecount number of free entries in b_sst_array[]
* b_sst_freecount number of free entries in b_sst_array[] // b_sst_check_lnum entries after this lnum need to be checked for
* b_sst_check_lnum entries after this lnum need to be checked for // validity (MAXLNUM means no check needed)
* validity (MAXLNUM means no check needed)
*/
synstate_T *b_sst_array; synstate_T *b_sst_array;
int b_sst_len; int b_sst_len;
synstate_T *b_sst_first; synstate_T *b_sst_first;
@@ -488,10 +488,10 @@ struct file_buffer {
memline_T b_ml; // associated memline (also contains line count memline_T b_ml; // associated memline (also contains line count
buf_T *b_next; /* links in list of buffers */ buf_T *b_next; // links in list of buffers
buf_T *b_prev; buf_T *b_prev;
int b_nwindows; /* nr of windows open on this buffer */ int b_nwindows; // nr of windows open on this buffer
int b_flags; // various BF_ flags int b_flags; // various BF_ flags
int b_locked; // Buffer is being closed or referenced, don't int b_locked; // Buffer is being closed or referenced, don't
@@ -532,24 +532,23 @@ struct file_buffer {
*/ */
bool b_mod_set; /* true when there are changes since the last bool b_mod_set; /* true when there are changes since the last
time the display was updated */ time the display was updated */
linenr_T b_mod_top; /* topmost lnum that was changed */ linenr_T b_mod_top; // topmost lnum that was changed
linenr_T b_mod_bot; /* lnum below last changed line, AFTER the linenr_T b_mod_bot; // lnum below last changed line, AFTER the
change */ // change
long b_mod_xlines; /* number of extra buffer lines inserted; long b_mod_xlines; // number of extra buffer lines inserted;
negative when lines were deleted */ // negative when lines were deleted
wininfo_T *b_wininfo; // list of last used info for each window
wininfo_T *b_wininfo; /* list of last used info for each window */ long b_mtime; // last change time of original file
long b_mtime_read; // last change time when reading
uint64_t b_orig_size; // size of original file in bytes
int b_orig_mode; // mode of original file
long b_mtime; /* last change time of original file */ fmark_T b_namedm[NMARKS]; // current named marks (mark.c)
long b_mtime_read; /* last change time when reading */
uint64_t b_orig_size; /* size of original file in bytes */
int b_orig_mode; /* mode of original file */
fmark_T b_namedm[NMARKS]; /* current named marks (mark.c) */ // These variables are set when VIsual_active becomes FALSE
/* These variables are set when VIsual_active becomes FALSE */
visualinfo_T b_visual; visualinfo_T b_visual;
int b_visual_mode_eval; /* b_visual.vi_mode for visualmode() */ int b_visual_mode_eval; // b_visual.vi_mode for visualmode()
fmark_T b_last_cursor; // cursor position when last unloading this fmark_T b_last_cursor; // cursor position when last unloading this
// buffer // buffer
@@ -560,8 +559,8 @@ struct file_buffer {
* the changelist contains old change positions * the changelist contains old change positions
*/ */
fmark_T b_changelist[JUMPLISTSIZE]; fmark_T b_changelist[JUMPLISTSIZE];
int b_changelistlen; /* number of active entries */ int b_changelistlen; // number of active entries
bool b_new_change; /* set by u_savecommon() */ bool b_new_change; // set by u_savecommon()
/* /*
* Character table, only used in charset.c for 'iskeyword' * Character table, only used in charset.c for 'iskeyword'
@@ -572,9 +571,9 @@ struct file_buffer {
// Table used for mappings local to a buffer. // Table used for mappings local to a buffer.
mapblock_T *(b_maphash[MAX_MAPHASH]); mapblock_T *(b_maphash[MAX_MAPHASH]);
/* First abbreviation local to a buffer. */ // First abbreviation local to a buffer.
mapblock_T *b_first_abbr; mapblock_T *b_first_abbr;
/* User commands local to the buffer. */ // User commands local to the buffer.
garray_T b_ucmds; garray_T b_ucmds;
/* /*
* start and end of an operator, also used for '[ and '] * start and end of an operator, also used for '[ and ']
@@ -583,31 +582,31 @@ struct file_buffer {
pos_T b_op_start_orig; // used for Insstart_orig pos_T b_op_start_orig; // used for Insstart_orig
pos_T b_op_end; pos_T b_op_end;
bool b_marks_read; /* Have we read ShaDa marks yet? */ bool b_marks_read; // Have we read ShaDa marks yet?
/* /*
* The following only used in undo.c. * The following only used in undo.c.
*/ */
u_header_T *b_u_oldhead; /* pointer to oldest header */ u_header_T *b_u_oldhead; // pointer to oldest header
u_header_T *b_u_newhead; /* pointer to newest header; may not be valid u_header_T *b_u_newhead; // pointer to newest header; may not be valid
if b_u_curhead is not NULL */ // if b_u_curhead is not NULL
u_header_T *b_u_curhead; /* pointer to current header */ u_header_T *b_u_curhead; // pointer to current header
int b_u_numhead; /* current number of headers */ int b_u_numhead; // current number of headers
bool b_u_synced; /* entry lists are synced */ bool b_u_synced; // entry lists are synced
long b_u_seq_last; /* last used undo sequence number */ long b_u_seq_last; // last used undo sequence number
long b_u_save_nr_last; /* counter for last file write */ long b_u_save_nr_last; // counter for last file write
long b_u_seq_cur; /* hu_seq of header below which we are now */ long b_u_seq_cur; // hu_seq of header below which we are now
time_t b_u_time_cur; /* uh_time of header below which we are now */ time_t b_u_time_cur; // uh_time of header below which we are now
long b_u_save_nr_cur; /* file write nr after which we are now */ long b_u_save_nr_cur; // file write nr after which we are now
/* /*
* variables for "U" command in undo.c * variables for "U" command in undo.c
*/ */
char_u *b_u_line_ptr; /* saved line for "U" command */ char_u *b_u_line_ptr; // saved line for "U" command
linenr_T b_u_line_lnum; /* line number of line in u_line */ linenr_T b_u_line_lnum; // line number of line in u_line
colnr_T b_u_line_colnr; /* optional column number */ colnr_T b_u_line_colnr; // optional column number
bool b_scanned; /* ^N/^P have scanned this buffer */ bool b_scanned; // ^N/^P have scanned this buffer
// flags for use of ":lmap" and IM control // flags for use of ":lmap" and IM control
long b_p_iminsert; // input mode for insert long b_p_iminsert; // input mode for insert
@@ -617,10 +616,10 @@ struct file_buffer {
#define B_IMODE_LMAP 1 // Input via langmap #define B_IMODE_LMAP 1 // Input via langmap
# define B_IMODE_LAST 1 # define B_IMODE_LAST 1
short b_kmap_state; /* using "lmap" mappings */ int16_t b_kmap_state; // using "lmap" mappings
# define KEYMAP_INIT 1 /* 'keymap' was set, call keymap_init() */ # define KEYMAP_INIT 1 // 'keymap' was set, call keymap_init()
# define KEYMAP_LOADED 2 /* 'keymap' mappings have been loaded */ # define KEYMAP_LOADED 2 // 'keymap' mappings have been loaded
garray_T b_kmap_ga; /* the keymap table */ garray_T b_kmap_ga; // the keymap table
/* /*
* Options local to a buffer. * Options local to a buffer.
@@ -720,9 +719,9 @@ struct file_buffer {
int b_p_udf; ///< 'undofile' int b_p_udf; ///< 'undofile'
char_u *b_p_lw; ///< 'lispwords' local value char_u *b_p_lw; ///< 'lispwords' local value
/* end of buffer options */ // end of buffer options
/* values set from b_p_cino */ // values set from b_p_cino
int b_ind_level; int b_ind_level;
int b_ind_open_imag; int b_ind_open_imag;
int b_ind_no_brace; int b_ind_no_brace;
@@ -763,11 +762,11 @@ struct file_buffer {
linenr_T b_no_eol_lnum; /* non-zero lnum when last line of next binary linenr_T b_no_eol_lnum; /* non-zero lnum when last line of next binary
* write should not have an end-of-line */ * write should not have an end-of-line */
int b_start_eol; /* last line had eol when it was read */ int b_start_eol; // last line had eol when it was read
int b_start_ffc; /* first char of 'ff' when edit started */ int b_start_ffc; // first char of 'ff' when edit started
char_u *b_start_fenc; /* 'fileencoding' when edit started or NULL */ char_u *b_start_fenc; // 'fileencoding' when edit started or NULL
int b_bad_char; /* "++bad=" argument when edit started or 0 */ int b_bad_char; // "++bad=" argument when edit started or 0
int b_start_bomb; /* 'bomb' when it was read */ int b_start_bomb; // 'bomb' when it was read
ScopeDictDictItem b_bufvar; ///< Variable for "b:" Dictionary. ScopeDictDictItem b_bufvar; ///< Variable for "b:" Dictionary.
dict_T *b_vars; ///< b: scope dictionary. dict_T *b_vars; ///< b: scope dictionary.
@@ -866,8 +865,8 @@ struct file_buffer {
typedef struct diffblock_S diff_T; typedef struct diffblock_S diff_T;
struct diffblock_S { struct diffblock_S {
diff_T *df_next; diff_T *df_next;
linenr_T df_lnum[DB_COUNT]; /* line number in buffer */ linenr_T df_lnum[DB_COUNT]; // line number in buffer
linenr_T df_count[DB_COUNT]; /* nr of inserted/changed lines */ linenr_T df_count[DB_COUNT]; // nr of inserted/changed lines
}; };
#define SNAP_HELP_IDX 0 #define SNAP_HELP_IDX 0
@@ -915,11 +914,11 @@ struct tabpage_S {
* wl_lnum and wl_lastlnum are invalid too. * wl_lnum and wl_lastlnum are invalid too.
*/ */
typedef struct w_line { typedef struct w_line {
linenr_T wl_lnum; /* buffer line number for logical line */ linenr_T wl_lnum; // buffer line number for logical line
uint16_t wl_size; /* height in screen lines */ uint16_t wl_size; // height in screen lines
char wl_valid; /* TRUE values are valid for text in buffer */ char wl_valid; // TRUE values are valid for text in buffer
char wl_folded; /* TRUE when this is a range of folded lines */ char wl_folded; // TRUE when this is a range of folded lines
linenr_T wl_lastlnum; /* last buffer line number for logical line */ linenr_T wl_lastlnum; // last buffer line number for logical line
} wline_T; } wline_T;
/* /*
@@ -942,9 +941,9 @@ struct frame_S {
win_T *fr_win; // window that fills this frame win_T *fr_win; // window that fills this frame
}; };
#define FR_LEAF 0 /* frame is a leaf */ #define FR_LEAF 0 // frame is a leaf
#define FR_ROW 1 /* frame with a row of windows */ #define FR_ROW 1 // frame with a row of windows
#define FR_COL 2 /* frame with a column of windows */ #define FR_COL 2 // frame with a column of windows
/* /*
* Struct used for highlighting 'hlsearch' matches, matches defined by * Struct used for highlighting 'hlsearch' matches, matches defined by
@@ -1145,16 +1144,16 @@ struct window_S {
top of the window */ top of the window */
char w_topline_was_set; /* flag set to TRUE when topline is set, char w_topline_was_set; /* flag set to TRUE when topline is set,
e.g. by winrestview() */ e.g. by winrestview() */
int w_topfill; /* number of filler lines above w_topline */ int w_topfill; // number of filler lines above w_topline
int w_old_topfill; /* w_topfill at last redraw */ int w_old_topfill; // w_topfill at last redraw
bool w_botfill; /* true when filler lines are actually bool w_botfill; // true when filler lines are actually
below w_topline (at end of file) */ // below w_topline (at end of file)
bool w_old_botfill; /* w_botfill at last redraw */ bool w_old_botfill; // w_botfill at last redraw
colnr_T w_leftcol; /* window column number of the left most colnr_T w_leftcol; // window column number of the left most
character in the window; used when // character in the window; used when
'wrap' is off */ // 'wrap' is off
colnr_T w_skipcol; /* starting column when a single line colnr_T w_skipcol; // starting column when a single line
doesn't fit in the window */ // doesn't fit in the window
// //
// Layout of the window in the screen. // Layout of the window in the screen.
@@ -1188,7 +1187,7 @@ struct window_S {
int w_valid; int w_valid;
pos_T w_valid_cursor; /* last known position of w_cursor, used pos_T w_valid_cursor; /* last known position of w_cursor, used
to adjust w_valid */ to adjust w_valid */
colnr_T w_valid_leftcol; /* last known w_leftcol */ colnr_T w_valid_leftcol; // last known w_leftcol
bool w_viewport_invalid; bool w_viewport_invalid;
@@ -1196,10 +1195,10 @@ struct window_S {
* w_cline_height is the number of physical lines taken by the buffer line * w_cline_height is the number of physical lines taken by the buffer line
* that the cursor is on. We use this to avoid extra calls to plines(). * that the cursor is on. We use this to avoid extra calls to plines().
*/ */
int w_cline_height; /* current size of cursor line */ int w_cline_height; // current size of cursor line
bool w_cline_folded; /* cursor line is folded */ bool w_cline_folded; // cursor line is folded
int w_cline_row; /* starting row of the cursor line */ int w_cline_row; // starting row of the cursor line
colnr_T w_virtcol; // column number of the cursor in the colnr_T w_virtcol; // column number of the cursor in the
// buffer line, as opposed to the column // buffer line, as opposed to the column
@@ -1213,7 +1212,7 @@ struct window_S {
* This is related to positions in the window, not in the display or * This is related to positions in the window, not in the display or
* buffer, thus w_wrow is relative to w_winrow. * buffer, thus w_wrow is relative to w_winrow.
*/ */
int w_wrow, w_wcol; /* cursor position in window */ int w_wrow, w_wcol; // cursor position in window
linenr_T w_botline; // number of the line below the bottom of linenr_T w_botline; // number of the line below the bottom of
// the window // the window
@@ -1231,42 +1230,42 @@ struct window_S {
* what is currently displayed. wl_valid is reset to indicated this. * what is currently displayed. wl_valid is reset to indicated this.
* This is used for efficient redrawing. * This is used for efficient redrawing.
*/ */
int w_lines_valid; /* number of valid entries */ int w_lines_valid; // number of valid entries
wline_T *w_lines; wline_T *w_lines;
garray_T w_folds; /* array of nested folds */ garray_T w_folds; // array of nested folds
bool w_fold_manual; /* when true: some folds are opened/closed bool w_fold_manual; // when true: some folds are opened/closed
manually */ // manually
bool w_foldinvalid; /* when true: folding needs to be bool w_foldinvalid; // when true: folding needs to be
recomputed */ // recomputed
int w_nrwidth; /* width of 'number' and 'relativenumber' int w_nrwidth; // width of 'number' and 'relativenumber'
column being used */ // column being used
/* /*
* === end of cached values === * === end of cached values ===
*/ */
int w_redr_type; /* type of redraw to be performed on win */ int w_redr_type; // type of redraw to be performed on win
int w_upd_rows; /* number of window lines to update when int w_upd_rows; // number of window lines to update when
w_redr_type is REDRAW_TOP */ // w_redr_type is REDRAW_TOP
linenr_T w_redraw_top; /* when != 0: first line needing redraw */ linenr_T w_redraw_top; // when != 0: first line needing redraw
linenr_T w_redraw_bot; /* when != 0: last line needing redraw */ linenr_T w_redraw_bot; // when != 0: last line needing redraw
int w_redr_status; /* if TRUE status line must be redrawn */ int w_redr_status; // if TRUE status line must be redrawn
/* remember what is shown in the ruler for this window (if 'ruler' set) */ // remember what is shown in the ruler for this window (if 'ruler' set)
pos_T w_ru_cursor; /* cursor position shown in ruler */ pos_T w_ru_cursor; // cursor position shown in ruler
colnr_T w_ru_virtcol; /* virtcol shown in ruler */ colnr_T w_ru_virtcol; // virtcol shown in ruler
linenr_T w_ru_topline; /* topline shown in ruler */ linenr_T w_ru_topline; // topline shown in ruler
linenr_T w_ru_line_count; /* line count used for ruler */ linenr_T w_ru_line_count; // line count used for ruler
int w_ru_topfill; /* topfill shown in ruler */ int w_ru_topfill; // topfill shown in ruler
char w_ru_empty; /* TRUE if ruler shows 0-1 (empty line) */ char w_ru_empty; // TRUE if ruler shows 0-1 (empty line)
int w_alt_fnum; /* alternate file (for # and CTRL-^) */ int w_alt_fnum; // alternate file (for # and CTRL-^)
alist_T *w_alist; /* pointer to arglist for this window */ alist_T *w_alist; // pointer to arglist for this window
int w_arg_idx; /* current index in argument list (can be int w_arg_idx; // current index in argument list (can be
out of range!) */ // out of range!)
int w_arg_idx_invalid; /* editing another file than w_arg_idx */ int w_arg_idx_invalid; // editing another file than w_arg_idx
char_u *w_localdir; /* absolute path of local directory or char_u *w_localdir; /* absolute path of local directory or
NULL */ NULL */
@@ -1304,20 +1303,20 @@ struct window_S {
* a new line after setting the w_pcmark. If not, then we revert to * a new line after setting the w_pcmark. If not, then we revert to
* using the previous w_pcmark. * using the previous w_pcmark.
*/ */
pos_T w_pcmark; /* previous context mark */ pos_T w_pcmark; // previous context mark
pos_T w_prev_pcmark; /* previous w_pcmark */ pos_T w_prev_pcmark; // previous w_pcmark
/* /*
* the jumplist contains old cursor positions * the jumplist contains old cursor positions
*/ */
xfmark_T w_jumplist[JUMPLISTSIZE]; xfmark_T w_jumplist[JUMPLISTSIZE];
int w_jumplistlen; /* number of active entries */ int w_jumplistlen; // number of active entries
int w_jumplistidx; /* current position */ int w_jumplistidx; // current position
int w_changelistidx; /* current position in b_changelist */ int w_changelistidx; // current position in b_changelist
matchitem_T *w_match_head; /* head of match list */ matchitem_T *w_match_head; // head of match list
int w_next_match_id; /* next match ID */ int w_next_match_id; // next match ID
/* /*
* the tagstack grows from 0 upwards: * the tagstack grows from 0 upwards:
@@ -1325,9 +1324,9 @@ struct window_S {
* entry 1: newer * entry 1: newer
* entry 2: newest * entry 2: newest
*/ */
taggy_T w_tagstack[TAGSTACKSIZE]; /* the tag stack */ taggy_T w_tagstack[TAGSTACKSIZE]; // the tag stack
int w_tagstackidx; /* idx just below active entry */ int w_tagstackidx; // idx just below active entry
int w_tagstacklen; /* number of tags on stack */ int w_tagstacklen; // number of tags on stack
ScreenGrid w_grid; // the grid specific to the window ScreenGrid w_grid; // the grid specific to the window
bool w_pos_changed; // true if window position changed bool w_pos_changed; // true if window position changed
@@ -1345,13 +1344,11 @@ struct window_S {
linenr_T w_nrwidth_line_count; /* line count when ml_nrwidth_width linenr_T w_nrwidth_line_count; /* line count when ml_nrwidth_width
* was computed. */ * was computed. */
int w_nrwidth_width; /* nr of chars to print line count. */ int w_nrwidth_width; // nr of chars to print line count.
qf_info_T *w_llist; /* Location list for this window */ qf_info_T *w_llist; // Location list for this window
/* // Location list reference used in the location list window.
* Location list reference used in the location list window. // In a non-location list window, w_llist_ref is NULL.
* In a non-location list window, w_llist_ref is NULL.
*/
qf_info_T *w_llist_ref; qf_info_T *w_llist_ref;
}; };

View File

@@ -33,11 +33,11 @@ SHAPE_HOR = 1, ///< horizontal bar cursor
SHAPE_VER = 2 ///< vertical bar cursor SHAPE_VER = 2 ///< vertical bar cursor
} CursorShape; } CursorShape;
#define MSHAPE_NUMBERED 1000 /* offset for shapes identified by number */ #define MSHAPE_NUMBERED 1000 // offset for shapes identified by number
#define MSHAPE_HIDE 1 /* hide mouse pointer */ #define MSHAPE_HIDE 1 // hide mouse pointer
#define SHAPE_MOUSE 1 /* used for mouse pointer shape */ #define SHAPE_MOUSE 1 // used for mouse pointer shape
#define SHAPE_CURSOR 2 /* used for text cursor shape */ #define SHAPE_CURSOR 2 // used for text cursor shape
typedef struct cursor_entry { typedef struct cursor_entry {
char *full_name; ///< mode description char *full_name; ///< mode description

View File

@@ -1,19 +1,16 @@
#ifndef NVIM_IF_CSCOPE_DEFS_H #ifndef NVIM_IF_CSCOPE_DEFS_H
#define NVIM_IF_CSCOPE_DEFS_H #define NVIM_IF_CSCOPE_DEFS_H
/* // CSCOPE support for Vim added by Andy Kahn <kahn@zk3.dec.com>
* CSCOPE support for Vim added by Andy Kahn <kahn@zk3.dec.com> // Ported to Win32 by Sergey Khorev <sergey.khorev@gmail.com>
* Ported to Win32 by Sergey Khorev <sergey.khorev@gmail.com> //
* // The basic idea/structure of cscope for Vim was borrowed from Nvi.
* The basic idea/structure of cscope for Vim was borrowed from Nvi. // There might be a few lines of code that look similar to what Nvi
* There might be a few lines of code that look similar to what Nvi // has. If this is a problem and requires inclusion of the annoying
* has. If this is a problem and requires inclusion of the annoying // BSD license, then sue me; I'm not worth much anyway.
* BSD license, then sue me; I'm not worth much anyway.
*/
#if defined(UNIX) #if defined(UNIX)
# include <sys/types.h> /* pid_t */ # include <sys/types.h> // pid_t
#endif #endif
#include "nvim/os/os_defs.h" #include "nvim/os/os_defs.h"
@@ -33,13 +30,13 @@ typedef struct {
int (*func)(exarg_T *eap); int (*func)(exarg_T *eap);
char * help; char * help;
char * usage; char * usage;
int cansplit; /* if supports splitting window */ int cansplit; // if supports splitting window
} cscmd_T; } cscmd_T;
typedef struct csi { typedef struct csi {
char * fname; /* cscope db name */ char * fname; // cscope db name
char * ppath; /* path to prepend (the -P option) */ char * ppath; // path to prepend (the -P option)
char * flags; /* additional cscope flags/options (e.g, -p2) */ char * flags; // additional cscope flags/options (e.g, -p2)
#if defined(UNIX) #if defined(UNIX)
pid_t pid; // PID of the connected cscope process pid_t pid; // PID of the connected cscope process
#else #else
@@ -51,8 +48,8 @@ typedef struct csi {
#endif #endif
FileID file_id; FileID file_id;
FILE * fr_fp; /* from cscope: FILE. */ FILE * fr_fp; // from cscope: FILE.
FILE * to_fp; /* to cscope: FILE. */ FILE * to_fp; // to cscope: FILE.
} csinfo_T; } csinfo_T;
typedef enum { Add, Find, Help, Kill, Reset, Show } csid_e; typedef enum { Add, Find, Help, Kill, Reset, Show } csid_e;

View File

@@ -13,7 +13,7 @@
* For MSDOS some keys produce codes larger than 0xff. They are split into two * For MSDOS some keys produce codes larger than 0xff. They are split into two
* chars, the first one is K_NUL. * chars, the first one is K_NUL.
*/ */
#define K_NUL (0xce) /* for MSDOS: special key follows */ #define K_NUL (0xce) // for MSDOS: special key follows
/* /*
* K_SPECIAL is the first byte of a special key code and is always followed by * K_SPECIAL is the first byte of a special key code and is always followed by
@@ -78,13 +78,13 @@
#define KS_SELECT 245 #define KS_SELECT 245
#define K_SELECT_STRING (char_u *)"\200\365X" #define K_SELECT_STRING (char_u *)"\200\365X"
/* Used a termcap entry that produces a normal character. */ // Used a termcap entry that produces a normal character.
#define KS_KEY 242 #define KS_KEY 242
/* Used for click in a tab pages label. */ // Used for click in a tab pages label.
#define KS_TABLINE 240 #define KS_TABLINE 240
/* Used for menu in a tab pages line. */ // Used for menu in a tab pages line.
#define KS_TABMENU 239 #define KS_TABMENU 239
/* /*
@@ -274,13 +274,13 @@ enum key_extra {
#define K_TAB TERMCAP2KEY(KS_EXTRA, KE_TAB) #define K_TAB TERMCAP2KEY(KS_EXTRA, KE_TAB)
#define K_S_TAB TERMCAP2KEY('k', 'B') #define K_S_TAB TERMCAP2KEY('k', 'B')
/* extra set of function keys F1-F4, for vt100 compatible xterm */ // extra set of function keys F1-F4, for vt100 compatible xterm
#define K_XF1 TERMCAP2KEY(KS_EXTRA, KE_XF1) #define K_XF1 TERMCAP2KEY(KS_EXTRA, KE_XF1)
#define K_XF2 TERMCAP2KEY(KS_EXTRA, KE_XF2) #define K_XF2 TERMCAP2KEY(KS_EXTRA, KE_XF2)
#define K_XF3 TERMCAP2KEY(KS_EXTRA, KE_XF3) #define K_XF3 TERMCAP2KEY(KS_EXTRA, KE_XF3)
#define K_XF4 TERMCAP2KEY(KS_EXTRA, KE_XF4) #define K_XF4 TERMCAP2KEY(KS_EXTRA, KE_XF4)
/* extra set of cursor keys for vt100 compatible xterm */ // extra set of cursor keys for vt100 compatible xterm
#define K_XUP TERMCAP2KEY(KS_EXTRA, KE_XUP) #define K_XUP TERMCAP2KEY(KS_EXTRA, KE_XUP)
#define K_XDOWN TERMCAP2KEY(KS_EXTRA, KE_XDOWN) #define K_XDOWN TERMCAP2KEY(KS_EXTRA, KE_XDOWN)
#define K_XLEFT TERMCAP2KEY(KS_EXTRA, KE_XLEFT) #define K_XLEFT TERMCAP2KEY(KS_EXTRA, KE_XLEFT)
@@ -327,7 +327,7 @@ enum key_extra {
#define K_F36 TERMCAP2KEY('F', 'Q') #define K_F36 TERMCAP2KEY('F', 'Q')
#define K_F37 TERMCAP2KEY('F', 'R') #define K_F37 TERMCAP2KEY('F', 'R')
/* extra set of shifted function keys F1-F4, for vt100 compatible xterm */ // extra set of shifted function keys F1-F4, for vt100 compatible xterm
#define K_S_XF1 TERMCAP2KEY(KS_EXTRA, KE_S_XF1) #define K_S_XF1 TERMCAP2KEY(KS_EXTRA, KE_S_XF1)
#define K_S_XF2 TERMCAP2KEY(KS_EXTRA, KE_S_XF2) #define K_S_XF2 TERMCAP2KEY(KS_EXTRA, KE_S_XF2)
#define K_S_XF3 TERMCAP2KEY(KS_EXTRA, KE_S_XF3) #define K_S_XF3 TERMCAP2KEY(KS_EXTRA, KE_S_XF3)
@@ -346,7 +346,7 @@ enum key_extra {
#define K_S_F11 TERMCAP2KEY(KS_EXTRA, KE_S_F11) #define K_S_F11 TERMCAP2KEY(KS_EXTRA, KE_S_F11)
#define K_S_F12 TERMCAP2KEY(KS_EXTRA, KE_S_F12) #define K_S_F12 TERMCAP2KEY(KS_EXTRA, KE_S_F12)
/* K_S_F13 to K_S_F37 are currently not used */ // K_S_F13 to K_S_F37 are currently not used
#define K_HELP TERMCAP2KEY('%', '1') #define K_HELP TERMCAP2KEY('%', '1')
#define K_UNDO TERMCAP2KEY('&', '8') #define K_UNDO TERMCAP2KEY('&', '8')
@@ -443,8 +443,8 @@ enum key_extra {
#define K_EVENT TERMCAP2KEY(KS_EXTRA, KE_EVENT) #define K_EVENT TERMCAP2KEY(KS_EXTRA, KE_EVENT)
#define K_COMMAND TERMCAP2KEY(KS_EXTRA, KE_COMMAND) #define K_COMMAND TERMCAP2KEY(KS_EXTRA, KE_COMMAND)
/* Bits for modifier mask */ // Bits for modifier mask
/* 0x01 cannot be used, because the modifier must be 0x02 or higher */ // 0x01 cannot be used, because the modifier must be 0x02 or higher
#define MOD_MASK_SHIFT 0x02 #define MOD_MASK_SHIFT 0x02
#define MOD_MASK_CTRL 0x04 #define MOD_MASK_CTRL 0x04
#define MOD_MASK_ALT 0x08 // aka META #define MOD_MASK_ALT 0x08 // aka META

View File

@@ -36,38 +36,34 @@
#define BUFEMPTY() (curbuf->b_ml.ml_line_count == 1 && *ml_get((linenr_T)1) == \ #define BUFEMPTY() (curbuf->b_ml.ml_line_count == 1 && *ml_get((linenr_T)1) == \
NUL) NUL)
/* // toupper() and tolower() that use the current locale.
* toupper() and tolower() that use the current locale. // Careful: Only call TOUPPER_LOC() and TOLOWER_LOC() with a character in the
* Careful: Only call TOUPPER_LOC() and TOLOWER_LOC() with a character in the // range 0 - 255. toupper()/tolower() on some systems can't handle others.
* range 0 - 255. toupper()/tolower() on some systems can't handle others. // Note: It is often better to use mb_tolower() and mb_toupper(), because many
* Note: It is often better to use mb_tolower() and mb_toupper(), because many // toupper() and tolower() implementations only work for ASCII.
* toupper() and tolower() implementations only work for ASCII.
*/
#define TOUPPER_LOC toupper #define TOUPPER_LOC toupper
#define TOLOWER_LOC tolower #define TOLOWER_LOC tolower
/* toupper() and tolower() for ASCII only and ignore the current locale. */ // toupper() and tolower() for ASCII only and ignore the current locale.
# define TOUPPER_ASC(c) (((c) < 'a' || (c) > 'z') ? (c) : (c) - ('a' - 'A')) # define TOUPPER_ASC(c) (((c) < 'a' || (c) > 'z') ? (c) : (c) - ('a' - 'A'))
# define TOLOWER_ASC(c) (((c) < 'A' || (c) > 'Z') ? (c) : (c) + ('a' - 'A')) # define TOLOWER_ASC(c) (((c) < 'A' || (c) > 'Z') ? (c) : (c) + ('a' - 'A'))
/* Like isalpha() but reject non-ASCII characters. Can't be used with a // Like isalpha() but reject non-ASCII characters. Can't be used with a
* special key (negative value). */ // special key (negative value).
# define ASCII_ISLOWER(c) ((unsigned)(c) >= 'a' && (unsigned)(c) <= 'z') # define ASCII_ISLOWER(c) ((unsigned)(c) >= 'a' && (unsigned)(c) <= 'z')
# define ASCII_ISUPPER(c) ((unsigned)(c) >= 'A' && (unsigned)(c) <= 'Z') # define ASCII_ISUPPER(c) ((unsigned)(c) >= 'A' && (unsigned)(c) <= 'Z')
# define ASCII_ISALPHA(c) (ASCII_ISUPPER(c) || ASCII_ISLOWER(c)) # define ASCII_ISALPHA(c) (ASCII_ISUPPER(c) || ASCII_ISLOWER(c))
# define ASCII_ISALNUM(c) (ASCII_ISALPHA(c) || ascii_isdigit(c)) # define ASCII_ISALNUM(c) (ASCII_ISALPHA(c) || ascii_isdigit(c))
/* Returns empty string if it is NULL. */ // Returns empty string if it is NULL.
#define EMPTY_IF_NULL(x) ((x) ? (x) : (char_u *)"") #define EMPTY_IF_NULL(x) ((x) ? (x) : (char_u *)"")
/* // Adjust chars in a language according to 'langmap' option.
* Adjust chars in a language according to 'langmap' option. // NOTE that there is no noticeable overhead if 'langmap' is not set.
* NOTE that there is no noticeable overhead if 'langmap' is not set. // When set the overhead for characters < 256 is small.
* When set the overhead for characters < 256 is small. // Don't apply 'langmap' if the character comes from the Stuff buffer or from a
* Don't apply 'langmap' if the character comes from the Stuff buffer or from a // mapping and the langnoremap option was set.
* mapping and the langnoremap option was set. // The do-while is just to ignore a ';' after the macro.
* The do-while is just to ignore a ';' after the macro.
*/
# define LANGMAP_ADJUST(c, condition) \ # define LANGMAP_ADJUST(c, condition) \
do { \ do { \
if (*p_langmap \ if (*p_langmap \
@@ -83,12 +79,12 @@
} \ } \
} while (0) } while (0)
#define WRITEBIN "wb" /* no CR-LF translation */ #define WRITEBIN "wb" // no CR-LF translation
#define READBIN "rb" #define READBIN "rb"
#define APPENDBIN "ab" #define APPENDBIN "ab"
/* mch_open_rw(): invoke os_open() with third argument for user R/W. */ // mch_open_rw(): invoke os_open() with third argument for user R/W.
#if defined(UNIX) /* open in rw------- mode */ #if defined(UNIX) // open in rw------- mode
# define mch_open_rw(n, f) os_open((n), (f), (mode_t)0600) # define mch_open_rw(n, f) os_open((n), (f), (mode_t)0600)
#elif defined(WIN32) #elif defined(WIN32)
# define mch_open_rw(n, f) os_open((n), (f), S_IREAD | S_IWRITE) # define mch_open_rw(n, f) os_open((n), (f), S_IREAD | S_IWRITE)
@@ -100,7 +96,7 @@
# define UTF_COMPOSINGLIKE(p1, p2) utf_composinglike((p1), (p2)) # define UTF_COMPOSINGLIKE(p1, p2) utf_composinglike((p1), (p2))
/* Whether to draw the vertical bar on the right side of the cell. */ // Whether to draw the vertical bar on the right side of the cell.
# define CURSOR_BAR_RIGHT (curwin->w_p_rl && (!(State & CMDLINE) || cmdmsg_rl)) # define CURSOR_BAR_RIGHT (curwin->w_p_rl && (!(State & CMDLINE) || cmdmsg_rl))
// MB_PTR_ADV(): advance a pointer to the next character, taking care of // MB_PTR_ADV(): advance a pointer to the next character, taking care of

View File

@@ -91,7 +91,7 @@ typedef struct {
char_u *regmust; char_u *regmust;
int regmlen; int regmlen;
char_u reghasz; char_u reghasz;
char_u program[1]; /* actually longer.. */ char_u program[1]; // actually longer..
} bt_regprog_T; } bt_regprog_T;
// Structure representing a NFA state. // Structure representing a NFA state.
@@ -102,7 +102,7 @@ struct nfa_state {
nfa_state_T *out; nfa_state_T *out;
nfa_state_T *out1; nfa_state_T *out1;
int id; int id;
int lastlist[2]; /* 0: normal, 1: recursive */ int lastlist[2]; // 0: normal, 1: recursive
int val; int val;
}; };
@@ -116,19 +116,19 @@ typedef struct {
unsigned re_engine; unsigned re_engine;
unsigned re_flags; ///< Second argument for vim_regcomp(). unsigned re_flags; ///< Second argument for vim_regcomp().
nfa_state_T *start; /* points into state[] */ nfa_state_T *start; // points into state[]
int reganch; /* pattern starts with ^ */ int reganch; // pattern starts with ^
int regstart; /* char at start of pattern */ int regstart; // char at start of pattern
char_u *match_text; /* plain text to match with */ char_u *match_text; // plain text to match with
int has_zend; /* pattern contains \ze */ int has_zend; // pattern contains \ze
int has_backref; /* pattern contains \1 .. \9 */ int has_backref; // pattern contains \1 .. \9
int reghasz; int reghasz;
char_u *pattern; char_u *pattern;
int nsubexp; /* number of () */ int nsubexp; // number of ()
int nstate; int nstate;
nfa_state_T state[1]; /* actually longer.. */ nfa_state_T state[1]; // actually longer..
} nfa_regprog_T; } nfa_regprog_T;
/* /*