diff options
author | Bram Moolenaar <Bram@vim.org> | 2019-07-04 16:05:14 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2019-07-04 16:05:14 +0200 |
commit | 6cb39f924a10912a615573230e906e8089975198 (patch) | |
tree | be922586727211913970ab06a348240bff2ea6ba | |
parent | 5ca1ac373ae62b37152cb6f85916b402eda520a5 (diff) |
patch 8.1.1627: header file contains mixed comment stylev8.1.1627
Problem: Header file contains mixed comment style.
Solution: Use // style comments.
-rw-r--r-- | src/structs.h | 2429 | ||||
-rw-r--r-- | src/version.c | 2 |
2 files changed, 1220 insertions, 1211 deletions
diff --git a/src/structs.h b/src/structs.h index c3d75bddef..7fb8f22aa1 100644 --- a/src/structs.h +++ b/src/structs.h @@ -47,11 +47,11 @@ typedef struct */ typedef struct growarray { - int ga_len; /* current number of items used */ - int ga_maxlen; /* maximum number of items possible */ - int ga_itemsize; /* sizeof(item) */ - int ga_growsize; /* number of items to grow each time */ - void *ga_data; /* pointer to the first item */ + int ga_len; // current number of items used + int ga_maxlen; // maximum number of items possible + int ga_itemsize; // sizeof(item) + int ga_growsize; // number of items to grow each time + void *ga_data; // pointer to the first item } garray_T; #define GA_EMPTY {0, 0, 0, 0, NULL} @@ -59,8 +59,8 @@ typedef struct growarray typedef struct window_S win_T; typedef struct wininfo_S wininfo_T; typedef struct frame_S frame_T; -typedef int scid_T; /* script ID */ -typedef struct file_buffer buf_T; /* forward declaration */ +typedef int scid_T; // script ID +typedef struct file_buffer buf_T; // forward declaration typedef struct terminal_S term_T; #ifdef FEAT_MENU @@ -109,7 +109,7 @@ typedef struct { # endif # define guicolor_T long # define INVALCOLOR ((guicolor_T)0x1ffffff) - /* only used for cterm.bg_rgb and cterm.fg_rgb: use cterm color */ + // only used for cterm.bg_rgb and cterm.fg_rgb: use cterm color # define CTERMCOLOR ((guicolor_T)0x1fffffe) #endif #define COLOR_INVALID(x) ((x) == INVALCOLOR || (x) == CTERMCOLOR) @@ -119,24 +119,24 @@ typedef struct { * (a normal mark is a lnum/col pair, the same as a file position) */ -/* (Note: for EBCDIC there are more than 26, because there are gaps in the - * alphabet coding. To minimize changes to the code, I decided to just - * increase the number of possible marks. */ -#define NMARKS ('z' - 'a' + 1) /* max. # of named marks */ -#define JUMPLISTSIZE 100 /* max. # of marks in jump list */ -#define TAGSTACKSIZE 20 /* max. # of tags in tag stack */ +// (Note: for EBCDIC there are more than 26, because there are gaps in the +// alphabet coding. To minimize changes to the code, I decided to just +// increase the number of possible marks. +#define NMARKS ('z' - 'a' + 1) // max. # of named marks +#define JUMPLISTSIZE 100 // max. # of marks in jump list +#define TAGSTACKSIZE 20 // max. # of tags in tag stack typedef struct filemark { - pos_T mark; /* cursor position */ - int fnum; /* file number */ + pos_T mark; // cursor position + int fnum; // file number } fmark_T; -/* Xtended file mark: also has a file name */ +// Xtended file mark: also has a file name typedef struct xfilemark { fmark_T fmark; - char_u *fname; /* file name, used when fnum == 0 */ + char_u *fname; // file name, used when fnum == 0 #ifdef FEAT_VIMINFO time_T time_set; #endif @@ -179,117 +179,117 @@ typedef struct #endif #ifdef FEAT_FOLDING long wo_fdc; -# define w_p_fdc w_onebuf_opt.wo_fdc /* 'foldcolumn' */ +# define w_p_fdc w_onebuf_opt.wo_fdc // 'foldcolumn' int wo_fdc_save; -# define w_p_fdc_save w_onebuf_opt.wo_fdc_save /* 'foldenable' saved for diff mode */ +# define w_p_fdc_save w_onebuf_opt.wo_fdc_save // 'foldenable' saved for diff mode 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; -# define w_p_fen_save w_onebuf_opt.wo_fen_save /* 'foldenable' saved for diff mode */ +# define w_p_fen_save w_onebuf_opt.wo_fen_save // 'foldenable' saved for diff mode 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; -# define w_p_fdl w_onebuf_opt.wo_fdl /* 'foldlevel' */ +# define w_p_fdl w_onebuf_opt.wo_fdl // 'foldlevel' int wo_fdl_save; -# define w_p_fdl_save w_onebuf_opt.wo_fdl_save /* 'foldlevel' state saved for diff mode */ +# define w_p_fdl_save w_onebuf_opt.wo_fdl_save // 'foldlevel' state saved for diff mode 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; -# 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; -# define w_p_fml w_onebuf_opt.wo_fml /* 'foldminlines' */ +# define w_p_fml w_onebuf_opt.wo_fml // 'foldminlines' long wo_fdn; -# define w_p_fdn w_onebuf_opt.wo_fdn /* 'foldnestmax' */ +# define w_p_fdn w_onebuf_opt.wo_fdn // 'foldnestmax' # ifdef FEAT_EVAL 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; -# define w_p_fdt w_onebuf_opt.wo_fdt /* 'foldtext' */ +# define w_p_fdt w_onebuf_opt.wo_fdt // 'foldtext' # endif char_u *wo_fmr; -# define w_p_fmr w_onebuf_opt.wo_fmr /* 'foldmarker' */ +# define w_p_fmr w_onebuf_opt.wo_fmr // 'foldmarker' #endif #ifdef FEAT_LINEBREAK int wo_lbr; -# define w_p_lbr w_onebuf_opt.wo_lbr /* 'linebreak' */ +# define w_p_lbr w_onebuf_opt.wo_lbr // 'linebreak' #endif 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; -#define w_p_nu w_onebuf_opt.wo_nu /* 'number' */ +#define w_p_nu w_onebuf_opt.wo_nu // 'number' int wo_rnu; -#define w_p_rnu w_onebuf_opt.wo_rnu /* 'relativenumber' */ +#define w_p_rnu w_onebuf_opt.wo_rnu // 'relativenumber' #ifdef FEAT_LINEBREAK long wo_nuw; -# define w_p_nuw w_onebuf_opt.wo_nuw /* 'numberwidth' */ +# define w_p_nuw w_onebuf_opt.wo_nuw // 'numberwidth' #endif 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; -# define w_p_wfw w_onebuf_opt.wo_wfw /* 'winfixwidth' */ +# define w_p_wfw w_onebuf_opt.wo_wfw // 'winfixwidth' #if defined(FEAT_QUICKFIX) int wo_pvw; -# define w_p_pvw w_onebuf_opt.wo_pvw /* 'previewwindow' */ +# define w_p_pvw w_onebuf_opt.wo_pvw // 'previewwindow' #endif #ifdef FEAT_RIGHTLEFT 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; -# define w_p_rlc w_onebuf_opt.wo_rlc /* 'rightleftcmd' */ +# define w_p_rlc w_onebuf_opt.wo_rlc // 'rightleftcmd' #endif long wo_scr; -#define w_p_scr w_onebuf_opt.wo_scr /* 'scroll' */ +#define w_p_scr w_onebuf_opt.wo_scr // 'scroll' #ifdef FEAT_SPELL int wo_spell; -# define w_p_spell w_onebuf_opt.wo_spell /* 'spell' */ +# define w_p_spell w_onebuf_opt.wo_spell // 'spell' #endif #ifdef FEAT_SYN_HL 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; -# define w_p_cul w_onebuf_opt.wo_cul /* 'cursorline' */ +# define w_p_cul w_onebuf_opt.wo_cul // 'cursorline' char_u *wo_cc; -# define w_p_cc w_onebuf_opt.wo_cc /* 'colorcolumn' */ +# define w_p_cc w_onebuf_opt.wo_cc // 'colorcolumn' #endif #ifdef FEAT_STL_OPT char_u *wo_stl; -#define w_p_stl w_onebuf_opt.wo_stl /* 'statusline' */ +#define w_p_stl w_onebuf_opt.wo_stl // 'statusline' #endif int wo_scb; -#define w_p_scb w_onebuf_opt.wo_scb /* 'scrollbind' */ - int wo_diff_saved; /* options were saved for starting diff mode */ +#define w_p_scb w_onebuf_opt.wo_scb // 'scrollbind' + int wo_diff_saved; // options were saved for starting diff mode #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 int wo_wrap; -#define w_p_wrap w_onebuf_opt.wo_wrap /* 'wrap' */ +#define w_p_wrap w_onebuf_opt.wo_wrap // 'wrap' #ifdef FEAT_DIFF - 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 #endif #ifdef FEAT_CONCEAL - char_u *wo_cocu; /* 'concealcursor' */ + char_u *wo_cocu; // 'concealcursor' # 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 #endif int wo_crb; -#define w_p_crb w_onebuf_opt.wo_crb /* 'cursorbind' */ - int wo_crb_save; /* 'cursorbind' state saved for diff mode*/ +#define w_p_crb w_onebuf_opt.wo_crb // 'cursorbind' + int wo_crb_save; // 'cursorbind' state saved for diff mode #define w_p_crb_save w_onebuf_opt.wo_crb_save #ifdef FEAT_SIGNS char_u *wo_scl; -# define w_p_scl w_onebuf_opt.wo_scl /* 'signcolumn' */ +# define w_p_scl w_onebuf_opt.wo_scl // 'signcolumn' #endif #ifdef FEAT_TERMINAL char_u *wo_twk; -# define w_p_twk w_onebuf_opt.wo_twk /* 'termwinkey' */ +# define w_p_twk w_onebuf_opt.wo_twk // 'termwinkey' char_u *wo_tws; -# define w_p_tws w_onebuf_opt.wo_tws /* 'termwinsize' */ +# define w_p_tws w_onebuf_opt.wo_tws // 'termwinsize' #endif #ifdef FEAT_EVAL - sctx_T wo_script_ctx[WV_COUNT]; /* SCTXs for window-local options */ + sctx_T wo_script_ctx[WV_COUNT]; // SCTXs for window-local options # define w_p_script_ctx w_onebuf_opt.wo_script_ctx #endif } winopt_T; @@ -306,15 +306,15 @@ typedef struct */ struct wininfo_S { - wininfo_T *wi_next; /* next entry or NULL for last entry */ - wininfo_T *wi_prev; /* previous entry or NULL for first entry */ - win_T *wi_win; /* pointer to window that did set wi_fpos */ - pos_T wi_fpos; /* last cursor position in the file */ - int wi_optset; /* TRUE when wi_opt has useful values */ - winopt_T wi_opt; /* local window options */ + wininfo_T *wi_next; // next entry or NULL for last entry + wininfo_T *wi_prev; // previous entry or NULL for first entry + win_T *wi_win; // pointer to window that did set wi_fpos + pos_T wi_fpos; // last cursor position in the file + int wi_optset; // TRUE when wi_opt has useful values + winopt_T wi_opt; // local window options #ifdef FEAT_FOLDING - int wi_fold_manual; /* copy of w_fold_manual */ - garray_T wi_folds; /* clone of w_folds */ + int wi_fold_manual; // copy of w_fold_manual + garray_T wi_folds; // clone of w_folds #endif }; @@ -324,20 +324,22 @@ struct wininfo_S */ typedef struct foldinfo { - int fi_level; /* level of the fold; when this is zero the - other fields are invalid */ - int fi_lnum; /* line number where fold starts */ - int fi_low_level; /* lowest fold level that starts in the same - line */ + int fi_level; // level of the fold; when this is zero the + // other fields are invalid + int fi_lnum; // line number where fold starts + int fi_low_level; // lowest fold level that starts in the same + // line } foldinfo_T; -/* Structure to store info about the Visual area. */ +/* + * Structure to store info about the Visual area. + */ typedef struct { - pos_T vi_start; /* start pos of last VIsual */ - pos_T vi_end; /* end position of last VIsual */ - int vi_mode; /* VIsual_mode of last VIsual */ - colnr_T vi_curswant; /* MAXCOL from w_curswant */ + pos_T vi_start; // start pos of last VIsual + pos_T vi_end; // end position of last VIsual + int vi_mode; // VIsual_mode of last VIsual + colnr_T vi_curswant; // MAXCOL from w_curswant } visualinfo_T; /* @@ -356,62 +358,62 @@ typedef struct u_entry u_entry_T; typedef struct u_header u_header_T; struct u_entry { - u_entry_T *ue_next; /* pointer to next entry in list */ - linenr_T ue_top; /* number of line above undo block */ - linenr_T ue_bot; /* number of line below undo block */ - linenr_T ue_lcount; /* linecount when u_save called */ - undoline_T *ue_array; /* array of lines in undo block */ - long ue_size; /* number of lines in ue_array */ + u_entry_T *ue_next; // pointer to next entry in list + linenr_T ue_top; // number of line above undo block + linenr_T ue_bot; // number of line below undo block + linenr_T ue_lcount; // linecount when u_save called + undoline_T *ue_array; // array of lines in undo block + long ue_size; // number of lines in ue_array #ifdef U_DEBUG - int ue_magic; /* magic number to check allocation */ + int ue_magic; // magic number to check allocation #endif }; struct u_header { - /* The following have a pointer and a number. The number is used when - * reading the undo file in u_read_undo() */ + // The following have a pointer and a number. The number is used when + // reading the undo file in u_read_undo() union { - u_header_T *ptr; /* pointer to next undo header in list */ + u_header_T *ptr; // pointer to next undo header in list long seq; } uh_next; union { - u_header_T *ptr; /* pointer to previous header in list */ + u_header_T *ptr; // pointer to previous header in list long seq; } uh_prev; union { - u_header_T *ptr; /* pointer to next header for alt. redo */ + u_header_T *ptr; // pointer to next header for alt. redo long seq; } uh_alt_next; union { - u_header_T *ptr; /* pointer to previous header for alt. redo */ + u_header_T *ptr; // pointer to previous header for alt. redo long seq; } uh_alt_prev; - long uh_seq; /* sequence number, higher == newer undo */ - int uh_walk; /* used by undo_time() */ - u_entry_T *uh_entry; /* pointer to first entry */ - u_entry_T *uh_getbot_entry; /* pointer to where ue_bot must be set */ - pos_T uh_cursor; /* cursor position before saving */ + long uh_seq; // sequence number, higher == newer undo + int uh_walk; // used by undo_time() + u_entry_T *uh_entry; // pointer to first entry + u_entry_T *uh_getbot_entry; // pointer to where ue_bot must be set + pos_T uh_cursor; // cursor position before saving long uh_cursor_vcol; - int uh_flags; /* see below */ - pos_T uh_namedm[NMARKS]; /* marks before undo/after redo */ - visualinfo_T uh_visual; /* Visual areas before undo/after redo */ - time_T uh_time; /* timestamp when the change was made */ - long uh_save_nr; /* set when the file was saved after the - changes in this block */ + int uh_flags; // see below + pos_T uh_namedm[NMARKS]; // marks before undo/after redo + visualinfo_T uh_visual; // Visual areas before undo/after redo + time_T uh_time; // timestamp when the change was made + long uh_save_nr; // set when the file was saved after the + // changes in this block #ifdef U_DEBUG - int uh_magic; /* magic number to check allocation */ + int uh_magic; // magic number to check allocation #endif }; -/* values for uh_flags */ -#define UH_CHANGED 0x01 /* b_changed flag before undo/after redo */ -#define UH_EMPTYBUF 0x02 /* buffer was empty */ +// values for uh_flags +#define UH_CHANGED 0x01 // b_changed flag before undo/after redo +#define UH_EMPTYBUF 0x02 // buffer was empty /* * structures used in undo.c */ -#define ALIGN_LONG /* longword alignment and use filler byte */ +#define ALIGN_LONG // longword alignment and use filler byte #define ALIGN_SIZE (sizeof(long)) #define ALIGN_MASK (ALIGN_SIZE - 1) @@ -424,11 +426,11 @@ typedef struct m_info minfo_T; struct m_info { #ifdef ALIGN_LONG - long_u m_size; /* size of the chunk (including m_info) */ + long_u m_size; // size of the chunk (including m_info) #else - short_u m_size; /* size of the chunk (including m_info) */ + short_u m_size; // size of the chunk (including m_info) #endif - minfo_T *m_next; /* pointer to next free chunk in the list */ + minfo_T *m_next; // pointer to next free chunk in the list }; /* @@ -459,13 +461,13 @@ struct mf_hashitem_S typedef struct mf_hashtab_S { - long_u mht_mask; /* mask used for hash value (nr of items - * in array is "mht_mask" + 1) */ - long_u mht_count; /* nr of items inserted into hashtable */ - mf_hashitem_T **mht_buckets; /* points to mht_small_buckets or - *dynamically allocated array */ - mf_hashitem_T *mht_small_buckets[MHT_INIT_SIZE]; /* initial buckets */ - char mht_fixed; /* non-zero value forbids growth */ + long_u mht_mask; // mask used for hash value (nr of items + // in array is "mht_mask" + 1) + long_u mht_count; // nr of items inserted into hashtable + mf_hashitem_T **mht_buckets; // points to mht_small_buckets or + //dynamically allocated array + mf_hashitem_T *mht_small_buckets[MHT_INIT_SIZE]; // initial buckets + char mht_fixed; // non-zero value forbids growth } mf_hashtab_T; /* @@ -485,17 +487,17 @@ typedef struct mf_hashtab_S struct block_hdr { - mf_hashitem_T bh_hashitem; /* header for hash table and key */ -#define bh_bnum bh_hashitem.mhi_key /* block number, part of bh_hashitem */ + mf_hashitem_T bh_hashitem; // header for hash table and key +#define bh_bnum bh_hashitem.mhi_key // block number, part of bh_hashitem - bhdr_T *bh_next; /* next block_hdr in free or used list */ - bhdr_T *bh_prev; /* previous block_hdr in used list */ - char_u *bh_data; /* pointer to memory (for used block) */ - int bh_page_count; /* number of pages in this block */ + bhdr_T *bh_next; // next block_hdr in free or used list + bhdr_T *bh_prev; // previous block_hdr in used list + char_u *bh_data; // pointer to memory (for used block) + int bh_page_count; // number of pages in this block #define BH_DIRTY 1 #define BH_LOCKED 2 - char bh_flags; /* BH_DIRTY or BH_LOCKED */ + char bh_flags; // BH_DIRTY or BH_LOCKED }; /* @@ -508,10 +510,10 @@ typedef struct nr_trans NR_TRANS; struct nr_trans { - mf_hashitem_T nt_hashitem; /* header for hash table and key */ -#define nt_old_bnum nt_hashitem.mhi_key /* old, negative, number */ + mf_hashitem_T nt_hashitem; // header for hash table and key +#define nt_old_bnum nt_hashitem.mhi_key // old, negative, number - blocknr_T nt_new_bnum; /* new, positive, number */ + blocknr_T nt_new_bnum; // new, positive, number }; @@ -523,8 +525,8 @@ typedef struct buffheader buffheader_T; */ struct buffblock { - buffblock_T *b_next; /* pointer to next buffblock */ - char_u b_str[1]; /* contents (actually longer) */ + buffblock_T *b_next; // pointer to next buffblock + char_u b_str[1]; // contents (actually longer) }; /* @@ -532,10 +534,10 @@ struct buffblock */ struct buffheader { - buffblock_T bh_first; /* first (dummy) block of list */ - buffblock_T *bh_curr; /* buffblock for appending */ - int bh_index; /* index for reading */ - int bh_space; /* space in bh_curr for appending */ + buffblock_T bh_first; // first (dummy) block of list + buffblock_T *bh_curr; // buffblock for appending + int bh_index; // index for reading + int bh_space; // space in bh_curr for appending }; typedef struct @@ -549,29 +551,31 @@ typedef struct */ typedef struct expand { - int xp_context; /* type of expansion */ - char_u *xp_pattern; /* start of item to expand */ - int xp_pattern_len; /* bytes in xp_pattern before cursor */ + int xp_context; // type of expansion + char_u *xp_pattern; // start of item to expand + int xp_pattern_len; // bytes in xp_pattern before cursor #if defined(FEAT_EVAL) && defined(FEAT_CMDL_COMPL) - char_u *xp_arg; /* completion function */ - sctx_T xp_script_ctx; /* SCTX for completion function */ + char_u *xp_arg; // completion function + sctx_T xp_script_ctx; // SCTX for completion function #endif - int xp_backslash; /* one of the XP_BS_ values */ + int xp_backslash; // one of the XP_BS_ values #ifndef BACKSLASH_IN_FILENAME - int xp_shell; /* TRUE for a shell command, more - characters need to be escaped */ -#endif - int xp_numfiles; /* number of files found by - file name completion */ - char_u **xp_files; /* list of files */ - char_u *xp_line; /* text being completed */ - int xp_col; /* cursor position in line */ + int xp_shell; // TRUE for a shell command, more + // characters need to be escaped +#endif + int xp_numfiles; // number of files found by + // file name completion + char_u **xp_files; // list of files + char_u *xp_line; // text being completed + int xp_col; // cursor position in line } expand_T; -/* values for xp_backslash */ -#define XP_BS_NONE 0 /* nothing special for backslashes */ -#define XP_BS_ONE 1 /* uses one backslash before a space */ -#define XP_BS_THREE 2 /* uses three backslashes before a space */ +/* + * values for xp_backslash + */ +#define XP_BS_NONE 0 // nothing special for backslashes +#define XP_BS_ONE 1 // uses one backslash before a space +#define XP_BS_THREE 2 // uses three backslashes before a space /* * Command modifiers ":vertical", ":browse", ":confirm" and ":hide" set a flag. @@ -580,24 +584,24 @@ typedef struct expand */ typedef struct { - int hide; /* TRUE when ":hide" was used */ + int hide; // TRUE when ":hide" was used # ifdef FEAT_BROWSE_CMD - int browse; /* TRUE to invoke file dialog */ + int browse; // TRUE to invoke file dialog # endif - int split; /* flags for win_split() */ - int tab; /* > 0 when ":tab" was used */ + int split; // flags for win_split() + int tab; // > 0 when ":tab" was used # if defined(FEAT_GUI_DIALOG) || defined(FEAT_CON_DIALOG) - int confirm; /* TRUE to invoke yes/no dialog */ + int confirm; // TRUE to invoke yes/no dialog # endif - int keepalt; /* TRUE when ":keepalt" was used */ - int keepmarks; /* TRUE when ":keepmarks" was used */ - int keepjumps; /* TRUE when ":keepjumps" was used */ - int lockmarks; /* TRUE when ":lockmarks" was used */ - int keeppatterns; /* TRUE when ":keeppatterns" was used */ - int noswapfile; /* TRUE when ":noswapfile" was used */ - char_u *save_ei; /* saved value of 'eventignore' */ - regmatch_T filter_regmatch; /* set by :filter /pat/ */ - int filter_force; /* set for :filter! */ + int keepalt; // TRUE when ":keepalt" was used + int keepmarks; // TRUE when ":keepmarks" was used + int keepjumps; // TRUE when ":keepjumps" was used + int lockmarks; // TRUE when ":lockmarks" was used + int keeppatterns; // TRUE when ":keeppatterns" was used + int noswapfile; // TRUE when ":noswapfile" was used + char_u *save_ei; // saved value of 'eventignore' + regmatch_T filter_regmatch; // set by :filter /pat/ + int filter_force; // set for :filter! } cmdmod_T; #define MF_SEED_LEN 8 @@ -644,11 +648,11 @@ struct memfile */ typedef struct info_pointer { - blocknr_T ip_bnum; /* block number */ - linenr_T ip_low; /* lowest lnum in this block */ - linenr_T ip_high; /* highest lnum in this block */ - int ip_index; /* index for block with current lnum */ -} infoptr_T; /* block/index pair */ + blocknr_T ip_bnum; // block number + linenr_T ip_low; // lowest lnum in this block + linenr_T ip_high; // highest lnum in this block + int ip_index; // index for block with current lnum +} infoptr_T; // block/index pair #ifdef FEAT_BYTEOFF typedef struct ml_chunksize @@ -657,11 +661,12 @@ typedef struct ml_chunksize long mlcs_totalsize; } chunksize_T; - /* Flags when calling ml_updatechunk() */ - -#define ML_CHNK_ADDLINE 1 -#define ML_CHNK_DELLINE 2 -#define ML_CHNK_UPDLINE 3 +/* + * Flags when calling ml_updatechunk() + */ +# define ML_CHNK_ADDLINE 1 +# define ML_CHNK_DELLINE 2 +# define ML_CHNK_UPDLINE 3 #endif /* @@ -669,28 +674,28 @@ typedef struct ml_chunksize */ typedef struct memline { - linenr_T ml_line_count; /* number of lines in the buffer */ + linenr_T ml_line_count; // number of lines in the buffer - memfile_T *ml_mfp; /* pointer to associated memfile */ + memfile_T *ml_mfp; // pointer to associated memfile -#define ML_EMPTY 1 /* empty buffer */ -#define ML_LINE_DIRTY 2 /* cached line was changed and allocated */ -#define ML_LOCKED_DIRTY 4 /* ml_locked was changed */ -#define ML_LOCKED_POS 8 /* ml_locked needs positive block number */ +#define ML_EMPTY 1 // empty buffer +#define ML_LINE_DIRTY 2 // cached line was changed and allocated +#define ML_LOCKED_DIRTY 4 // ml_locked was changed +#define ML_LOCKED_POS 8 // ml_locked needs positive block number int ml_flags; - infoptr_T *ml_stack; /* stack of pointer blocks (array of IPTRs) */ - int ml_stack_top; /* current top of ml_stack */ - int ml_stack_size; /* total number of entries in ml_stack */ + infoptr_T *ml_stack; // stack of pointer blocks (array of IPTRs) + int ml_stack_top; // current top of ml_stack + int ml_stack_size; // total number of entries in ml_stack - linenr_T ml_line_lnum; /* line number of cached line, 0 if not valid */ - char_u *ml_line_ptr; /* pointer to cached line */ - colnr_T ml_line_len; /* length of the cached line, including NUL */ + linenr_T ml_line_lnum; // line number of cached line, 0 if not valid + char_u *ml_line_ptr; // pointer to cached line + colnr_T ml_line_len; // length of the cached line, including NUL - bhdr_T *ml_locked; /* block used by last ml_get */ - linenr_T ml_locked_low; /* first line in ml_locked */ - linenr_T ml_locked_high; /* last line in ml_locked */ - int ml_locked_lineadd; /* number of lines inserted in ml_locked */ + bhdr_T *ml_locked; // block used by last ml_get + linenr_T ml_locked_low; // first line in ml_locked + linenr_T ml_locked_high; // last line in ml_locked + int ml_locked_lineadd; // number of lines inserted in ml_locked #ifdef FEAT_BYTEOFF chunksize_T *ml_chunksize; int ml_numchunks; @@ -745,13 +750,13 @@ typedef struct signlist signlist_T; struct signlist { - int id; /* unique identifier for each placed sign */ - linenr_T lnum; /* line number which has this sign */ - int typenr; /* typenr of sign */ - signgroup_T *group; /* sign group */ - int priority; /* priority for highlighting */ - signlist_T *next; /* next signlist entry */ - signlist_T *prev; /* previous entry -- for easy reordering */ + int id; // unique identifier for each placed sign + linenr_T lnum; // line number which has this sign + int typenr; // typenr of sign + signgroup_T *group; // sign group + int priority; // priority for highlighting + signlist_T *next; // next signlist entry + signlist_T *prev; // previous entry -- for easy reordering }; #if defined(FEAT_SIGNS) || defined(PROTO) @@ -775,9 +780,9 @@ struct signlist */ typedef struct arglist { - garray_T al_ga; /* growarray with the array of file names */ - int al_refcount; /* number of windows using this arglist */ - int id; /* id of this arglist */ + garray_T al_ga; // growarray with the array of file names + int al_refcount; // number of windows using this arglist + int id; // id of this arglist } alist_T; /* @@ -787,8 +792,8 @@ typedef struct arglist */ typedef struct argentry { - char_u *ae_fname; /* file name as specified */ - int ae_fnum; /* buffer number with expanded file name */ + char_u *ae_fname; // file name as specified + int ae_fnum; // buffer number with expanded file name } aentry_T; #define ALIST(win) (win)->w_alist @@ -809,8 +814,8 @@ typedef struct argentry typedef struct eslist_elem eslist_T; struct eslist_elem { - int saved_emsg_silent; /* saved value of "emsg_silent" */ - eslist_T *next; /* next element on the list */ + int saved_emsg_silent; // saved value of "emsg_silent" + eslist_T *next; // next element on the list }; /* @@ -821,59 +826,59 @@ struct eslist_elem struct condstack { - short cs_flags[CSTACK_LEN]; /* CSF_ flags */ - char cs_pending[CSTACK_LEN]; /* CSTP_: what's pending in ":finally"*/ + short cs_flags[CSTACK_LEN]; // CSF_ flags + char cs_pending[CSTACK_LEN]; // CSTP_: what's pending in ":finally" union { - void *csp_rv[CSTACK_LEN]; /* return typeval for pending return */ - void *csp_ex[CSTACK_LEN]; /* exception for pending throw */ + void *csp_rv[CSTACK_LEN]; // return typeval for pending return + void *csp_ex[CSTACK_LEN]; // exception for pending throw } cs_pend; - void *cs_forinfo[CSTACK_LEN]; /* info used by ":for" */ - int cs_line[CSTACK_LEN]; /* line nr of ":while"/":for" line */ - int cs_idx; /* current entry, or -1 if none */ - int cs_looplevel; /* nr of nested ":while"s and ":for"s */ - int cs_trylevel; /* nr of nested ":try"s */ - eslist_T *cs_emsg_silent_list; /* saved values of "emsg_silent" */ - char cs_lflags; /* loop flags: CSL_ flags */ + void *cs_forinfo[CSTACK_LEN]; // info used by ":for" + int cs_line[CSTACK_LEN]; // line nr of ":while"/":for" line + int cs_idx; // current entry, or -1 if none + int cs_looplevel; // nr of nested ":while"s and ":for"s + int cs_trylevel; // nr of nested ":try"s + eslist_T *cs_emsg_silent_list; // saved values of "emsg_silent" + char cs_lflags; // loop flags: CSL_ flags }; # define cs_rettv cs_pend.csp_rv # define cs_exception cs_pend.csp_ex -/* There is no CSF_IF, the lack of CSF_WHILE, CSF_FOR and CSF_TRY means ":if" - * was used. */ -# define CSF_TRUE 0x0001 /* condition was TRUE */ -# define CSF_ACTIVE 0x0002 /* current state is active */ -# define CSF_ELSE 0x0004 /* ":else" has been passed */ -# define CSF_WHILE 0x0008 /* is a ":while" */ -# define CSF_FOR 0x0010 /* is a ":for" */ +// There is no CSF_IF, the lack of CSF_WHILE, CSF_FOR and CSF_TRY means ":if" +// was used. +# define CSF_TRUE 0x0001 // condition was TRUE +# define CSF_ACTIVE 0x0002 // current state is active +# define CSF_ELSE 0x0004 // ":else" has been passed +# define CSF_WHILE 0x0008 // is a ":while" +# define CSF_FOR 0x0010 // is a ":for" -# define CSF_TRY 0x0100 /* is a ":try" */ -# define CSF_FINALLY 0x0200 /* ":finally" has been passed */ -# define CSF_THROWN 0x0400 /* exception thrown to this try conditional */ -# define CSF_CAUGHT 0x0800 /* exception caught by this try conditional */ -# define CSF_SILENT 0x1000 /* "emsg_silent" reset by ":try" */ -/* Note that CSF_ELSE is only used when CSF_TRY and CSF_WHILE are unset - * (an ":if"), and CSF_SILENT is only used when CSF_TRY is set. */ +# define CSF_TRY 0x0100 // is a ":try" +# define CSF_FINALLY 0x0200 // ":finally" has been passed +# define CSF_THROWN 0x0400 // exception thrown to this try conditional +# define CSF_CAUGHT 0x0800 // exception caught by this try conditional +# define CSF_SILENT 0x1000 // "emsg_silent" reset by ":try" +// Note that CSF_ELSE is only used when CSF_TRY and CSF_WHILE are unset +// (an ":if"), and CSF_SILENT is only used when CSF_TRY is set. /* * What's pending for being reactivated at the ":endtry" of this try * conditional: */ -# define CSTP_NONE 0 /* nothing pending in ":finally" clause */ -# define CSTP_ERROR 1 /* an error is pending */ -# define CSTP_INTERRUPT 2 /* an interrupt is pending */ -# define CSTP_THROW 4 /* a throw is pending */ -# define CSTP_BREAK 8 /* ":break" is pending */ -# define CSTP_CONTINUE 16 /* ":continue" is pending */ -# define CSTP_RETURN 24 /* ":return" is pending */ -# define CSTP_FINISH 32 /* ":finish" is pending */ +# define CSTP_NONE 0 // nothing pending in ":finally" clause +# define CSTP_ERROR 1 // an error is pending +# define CSTP_INTERRUPT 2 // an interrupt is pending +# define CSTP_THROW 4 // a throw is pending +# define CSTP_BREAK 8 // ":break" is pending +# define CSTP_CONTINUE 16 // ":continue" is pending +# define CSTP_RETURN 24 // ":return" is pending +# define CSTP_FINISH 32 // ":finish" is pending /* * Flags for the cs_lflags item in struct condstack. */ -# define CSL_HAD_LOOP 1 /* just found ":while" or ":for" */ -# define CSL_HAD_ENDLOOP 2 /* just found ":endwhile" or ":endfor" */ -# define CSL_HAD_CONT 4 /* just found ":continue" */ -# define CSL_HAD_FINA 8 /* just found ":finally" */ +# define CSL_HAD_LOOP 1 // just found ":while" or ":for" +# define CSL_HAD_ENDLOOP 2 // just found ":endwhile" or ":endfor" +# define CSL_HAD_CONT 4 // just found ":continue" +# define CSL_HAD_FINA 8 // just found ":finally" /* * A list of error messages that can be converted to an exception. "throw_msg" @@ -883,9 +888,9 @@ struct condstack */ struct msglist { - char *msg; /* original message */ - char *throw_msg; /* msg to throw: usually original one */ - struct msglist *next; /* next of several messages in a row */ + char *msg; // original message + char *throw_msg; // msg to throw: usually original one + struct msglist *next; // next of several messages in a row }; /* @@ -905,12 +910,12 @@ typedef enum typedef struct vim_exception except_T; struct vim_exception { - except_type_T type; /* exception type */ - char *value; /* exception value */ - struct msglist *messages; /* message(s) causing error exception */ - char_u *throw_name; /* name of the throw point */ - linenr_T throw_lnum; /* line number of the throw point */ - except_T *caught; /* next exception on the caught stack */ + except_type_T type; // exception type + char *value; // exception value + struct msglist *messages; // message(s) causing error exception + char_u *throw_name; // name of the throw point + linenr_T throw_lnum; // line number of the throw point + except_T *caught; // next exception on the caught stack }; /* @@ -921,17 +926,17 @@ struct vim_exception typedef struct cleanup_stuff cleanup_T; struct cleanup_stuff { - int pending; /* error/interrupt/exception state */ - except_T *exception; /* exception value */ + int pending; // error/interrupt/exception state + except_T *exception; // exception value }; #ifdef FEAT_SYN_HL -/* struct passed to in_id_list() */ +// struct passed to in_id_list() struct sp_syn { - int inc_tag; /* ":syn include" unique tag */ - short id; /* highlight group ID of item */ - short *cont_in_list; /* cont.in group IDs, if non-zero */ + int inc_tag; // ":syn include" unique tag + short id; // highlight group ID of item + short *cont_in_list; // cont.in group IDs, if non-zero }; /* @@ -941,12 +946,12 @@ typedef struct keyentry keyentry_T; struct keyentry { - keyentry_T *ke_next; /* next entry with identical "keyword[]" */ - struct sp_syn k_syn; /* struct passed to in_id_list() */ - short *next_list; /* ID list for next match (if non-zero) */ + keyentry_T *ke_next; // next entry with identical "keyword[]" + struct sp_syn k_syn; // struct passed to in_id_list() + short *next_list; // ID list for next match (if non-zero) int flags; - int k_char; /* conceal substitute character */ - char_u keyword[1]; /* actually longer */ + int k_char; // conceal substitute character + char_u keyword[1]; // actually longer }; /* @@ -954,13 +959,13 @@ struct keyentry */ typedef struct buf_state { - int bs_idx; /* index of pattern */ - int bs_flags; /* flags for pattern */ + int bs_idx; // index of pattern + int bs_flags; // flags for pattern #ifdef FEAT_CONCEAL - int bs_seqnr; /* stores si_seqnr */ - int bs_cchar; /* stores si_cchar */ + int bs_seqnr; // stores si_seqnr + int bs_cchar; // stores si_cchar #endif - reg_extmatch_T *bs_extmatch; /* external matches from start pattern */ + reg_extmatch_T *bs_extmatch; // external matches from start pattern } bufstate_T; /* @@ -971,55 +976,55 @@ typedef struct syn_state synstate_T; struct syn_state { - synstate_T *sst_next; /* next entry in used or free list */ - linenr_T sst_lnum; /* line number for this state */ + synstate_T *sst_next; // next entry in used or free list + linenr_T sst_lnum; // line number for this state union { - bufstate_T sst_stack[SST_FIX_STATES]; /* short state stack */ - garray_T sst_ga; /* growarray for long state stack */ + bufstate_T sst_stack[SST_FIX_STATES]; // short state stack + garray_T sst_ga; // growarray for long state stack } sst_union; - int sst_next_flags; /* flags for sst_next_list */ - int sst_stacksize; /* number of states on the stack */ - short *sst_next_list; /* "nextgroup" list in this state - * (this is a copy, don't free it! */ - disptick_T sst_tick; /* tick when last displayed */ - linenr_T sst_change_lnum;/* when non-zero, change in this line - * may have made the state invalid */ + int sst_next_flags; // flags for sst_next_list + int sst_stacksize; // number of states on the stack + short *sst_next_list; // "nextgroup" list in this state + // (this is a copy, don't free it! + disptick_T sst_tick; // tick when last displayed + linenr_T sst_change_lnum;// when non-zero, change in this line + // may have made the state invalid }; -#endif /* FEAT_SYN_HL */ +#endif // FEAT_SYN_HL /* * Structure shared between syntax.c, screen.c and gui_x11.c. */ typedef struct attr_entry { - short ae_attr; /* HL_BOLD, etc. */ + short ae_attr; // HL_BOLD, etc. union { struct { - char_u *start; /* start escape sequence */ - char_u *stop; /* stop escape sequence */ + char_u *start; // start escape sequence + char_u *stop; // stop escape sequence } term; struct |