patch 8.2.4038: various code not used when features are disabled

Problem:    Various code not used when features are disabled.
Solution:   Add #ifdefs. (Dominique Pellé, closes #9491)
This commit is contained in:
Dominique Pelle
2022-01-08 12:41:16 +00:00
committed by Bram Moolenaar
parent 370791465e
commit 748b308eeb
35 changed files with 126 additions and 74 deletions

View File

@@ -151,6 +151,7 @@ alloc(size_t size)
return lalloc(size, TRUE); return lalloc(size, TRUE);
} }
#if defined(FEAT_QUICKFIX) || defined(PROTO)
/* /*
* alloc() with an ID for alloc_fail(). * alloc() with an ID for alloc_fail().
*/ */
@@ -163,6 +164,7 @@ alloc_id(size_t size, alloc_id_T id UNUSED)
#endif #endif
return lalloc(size, TRUE); return lalloc(size, TRUE);
} }
#endif
/* /*
* Allocate memory and set all bytes to zero. * Allocate memory and set all bytes to zero.
@@ -178,6 +180,7 @@ alloc_clear(size_t size)
return p; return p;
} }
#if defined(FEAT_SIGNS) || defined(PROTO)
/* /*
* Same as alloc_clear() but with allocation id for testing * Same as alloc_clear() but with allocation id for testing
*/ */
@@ -190,6 +193,7 @@ alloc_clear_id(size_t size, alloc_id_T id UNUSED)
#endif #endif
return alloc_clear(size); return alloc_clear(size);
} }
#endif
/* /*
* Allocate memory like lalloc() and set all bytes to zero. * Allocate memory like lalloc() and set all bytes to zero.
@@ -648,6 +652,7 @@ ga_clear_strings(garray_T *gap)
ga_clear(gap); ga_clear(gap);
} }
#if defined(FEAT_EVAL) || defined(PROTO)
/* /*
* Copy a growing array that contains a list of strings. * Copy a growing array that contains a list of strings.
*/ */
@@ -682,6 +687,7 @@ ga_copy_strings(garray_T *from, garray_T *to)
to->ga_len = from->ga_len; to->ga_len = from->ga_len;
return OK; return OK;
} }
#endif
/* /*
* Initialize a growing array. Don't forget to set ga_itemsize and * Initialize a growing array. Don't forget to set ga_itemsize and

View File

@@ -138,6 +138,7 @@ read_buffer(
return retval; return retval;
} }
#if defined(FEAT_EVAL) || defined(PROTO)
/* /*
* Ensure buffer "buf" is loaded. Does not trigger the swap-exists action. * Ensure buffer "buf" is loaded. Does not trigger the swap-exists action.
*/ */
@@ -154,6 +155,7 @@ buffer_ensure_loaded(buf_T *buf)
aucmd_restbuf(&aco); aucmd_restbuf(&aco);
} }
} }
#endif
/* /*
* Open current buffer, that is: open the memfile and read the file into * Open current buffer, that is: open the memfile and read the file into
@@ -5609,6 +5611,7 @@ bt_prompt(buf_T *buf)
return buf != NULL && buf->b_p_bt[0] == 'p' && buf->b_p_bt[1] == 'r'; return buf != NULL && buf->b_p_bt[0] == 'p' && buf->b_p_bt[1] == 'r';
} }
#if defined(FEAT_PROP_POPUP) || defined(PROTO)
/* /*
* Return TRUE if "buf" is a buffer for a popup window. * Return TRUE if "buf" is a buffer for a popup window.
*/ */
@@ -5618,6 +5621,7 @@ bt_popup(buf_T *buf)
return buf != NULL && buf->b_p_bt != NULL return buf != NULL && buf->b_p_bt != NULL
&& buf->b_p_bt[0] == 'p' && buf->b_p_bt[1] == 'o'; && buf->b_p_bt[0] == 'p' && buf->b_p_bt[1] == 'o';
} }
#endif
/* /*
* Return TRUE if "buf" is a "nofile", "acwrite", "terminal" or "prompt" * Return TRUE if "buf" is a "nofile", "acwrite", "terminal" or "prompt"
@@ -5632,6 +5636,7 @@ bt_nofilename(buf_T *buf)
|| buf->b_p_bt[0] == 'p'); || buf->b_p_bt[0] == 'p');
} }
#if defined(FEAT_QUICKFIX) || defined(PROTO)
/* /*
* Return TRUE if "buf" has 'buftype' set to "nofile". * Return TRUE if "buf" has 'buftype' set to "nofile".
*/ */
@@ -5640,6 +5645,7 @@ bt_nofile(buf_T *buf)
{ {
return buf != NULL && buf->b_p_bt[0] == 'n' && buf->b_p_bt[2] == 'f'; return buf != NULL && buf->b_p_bt[0] == 'n' && buf->b_p_bt[2] == 'f';
} }
#endif
/* /*
* Return TRUE if "buf" is a "nowrite", "nofile", "terminal" or "prompt" * Return TRUE if "buf" is a "nowrite", "nofile", "terminal" or "prompt"

View File

@@ -1476,6 +1476,7 @@ skipwhite(char_u *q)
return p; return p;
} }
#if defined(FEAT_EVAL) || defined(PROTO)
/* /*
* skip over ' ', '\t' and '\n'. * skip over ' ', '\t' and '\n'.
*/ */
@@ -1488,6 +1489,7 @@ skipwhite_and_nl(char_u *q)
++p; ++p;
return p; return p;
} }
#endif
/* /*
* getwhitecols: return the number of whitespace * getwhitecols: return the number of whitespace

View File

@@ -1540,6 +1540,7 @@ clip_x11_notify_cb(Widget w UNUSED, Atom *sel_atom UNUSED, Atom *target UNUSED)
/* /*
* Property callback to get a timestamp for XtOwnSelection. * Property callback to get a timestamp for XtOwnSelection.
*/ */
# if (defined(FEAT_X11) && defined(FEAT_XCLIPBOARD)) || defined(PROTO)
static void static void
clip_x11_timestamp_cb( clip_x11_timestamp_cb(
Widget w, Widget w,
@@ -1592,6 +1593,7 @@ x11_setup_selection(Widget w)
XtAddEventHandler(w, PropertyChangeMask, False, XtAddEventHandler(w, PropertyChangeMask, False,
/*(XtEventHandler)*/clip_x11_timestamp_cb, (XtPointer)NULL); /*(XtEventHandler)*/clip_x11_timestamp_cb, (XtPointer)NULL);
} }
# endif
static void static void
clip_x11_request_selection_cb( clip_x11_request_selection_cb(

View File

@@ -37,11 +37,13 @@ get_histentry(int hist_type)
return history[hist_type]; return history[hist_type];
} }
#if defined(FEAT_VIMINFO) || defined(PROTO)
void void
set_histentry(int hist_type, histentry_T *entry) set_histentry(int hist_type, histentry_T *entry)
{ {
history[hist_type] = entry; history[hist_type] = entry;
} }
#endif
int * int *
get_hisidx(int hist_type) get_hisidx(int hist_type)
@@ -49,11 +51,13 @@ get_hisidx(int hist_type)
return &hisidx[hist_type]; return &hisidx[hist_type];
} }
#if defined(FEAT_VIMINFO) || defined(PROTO)
int * int *
get_hisnum(int hist_type) get_hisnum(int hist_type)
{ {
return &hisnum[hist_type]; return &hisnum[hist_type];
} }
#endif
/* /*
* Translate a history character to the associated type number. * Translate a history character to the associated type number.

View File

@@ -247,6 +247,7 @@ crypt_get_header_len(int method_nr)
} }
#if defined(FEAT_SODIUM) || defined(PROTO)
/* /*
* Get maximum crypt method specific length of the file header in bytes. * Get maximum crypt method specific length of the file header in bytes.
*/ */
@@ -265,6 +266,7 @@ crypt_get_max_header_len()
} }
return max; return max;
} }
#endif
/* /*
* Set the crypt method for buffer "buf" to "method_nr" using the int value as * Set the crypt method for buffer "buf" to "method_nr" using the int value as

View File

@@ -1715,6 +1715,7 @@ edit_putchar(int c, int highlight)
} }
} }
#if defined(FEAT_JOB_CHANNEL) || defined(PROTO)
/* /*
* Set the insert start position for when using a prompt buffer. * Set the insert start position for when using a prompt buffer.
*/ */
@@ -1728,6 +1729,7 @@ set_insstart(linenr_T lnum, int col)
Insstart_blank_vcol = MAXCOL; Insstart_blank_vcol = MAXCOL;
arrow_used = FALSE; arrow_used = FALSE;
} }
#endif
/* /*
* Undo the previous edit_putchar(). * Undo the previous edit_putchar().

View File

@@ -653,50 +653,10 @@ call_vim_function(
return ret; return ret;
} }
/*
* Call Vim script function "func" and return the result as a number.
* Returns -1 when calling the function fails.
* Uses argv[0] to argv[argc - 1] for the function arguments. argv[argc] should
* have type VAR_UNKNOWN.
*/
varnumber_T
call_func_retnr(
char_u *func,
int argc,
typval_T *argv)
{
typval_T rettv;
varnumber_T retval;
if (call_vim_function(func, argc, argv, &rettv) == FAIL)
return -1;
retval = tv_get_number_chk(&rettv, NULL);
clear_tv(&rettv);
return retval;
}
/*
* Call Vim script function like call_func_retnr() and drop the result.
* Returns FAIL when calling the function fails.
*/
int
call_func_noret(
char_u *func,
int argc,
typval_T *argv)
{
typval_T rettv;
if (call_vim_function(func, argc, argv, &rettv) == FAIL)
return FAIL;
clear_tv(&rettv);
return OK;
}
/* /*
* Call Vim script function "func" and return the result as a string. * Call Vim script function "func" and return the result as a string.
* Uses "argv" and "argc" as call_func_retnr(). * Uses "argv[0]" to "argv[argc - 1]" for the function arguments. "argv[argc]"
* should have type VAR_UNKNOWN.
* Returns NULL when calling the function fails. * Returns NULL when calling the function fails.
*/ */
void * void *
@@ -718,7 +678,7 @@ call_func_retstr(
/* /*
* Call Vim script function "func" and return the result as a List. * Call Vim script function "func" and return the result as a List.
* Uses "argv" and "argc" as call_func_retnr(). * Uses "argv" and "argc" as call_func_retstr().
* Returns NULL when there is something wrong. * Returns NULL when there is something wrong.
*/ */
void * void *
@@ -4783,6 +4743,8 @@ set_ref_in_ht(hashtab_T *ht, int copyID, list_stack_T **list_stack)
return abort; return abort;
} }
#if defined(FEAT_LUA) || defined(FEAT_PYTHON) || defined(FEAT_PYTHON3) \
|| defined(PROTO)
/* /*
* Mark a dict and its items with "copyID". * Mark a dict and its items with "copyID".
* Returns TRUE if setting references failed somehow. * Returns TRUE if setting references failed somehow.
@@ -4797,6 +4759,7 @@ set_ref_in_dict(dict_T *d, int copyID)
} }
return FALSE; return FALSE;
} }
#endif
/* /*
* Mark a list and its items with "copyID". * Mark a list and its items with "copyID".

View File

@@ -864,9 +864,7 @@ f_setline(typval_T *argvars, typval_T *rettv)
} }
#endif // FEAT_EVAL #endif // FEAT_EVAL
#if defined(FEAT_JOB_CHANNEL) \ #if defined(FEAT_PYTHON) || defined(FEAT_PYTHON3) || defined(PROTO)
|| defined(FEAT_PYTHON) || defined(FEAT_PYTHON3) \
|| defined(PROTO)
/* /*
* Make "buf" the current buffer. restore_buffer() MUST be called to undo. * Make "buf" the current buffer. restore_buffer() MUST be called to undo.
* No autocommands will be executed. Use aucmd_prepbuf() if there are any. * No autocommands will be executed. Use aucmd_prepbuf() if there are any.

View File

@@ -3529,6 +3529,7 @@ execute_redir_str(char_u *value, int value_len)
} }
} }
#if defined(FEAT_LUA) || defined(PROTO)
/* /*
* Get next line from a string containing NL separated lines. * Get next line from a string containing NL separated lines.
* Called by do_cmdline() to get the next line. * Called by do_cmdline() to get the next line.
@@ -3570,6 +3571,7 @@ execute_cmds_from_string(char_u *str)
do_cmdline(NULL, get_str_line, (void *)&str, do_cmdline(NULL, get_str_line, (void *)&str,
DOCMD_NOWAIT|DOCMD_VERBOSE|DOCMD_REPEAT|DOCMD_KEYTYPED); DOCMD_NOWAIT|DOCMD_VERBOSE|DOCMD_REPEAT|DOCMD_KEYTYPED);
} }
#endif
/* /*
* Get next line from a list. * Get next line from a list.

View File

@@ -3082,6 +3082,7 @@ parse_command_modifiers(
return OK; return OK;
} }
#if defined(FEAT_EVAL) || defined(PROTO)
/* /*
* Return TRUE if "cmod" has anything set. * Return TRUE if "cmod" has anything set.
*/ */
@@ -3110,6 +3111,7 @@ cmdmod_error(int ignore_silent)
} }
return FALSE; return FALSE;
} }
#endif
/* /*
* Apply the command modifiers. Saves current state in "cmdmod", call * Apply the command modifiers. Saves current state in "cmdmod", call
@@ -3393,6 +3395,7 @@ append_command(char_u *cmd)
*d = NUL; *d = NUL;
} }
#if defined(FEAT_EVAL) || defined(PROTO)
/* /*
* If "start" points "&opt", "&l:opt", "&g:opt" or "$ENV" return a pointer to * If "start" points "&opt", "&l:opt", "&g:opt" or "$ENV" return a pointer to
* the name. Otherwise just return "start". * the name. Otherwise just return "start".
@@ -3413,6 +3416,7 @@ skip_option_env_lead(char_u *start)
name += 1; name += 1;
return name; return name;
} }
#endif
/* /*
* Find an Ex command by its name, either built-in or user. * Find an Ex command by its name, either built-in or user.

View File

@@ -440,7 +440,9 @@ EXTERN type_T t_dict_string INIT6(VAR_DICT, 0, 0, TTFLAG_STATIC, &t_string, NULL
#endif #endif
#ifdef FEAT_EVAL
EXTERN int did_source_packages INIT(= FALSE); EXTERN int did_source_packages INIT(= FALSE);
#endif
// Magic number used for hashitem "hi_key" value indicating a deleted item. // Magic number used for hashitem "hi_key" value indicating a deleted item.
// Only the address is used. // Only the address is used.
@@ -1153,7 +1155,9 @@ EXTERN int ctrl_c_interrupts INIT(= TRUE); // CTRL-C sets got_int
EXTERN cmdmod_T cmdmod; // Ex command modifiers EXTERN cmdmod_T cmdmod; // Ex command modifiers
#ifdef FEAT_EVAL
EXTERN int is_export INIT(= FALSE); // :export {cmd} EXTERN int is_export INIT(= FALSE); // :export {cmd}
#endif
EXTERN int msg_silent INIT(= 0); // don't print messages EXTERN int msg_silent INIT(= 0); // don't print messages
EXTERN int emsg_silent INIT(= 0); // don't print error messages EXTERN int emsg_silent INIT(= 0); // don't print error messages
@@ -1190,7 +1194,9 @@ EXTERN typebuf_T typebuf // typeahead buffer
#endif #endif
; ;
EXTERN int ex_normal_busy INIT(= 0); // recursiveness of ex_normal() EXTERN int ex_normal_busy INIT(= 0); // recursiveness of ex_normal()
#ifdef FEAT_EVAL
EXTERN int in_feedkeys INIT(= 0); // ex_normal_busy set in feedkeys() EXTERN int in_feedkeys INIT(= 0); // ex_normal_busy set in feedkeys()
#endif
EXTERN int ex_normal_lock INIT(= 0); // forbid use of ex_normal() EXTERN int ex_normal_lock INIT(= 0); // forbid use of ex_normal()
#ifdef FEAT_EVAL #ifdef FEAT_EVAL
@@ -1394,8 +1400,10 @@ EXTERN char_u no_lines_msg[] INIT(= N_("--No lines in buffer--"));
EXTERN long sub_nsubs; // total number of substitutions EXTERN long sub_nsubs; // total number of substitutions
EXTERN linenr_T sub_nlines; // total number of lines changed EXTERN linenr_T sub_nlines; // total number of lines changed
#ifdef FEAT_EVAL
// Used when a compiled :substitute has an expression. // Used when a compiled :substitute has an expression.
EXTERN struct subs_expr_S *substitute_instr INIT(= NULL); EXTERN struct subs_expr_S *substitute_instr INIT(= NULL);
#endif
// table to store parsed 'wildmode' // table to store parsed 'wildmode'
EXTERN char_u wim_flags[4]; EXTERN char_u wim_flags[4];
@@ -1588,7 +1596,9 @@ EXTERN int netbeansSuppressNoLines INIT(= 0); // skip "No lines in buffer"
EXTERN char top_bot_msg[] INIT(= N_("search hit TOP, continuing at BOTTOM")); EXTERN char top_bot_msg[] INIT(= N_("search hit TOP, continuing at BOTTOM"));
EXTERN char bot_top_msg[] INIT(= N_("search hit BOTTOM, continuing at TOP")); EXTERN char bot_top_msg[] INIT(= N_("search hit BOTTOM, continuing at TOP"));
#ifdef FEAT_EVAL
EXTERN char line_msg[] INIT(= N_(" line ")); EXTERN char line_msg[] INIT(= N_(" line "));
#endif
#ifdef FEAT_CRYPT #ifdef FEAT_CRYPT
EXTERN char need_key_msg[] INIT(= N_("Need encryption key for \"%s\"")); EXTERN char need_key_msg[] INIT(= N_("Need encryption key for \"%s\""));

View File

@@ -125,6 +125,7 @@ free_xim_stuff(void)
} }
#endif #endif
#if defined(FEAT_EVAL) || defined(PROTO)
/* /*
* Mark the global 'imactivatefunc' and 'imstatusfunc' callbacks with 'copyID' * Mark the global 'imactivatefunc' and 'imstatusfunc' callbacks with 'copyID'
* so that they are not garbage collected. * so that they are not garbage collected.
@@ -134,14 +135,14 @@ set_ref_in_im_funcs(int copyID UNUSED)
{ {
int abort = FALSE; int abort = FALSE;
#if defined(FEAT_EVAL) && \ # if defined(FEAT_XIM) || defined(IME_WITHOUT_XIM) || defined(VIMDLL)
(defined(FEAT_XIM) || defined(IME_WITHOUT_XIM) || defined(VIMDLL))
abort = set_ref_in_callback(&imaf_cb, copyID); abort = set_ref_in_callback(&imaf_cb, copyID);
abort = abort || set_ref_in_callback(&imsf_cb, copyID); abort = abort || set_ref_in_callback(&imsf_cb, copyID);
#endif # endif
return abort; return abort;
} }
#endif
#if defined(FEAT_XIM) || defined(PROTO) #if defined(FEAT_XIM) || defined(PROTO)

View File

@@ -288,6 +288,7 @@ hash_lock(hashtab_T *ht)
++ht->ht_locked; ++ht->ht_locked;
} }
#if defined(FEAT_PROP_POPUP) || defined(PROTO)
/* /*
* Lock a hashtable at the specified number of entries. * Lock a hashtable at the specified number of entries.
* Caller must make sure no more than "size" entries will be added. * Caller must make sure no more than "size" entries will be added.
@@ -299,6 +300,7 @@ hash_lock_size(hashtab_T *ht, int size)
(void)hash_may_resize(ht, size); (void)hash_may_resize(ht, size);
++ht->ht_locked; ++ht->ht_locked;
} }
#endif
/* /*
* Unlock a hashtable: allow ht_array changes again. * Unlock a hashtable: allow ht_array changes again.

View File

@@ -343,6 +343,7 @@ static char *(highlight_init_dark[]) = {
NULL NULL
}; };
#if defined(FEAT_SYN_HL) || defined(PROTO)
/* /*
* Returns the number of highlight groups. * Returns the number of highlight groups.
*/ */
@@ -369,6 +370,7 @@ highlight_link_id(int id)
{ {
return HL_TABLE()[id].sg_link; return HL_TABLE()[id].sg_link;
} }
#endif
void void
init_highlight( init_highlight(

View File

@@ -263,7 +263,9 @@ ins_ctrl_x(void)
/* /*
* Functions to check the current CTRL-X mode. * Functions to check the current CTRL-X mode.
*/ */
#ifdef FEAT_CINDENT
int ctrl_x_mode_none(void) { return ctrl_x_mode == 0; } int ctrl_x_mode_none(void) { return ctrl_x_mode == 0; }
#endif
int ctrl_x_mode_normal(void) { return ctrl_x_mode == CTRL_X_NORMAL; } int ctrl_x_mode_normal(void) { return ctrl_x_mode == CTRL_X_NORMAL; }
int ctrl_x_mode_scroll(void) { return ctrl_x_mode == CTRL_X_SCROLL; } int ctrl_x_mode_scroll(void) { return ctrl_x_mode == CTRL_X_SCROLL; }
int ctrl_x_mode_whole_line(void) { return ctrl_x_mode == CTRL_X_WHOLE_LINE; } int ctrl_x_mode_whole_line(void) { return ctrl_x_mode == CTRL_X_WHOLE_LINE; }

View File

@@ -1091,12 +1091,15 @@ state_no_longer_safe(char *reason UNUSED)
was_safe = FALSE; was_safe = FALSE;
} }
#if defined(FEAT_EVAL) || defined(MESSAGE_QUEUE) || defined(PROTO)
int int
get_was_safe_state(void) get_was_safe_state(void)
{ {
return was_safe; return was_safe;
} }
#endif
#if defined(MESSAGE_QUEUE) || defined(PROTO)
/* /*
* Invoked when leaving code that invokes callbacks. Then trigger * Invoked when leaving code that invokes callbacks. Then trigger
* SafeStateAgain, if it was safe when starting to wait for a character. * SafeStateAgain, if it was safe when starting to wait for a character.
@@ -1137,6 +1140,7 @@ may_trigger_safestateagain(void)
"SafeState: back to waiting, not triggering SafeStateAgain"); "SafeState: back to waiting, not triggering SafeStateAgain");
#endif #endif
} }
#endif
/* /*

View File

@@ -1368,6 +1368,7 @@ free_all_marks(void)
} }
#endif #endif
#if defined(FEAT_VIMINFO) || defined(PROTO)
/* /*
* Return a pointer to the named file marks. * Return a pointer to the named file marks.
*/ */
@@ -1376,6 +1377,7 @@ get_namedfm(void)
{ {
return namedfm; return namedfm;
} }
#endif
#if defined(FEAT_EVAL) || defined(PROTO) #if defined(FEAT_EVAL) || defined(PROTO)
/* /*

View File

@@ -876,6 +876,7 @@ internal_error(char *where)
siemsg(_(e_internal_error_str), where); siemsg(_(e_internal_error_str), where);
} }
#if defined(FEAT_EVAL) || defined(PROTO)
/* /*
* Like internal_error() but do not call abort(), to avoid tests using * Like internal_error() but do not call abort(), to avoid tests using
* test_unknown() and test_void() causing Vim to exit. * test_unknown() and test_void() causing Vim to exit.
@@ -885,6 +886,7 @@ internal_error_no_abort(char *where)
{ {
semsg(_(e_internal_error_str), where); semsg(_(e_internal_error_str), where);
} }
#endif
// emsg3() and emsgn() are in misc2.c to avoid warnings for the prototypes. // emsg3() and emsgn() are in misc2.c to avoid warnings for the prototypes.
@@ -894,6 +896,7 @@ emsg_invreg(int name)
semsg(_(e_invalid_register_name_str), transchar(name)); semsg(_(e_invalid_register_name_str), transchar(name));
} }
#if defined(FEAT_EVAL) || defined(PROTO)
/* /*
* Give an error message which contains %s for "name[len]". * Give an error message which contains %s for "name[len]".
*/ */
@@ -905,6 +908,7 @@ emsg_namelen(char *msg, char_u *name, int len)
semsg(msg, copy == NULL ? "NULL" : (char *)copy); semsg(msg, copy == NULL ? "NULL" : (char *)copy);
vim_free(copy); vim_free(copy);
} }
#endif
/* /*
* Like msg(), but truncate to a single line if p_shm contains 't', or when * Like msg(), but truncate to a single line if p_shm contains 't', or when

View File

@@ -1896,7 +1896,6 @@ vim_unsetenv(char_u *var)
vim_setenv(var, (char_u *)""); vim_setenv(var, (char_u *)"");
#endif #endif
} }
#endif
/* /*
@@ -1914,6 +1913,7 @@ vim_setenv_ext(char_u *name, char_u *val)
&& STRICMP(name, "VIMRUNTIME") == 0) && STRICMP(name, "VIMRUNTIME") == 0)
didset_vimruntime = FALSE; didset_vimruntime = FALSE;
} }
#endif
/* /*
* Our portable version of setenv. * Our portable version of setenv.
@@ -2230,6 +2230,7 @@ fast_breakcheck(void)
} }
} }
# if defined(FEAT_SPELL) || defined(PROTO)
/* /*
* Like line_breakcheck() but check 100 times less often. * Like line_breakcheck() but check 100 times less often.
*/ */
@@ -2242,6 +2243,7 @@ veryfast_breakcheck(void)
ui_breakcheck(); ui_breakcheck();
} }
} }
#endif
#if defined(VIM_BACKTICK) || defined(FEAT_EVAL) \ #if defined(VIM_BACKTICK) || defined(FEAT_EVAL) \
|| (defined(HAVE_LOCALE_H) || defined(X_LOCALE)) \ || (defined(HAVE_LOCALE_H) || defined(X_LOCALE)) \

View File

@@ -2424,6 +2424,7 @@ get_user_name(char_u *buf, int len)
return OK; return OK;
} }
#if defined(EXITFREE) || defined(PROTOS)
/* /*
* Free the memory allocated by get_user_name() * Free the memory allocated by get_user_name()
*/ */
@@ -2432,6 +2433,7 @@ free_username(void)
{ {
vim_free(username); vim_free(username);
} }
#endif
#ifndef HAVE_QSORT #ifndef HAVE_QSORT
/* /*

View File

@@ -3350,6 +3350,7 @@ free_operatorfunc_option(void)
} }
#endif #endif
#if defined(FEAT_EVAL) || defined(PROTO)
/* /*
* Mark the global 'operatorfunc' callback with 'copyID' so that it is not * Mark the global 'operatorfunc' callback with 'copyID' so that it is not
* garbage collected. * garbage collected.
@@ -3359,12 +3360,11 @@ set_ref_in_opfunc(int copyID UNUSED)
{ {
int abort = FALSE; int abort = FALSE;
#ifdef FEAT_EVAL
abort = set_ref_in_callback(&opfunc_cb, copyID); abort = set_ref_in_callback(&opfunc_cb, copyID);
#endif
return abort; return abort;
} }
#endif
/* /*
* Handle the "g@" operator: call 'operatorfunc'. * Handle the "g@" operator: call 'operatorfunc'.

View File

@@ -753,6 +753,7 @@ set_number_default(char *name, long val)
options[opt_idx].def_val[VI_DEFAULT] = (char_u *)(long_i)val; options[opt_idx].def_val[VI_DEFAULT] = (char_u *)(long_i)val;
} }
#if defined(FEAT_PROP_POPUP) || defined(PROTO)
/* /*
* Set all window-local and buffer-local options to the Vim default. * Set all window-local and buffer-local options to the Vim default.
* local-global options will use the global value. * local-global options will use the global value.
@@ -784,6 +785,7 @@ set_local_options_default(win_T *wp, int do_buffer)
curwin = save_curwin; curwin = save_curwin;
curbuf = curwin->w_buffer; curbuf = curwin->w_buffer;
} }
#endif
#if defined(EXITFREE) || defined(PROTO) #if defined(EXITFREE) || defined(PROTO)
/* /*
@@ -5535,6 +5537,7 @@ get_option_var(int opt_idx)
return options[opt_idx].var; return options[opt_idx].var;
} }
#if defined(FEAT_EVAL) || defined(PROTO)
/* /*
* Return the full name of the option at 'opt_idx' * Return the full name of the option at 'opt_idx'
*/ */
@@ -5543,6 +5546,7 @@ get_option_fullname(int opt_idx)
{ {
return (char_u *)options[opt_idx].fullname; return (char_u *)options[opt_idx].fullname;
} }
#endif
/* /*
* Get the value of 'equalprg', either the buffer-local one or the global one. * Get the value of 'equalprg', either the buffer-local one or the global one.

View File

@@ -486,7 +486,9 @@ EXTERN int p_deco; // 'delcombine'
EXTERN char_u *p_ccv; // 'charconvert' EXTERN char_u *p_ccv; // 'charconvert'
#endif #endif
EXTERN int p_cdh; // 'cdhome' EXTERN int p_cdh; // 'cdhome'
#ifdef FEAT_CINDENT
EXTERN char_u *p_cino; // 'cinoptions' EXTERN char_u *p_cino; // 'cinoptions'
#endif
#ifdef FEAT_CMDWIN #ifdef FEAT_CMDWIN
EXTERN char_u *p_cedit; // 'cedit' EXTERN char_u *p_cedit; // 'cedit'
EXTERN long p_cwh; // 'cmdwinheight' EXTERN long p_cwh; // 'cmdwinheight'
@@ -730,13 +732,6 @@ EXTERN char_u *p_mef; // 'makeef'
EXTERN char_u *p_mp; // 'makeprg' EXTERN char_u *p_mp; // 'makeprg'
#endif #endif
EXTERN char_u *p_mps; // 'matchpairs' EXTERN char_u *p_mps; // 'matchpairs'
#ifdef FEAT_SIGNS
EXTERN char_u *p_scl; // signcolumn
#endif
#ifdef FEAT_SYN_HL
EXTERN char_u *p_cc; // 'colorcolumn'
EXTERN int p_cc_cols[256]; // array for 'colorcolumn' columns
#endif
EXTERN long p_mat; // 'matchtime' EXTERN long p_mat; // 'matchtime'
EXTERN long p_mco; // 'maxcombine' EXTERN long p_mco; // 'maxcombine'
#ifdef FEAT_EVAL #ifdef FEAT_EVAL
@@ -840,7 +835,9 @@ EXTERN int p_ru; // 'ruler'
EXTERN char_u *p_ruf; // 'rulerformat' EXTERN char_u *p_ruf; // 'rulerformat'
#endif #endif
EXTERN char_u *p_pp; // 'packpath' EXTERN char_u *p_pp; // 'packpath'
#ifdef FEAT_QUICKFIX
EXTERN char_u *p_qftf; // 'quickfixtextfunc' EXTERN char_u *p_qftf; // 'quickfixtextfunc'
#endif
EXTERN char_u *p_rtp; // 'runtimepath' EXTERN char_u *p_rtp; // 'runtimepath'
EXTERN long p_sj; // 'scrolljump' EXTERN long p_sj; // 'scrolljump'
#if defined(MSWIN) && defined(FEAT_GUI) #if defined(MSWIN) && defined(FEAT_GUI)
@@ -949,7 +946,9 @@ EXTERN unsigned swb_flags;
#define SWB_NEWTAB 0x008 #define SWB_NEWTAB 0x008
#define SWB_VSPLIT 0x010 #define SWB_VSPLIT 0x010
#define SWB_USELAST 0x020 #define SWB_USELAST 0x020
#ifdef FEAT_SYN_HL
EXTERN char_u *p_syn; // 'syntax' EXTERN char_u *p_syn; // 'syntax'
#endif
EXTERN long p_ts; // 'tabstop' EXTERN long p_ts; // 'tabstop'
EXTERN int p_tbs; // 'tagbsearch' EXTERN int p_tbs; // 'tagbsearch'
EXTERN char_u *p_tc; // 'tagcase' EXTERN char_u *p_tc; // 'tagcase'
@@ -1026,8 +1025,8 @@ EXTERN unsigned ttym_flags;
# define TTYM_URXVT 0x40 # define TTYM_URXVT 0x40
# define TTYM_SGR 0x80 # define TTYM_SGR 0x80
#endif #endif
EXTERN char_u *p_udir; // 'undodir'
#ifdef FEAT_PERSISTENT_UNDO #ifdef FEAT_PERSISTENT_UNDO
EXTERN char_u *p_udir; // 'undodir'
EXTERN int p_udf; // 'undofile' EXTERN int p_udf; // 'undofile'
#endif #endif
EXTERN long p_ul; // 'undolevels' EXTERN long p_ul; // 'undolevels'

View File

@@ -454,6 +454,7 @@ set_string_option_direct_in_win(
unblock_autocmds(); unblock_autocmds();
} }
#if defined(FEAT_PROP_POPUP) || defined(PROTO)
/* /*
* Like set_string_option_direct(), but for a buffer-local option in "buf". * Like set_string_option_direct(), but for a buffer-local option in "buf".
* Blocks autocommands to avoid the old curbuf becoming invalid. * Blocks autocommands to avoid the old curbuf becoming invalid.
@@ -477,6 +478,7 @@ set_string_option_direct_in_buf(
curwin->w_buffer = curbuf; curwin->w_buffer = curbuf;
unblock_autocmds(); unblock_autocmds();
} }
#endif
/* /*
* Set a string option to a new value, and handle the effects. * Set a string option to a new value, and handle the effects.

View File

@@ -38,41 +38,53 @@ static void copy_yank_reg(yankreg_T *reg);
#endif #endif
static void dis_msg(char_u *p, int skip_esc); static void dis_msg(char_u *p, int skip_esc);
#if defined(FEAT_VIMINFO) || defined(PROTO)
yankreg_T * yankreg_T *
get_y_regs(void) get_y_regs(void)
{ {
return y_regs; return y_regs;
} }
#endif
#if defined(FEAT_CLIPBOARD) || defined(PROTO)
yankreg_T * yankreg_T *
get_y_register(int reg) get_y_register(int reg)
{ {
return &y_regs[reg]; return &y_regs[reg];
} }
#endif
#if defined(FEAT_CLIPBOARD) || defined(FEAT_VIMINFO) || defined(FEAT_EVAL) || defined(PROTO)
yankreg_T * yankreg_T *
get_y_current(void) get_y_current(void)
{ {
return y_current; return y_current;
} }
#endif
#if defined(FEAT_CLIPBOARD) || defined(FEAT_VIMINFO) || defined(PROTO)
yankreg_T * yankreg_T *
get_y_previous(void) get_y_previous(void)
{ {
return y_previous; return y_previous;
} }
#endif
#if defined(FEAT_CLIPBOARD) || defined(PROTO)
void void
set_y_current(yankreg_T *yreg) set_y_current(yankreg_T *yreg)
{ {
y_current = yreg; y_current = yreg;
} }
#endif
#if defined(FEAT_CLIPBOARD) || defined(FEAT_VIMINFO) || defined(PROTO)
void void
set_y_previous(yankreg_T *yreg) set_y_previous(yankreg_T *yreg)
{ {
y_previous = yreg; y_previous = yreg;
} }
#endif
void void
reset_y_append(void) reset_y_append(void)
@@ -474,6 +486,7 @@ stuff_yank(int regname, char_u *p)
*/ */
static int execreg_lastc = NUL; static int execreg_lastc = NUL;
#if defined(FEAT_VIMINFO) || defined(PROTO)
int int
get_execreg_lastc(void) get_execreg_lastc(void)
{ {
@@ -485,6 +498,7 @@ set_execreg_lastc(int lastc)
{ {
execreg_lastc = lastc; execreg_lastc = lastc;
} }
#endif
/* /*
* When executing a register as a series of ex-commands, if the * When executing a register as a series of ex-commands, if the
@@ -2308,6 +2322,7 @@ get_register_name(int num)
} }
} }
#if defined(FEAT_EVAL) || defined(PROTO)
/* /*
* Return the index of the register "" points to. * Return the index of the register "" points to.
*/ */
@@ -2316,6 +2331,7 @@ get_unname_register()
{ {
return y_previous == NULL ? -1 : y_previous - &y_regs[0]; return y_previous == NULL ? -1 : y_previous - &y_regs[0];
} }
#endif
/* /*
* ":dis" and ":registers": Display the contents of the yank registers. * ":dis" and ":registers": Display the contents of the yank registers.

View File

@@ -1635,8 +1635,6 @@ free_autoload_scriptnames(void)
} }
# endif # endif
#endif
linenr_T linenr_T
get_sourced_lnum( get_sourced_lnum(
char_u *(*fgetline)(int, void *, int, getline_opt_T), char_u *(*fgetline)(int, void *, int, getline_opt_T),
@@ -1646,6 +1644,7 @@ get_sourced_lnum(
? ((source_cookie_T *)cookie)->sourcing_lnum ? ((source_cookie_T *)cookie)->sourcing_lnum
: SOURCING_LNUM; : SOURCING_LNUM;
} }
#endif
static char_u * static char_u *
get_one_sourceline(source_cookie_T *sp) get_one_sourceline(source_cookie_T *sp)

View File

@@ -102,6 +102,7 @@ static callback_T tfu_cb; // 'tagfunc' callback function
// Used instead of NUL to separate tag fields in the growarrays. // Used instead of NUL to separate tag fields in the growarrays.
#define TAG_SEP 0x02 #define TAG_SEP 0x02
#if defined(FEAT_EVAL) || defined(PROTO)
/* /*
* Reads the 'tagfunc' option value and convert that to a callback value. * Reads the 'tagfunc' option value and convert that to a callback value.
* Invoked when the 'tagfunc' option is set. The option value can be a name of * Invoked when the 'tagfunc' option is set. The option value can be a name of
@@ -125,8 +126,9 @@ set_tagfunc_option(void)
return OK; return OK;
} }
#endif
#if defined(EXITFREE) || defined(PROTO) # if defined(EXITFREE) || defined(PROTO)
void void
free_tagfunc_option(void) free_tagfunc_option(void)
{ {
@@ -134,8 +136,9 @@ free_tagfunc_option(void)
free_callback(&tfu_cb); free_callback(&tfu_cb);
# endif # endif
} }
#endif # endif
#if defined(FEAT_EVAL) || defined(PROTO)
/* /*
* Mark the global 'tagfunc' callback with 'copyID' so that it is not garbage * Mark the global 'tagfunc' callback with 'copyID' so that it is not garbage
* collected. * collected.
@@ -145,9 +148,7 @@ set_ref_in_tagfunc(int copyID UNUSED)
{ {
int abort = FALSE; int abort = FALSE;
#ifdef FEAT_EVAL
abort = set_ref_in_callback(&tfu_cb, copyID); abort = set_ref_in_callback(&tfu_cb, copyID);
#endif
return abort; return abort;
} }
@@ -159,12 +160,11 @@ set_ref_in_tagfunc(int copyID UNUSED)
void void
set_buflocal_tfu_callback(buf_T *buf UNUSED) set_buflocal_tfu_callback(buf_T *buf UNUSED)
{ {
#ifdef FEAT_EVAL
free_callback(&buf->b_tfu_cb); free_callback(&buf->b_tfu_cb);
if (tfu_cb.cb_name != NULL && *tfu_cb.cb_name != NUL) if (tfu_cb.cb_name != NULL && *tfu_cb.cb_name != NUL)
copy_callback(&buf->b_tfu_cb, &tfu_cb); copy_callback(&buf->b_tfu_cb, &tfu_cb);
#endif
} }
#endif
/* /*
* Jump to tag; handling of tag commands and tag stack * Jump to tag; handling of tag commands and tag stack

View File

@@ -3991,6 +3991,7 @@ cursor_off(void)
} }
} }
#ifdef FEAT_GUI
/* /*
* Check whether the cursor is invisible due to an ongoing cursor-less sleep * Check whether the cursor is invisible due to an ongoing cursor-less sleep
*/ */
@@ -3999,6 +4000,7 @@ cursor_is_sleeping(void)
{ {
return cursor_is_asleep; return cursor_is_asleep;
} }
#endif
/* /*
* Disable the cursor and mark it disabled by cursor-less sleep * Disable the cursor and mark it disabled by cursor-less sleep

View File

@@ -528,6 +528,7 @@ check_for_opt_dict_arg(typval_T *args, int idx)
|| check_for_dict_arg(args, idx) != FAIL); || check_for_dict_arg(args, idx) != FAIL);
} }
#if defined(FEAT_JOB_CHANNEL) || defined(PROTO)
/* /*
* Give an error and return FAIL unless "args[idx]" is a channel or a job. * Give an error and return FAIL unless "args[idx]" is a channel or a job.
*/ */
@@ -576,6 +577,7 @@ check_for_opt_job_arg(typval_T *args, int idx)
return (args[idx].v_type == VAR_UNKNOWN return (args[idx].v_type == VAR_UNKNOWN
|| check_for_job_arg(args, idx) != FAIL); || check_for_job_arg(args, idx) != FAIL);
} }
#endif
/* /*
* Give an error and return FAIL unless "args[idx]" is a string or * Give an error and return FAIL unless "args[idx]" is a string or
@@ -642,6 +644,7 @@ check_for_opt_lnum_arg(typval_T *args, int idx)
|| check_for_lnum_arg(args, idx)); || check_for_lnum_arg(args, idx));
} }
#if defined(FEAT_JOB_CHANNEL) || defined(PROTO)
/* /*
* Give an error and return FAIL unless "args[idx]" is a string or a blob. * Give an error and return FAIL unless "args[idx]" is a string or a blob.
*/ */
@@ -655,6 +658,7 @@ check_for_string_or_blob_arg(typval_T *args, int idx)
} }
return OK; return OK;
} }
#endif
/* /*
* Give an error and return FAIL unless "args[idx]" is a string or a list. * Give an error and return FAIL unless "args[idx]" is a string or a list.

View File

@@ -319,6 +319,7 @@ get_user_commands(expand_T *xp UNUSED, int idx)
return NULL; return NULL;
} }
#ifdef FEAT_EVAL
/* /*
* Get the name of user command "idx". "cmdidx" can be CMD_USER or * Get the name of user command "idx". "cmdidx" can be CMD_USER or
* CMD_USER_BUF. * CMD_USER_BUF.
@@ -343,6 +344,7 @@ get_user_command_name(int idx, int cmdidx)
} }
return NULL; return NULL;
} }
#endif
/* /*
* Function given to ExpandGeneric() to obtain the list of user address type * Function given to ExpandGeneric() to obtain the list of user address type
@@ -394,6 +396,7 @@ get_user_cmd_complete(expand_T *xp UNUSED, int idx)
return (char_u *)command_complete[idx].name; return (char_u *)command_complete[idx].name;
} }
#ifdef FEAT_EVAL
int int
cmdcomplete_str_to_type(char_u *complete_str) cmdcomplete_str_to_type(char_u *complete_str)
{ {
@@ -405,6 +408,7 @@ cmdcomplete_str_to_type(char_u *complete_str)
return EXPAND_NOTHING; return EXPAND_NOTHING;
} }
#endif
/* /*
* List user commands starting with "name[name_len]". * List user commands starting with "name[name_len]".

View File

@@ -39,6 +39,7 @@ func_init()
hash_init(&func_hashtab); hash_init(&func_hashtab);
} }
#if defined(FEAT_PROFILE) || defined(PROTO)
/* /*
* Return the function hash table * Return the function hash table
*/ */
@@ -47,6 +48,7 @@ func_tbl_get(void)
{ {
return &func_hashtab; return &func_hashtab;
} }
#endif
/* /*
* Get one function argument. * Get one function argument.

View File

@@ -750,6 +750,8 @@ static char *(features[]) =
static int included_patches[] = static int included_patches[] =
{ /* Add new patch number below this line */ { /* Add new patch number below this line */
/**/
4038,
/**/ /**/
4037, 4037,
/**/ /**/

View File

@@ -115,6 +115,7 @@ ex_vim9script(exarg_T *eap UNUSED)
#endif #endif
} }
#if defined(FEAT_EVAL) || defined(PROTO)
/* /*
* When in Vim9 script give an error and return FAIL. * When in Vim9 script give an error and return FAIL.
*/ */
@@ -159,6 +160,7 @@ vim9_bad_comment(char_u *p)
} }
return FALSE; return FALSE;
} }
#endif
/* /*
* Return TRUE if "p" points at a "#" not followed by one '{'. * Return TRUE if "p" points at a "#" not followed by one '{'.

View File

@@ -531,12 +531,6 @@ check_typval_type(type_T *expected, typval_T *actual_tv, where_T where)
return res; return res;
} }
void
type_mismatch(type_T *expected, type_T *actual)
{
arg_type_mismatch(expected, actual, 0);
}
void void
arg_type_mismatch(type_T *expected, type_T *actual, int arg_idx) arg_type_mismatch(type_T *expected, type_T *actual, int arg_idx)
{ {