Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
...
Checking mergeability… Don't worry, you can still create the pull request.
  • 8 commits
  • 13 files changed
  • 0 commit comments
  • 1 contributor
Commits on Feb 14, 2013
Bram Moolenaar updated for version 7.3.817
Problem:    Test 89 fails with tiny and small features.
Solution:   Add sourcing small.vim.
42b5592
Bram Moolenaar Added tag v7-3-817 for changeset 01fa9313d4b5 07289cb
Bram Moolenaar updated for version 7.3.818
Problem:    When test 40 fails because of a bad build it may leave files
	    behind that cause it to fail later.
Solution:   Let the file names start with "X".
21039e5
Bram Moolenaar Added tag v7-3-818 for changeset ad7b6062a7f4 9fca585
Bram Moolenaar updated for version 7.3.819
Problem:    Compiling without +eval and with Python isn't working.
Solution:   Add the eval feature when building with Python.
6a60817
Bram Moolenaar Added tag v7-3-819 for changeset 36fd800b8c6c b65722a
Bram Moolenaar updated for version 7.3.820
Problem:    Build errors and warnings when building with small features and
	    Lua, Perl or Ruby.
Solution:   Add #ifdefs and UNUSED.
68f9d84
Bram Moolenaar Added tag v7-3-820 for changeset 688da4d486a0 d9a4318
View
4 .hgtags
@@ -2153,3 +2153,7 @@ ad21448af931b3923d9b76e4efdcf0e966c9d199 v7-3-811
d5b1d6177b374bbecfbd5c75fbce28e148eeecea v7-3-814
448a6e7cf32e14a4adcbc4066743e2f058f7e1c0 v7-3-815
2b340e5c5baaf66015f3367208d9bf22ce1dfc8e v7-3-816
+01fa9313d4b560997234b94b2408e6bf64808afc v7-3-817
+ad7b6062a7f4041b736d45c5f045671d60eb782f v7-3-818
+36fd800b8c6c527c75bfe285d0ed0c3bc1cf45f7 v7-3-819
+688da4d486a019afa3565ffc553af6ee1a4e67d8 v7-3-820
View
82 src/eval.c
@@ -917,7 +917,9 @@ eval_clear()
hash_clear(&compat_hashtab);
free_scriptnames();
+# if defined(FEAT_CMDL_COMPL)
free_locales();
+# endif
/* global variables */
vars_clear(&globvarht);
@@ -1561,8 +1563,6 @@ eval_expr(arg, nextcmd)
}
-#if (defined(FEAT_USR_CMDS) && defined(FEAT_CMDL_COMPL)) \
- || defined(FEAT_COMPL_FUNC) || defined(PROTO)
/*
* Call some vimL function and return the result in "*rettv".
* Uses argv[argc] for the function arguments. Only Number and String
@@ -1640,53 +1640,54 @@ call_vim_function(func, argc, argv, safe, str_arg_only, rettv)
return ret;
}
-# if (defined(FEAT_USR_CMDS) && defined(FEAT_CMDL_COMPL)) || defined(PROTO)
/*
- * Call vimL function "func" and return the result as a string.
- * Returns NULL when calling the function fails.
+ * Call vimL function "func" and return the result as a number.
+ * Returns -1 when calling the function fails.
* Uses argv[argc] for the function arguments.
*/
- void *
-call_func_retstr(func, argc, argv, safe)
+ long
+call_func_retnr(func, argc, argv, safe)
char_u *func;
int argc;
char_u **argv;
int safe; /* use the sandbox */
{
typval_T rettv;
- char_u *retval;
+ long retval;
/* All arguments are passed as strings, no conversion to number. */
if (call_vim_function(func, argc, argv, safe, TRUE, &rettv) == FAIL)
- return NULL;
+ return -1;
- retval = vim_strsave(get_tv_string(&rettv));
+ retval = get_tv_number_chk(&rettv, NULL);
clear_tv(&rettv);
return retval;
}
-# endif
-# if defined(FEAT_COMPL_FUNC) || defined(PROTO)
+#if (defined(FEAT_USR_CMDS) && defined(FEAT_CMDL_COMPL)) \
+ || defined(FEAT_COMPL_FUNC) || defined(PROTO)
+
+# if (defined(FEAT_USR_CMDS) && defined(FEAT_CMDL_COMPL)) || defined(PROTO)
/*
- * Call vimL function "func" and return the result as a number.
- * Returns -1 when calling the function fails.
+ * Call vimL function "func" and return the result as a string.
+ * Returns NULL when calling the function fails.
* Uses argv[argc] for the function arguments.
*/
- long
-call_func_retnr(func, argc, argv, safe)
+ void *
+call_func_retstr(func, argc, argv, safe)
char_u *func;
int argc;
char_u **argv;
int safe; /* use the sandbox */
{
typval_T rettv;
- long retval;
+ char_u *retval;
/* All arguments are passed as strings, no conversion to number. */
if (call_vim_function(func, argc, argv, safe, TRUE, &rettv) == FAIL)
- return -1;
+ return NULL;
- retval = get_tv_number_chk(&rettv, NULL);
+ retval = vim_strsave(get_tv_string(&rettv));
clear_tv(&rettv);
return retval;
}
@@ -1720,7 +1721,6 @@ call_func_retlist(func, argc, argv, safe)
}
#endif
-
/*
* Save the current function call pointer, and set it to NULL.
* Used when executing autocommands and for ":source".
@@ -9330,7 +9330,7 @@ f_char2nr(argvars, rettv)
*/
static void
f_cindent(argvars, rettv)
- typval_T *argvars;
+ typval_T *argvars UNUSED;
typval_T *rettv;
{
#ifdef FEAT_CINDENT
@@ -10379,9 +10379,9 @@ static void findfilendir __ARGS((typval_T *argvars, typval_T *rettv, int find_wh
static void
findfilendir(argvars, rettv, find_what)
- typval_T *argvars;
+ typval_T *argvars UNUSED;
typval_T *rettv;
- int find_what;
+ int find_what UNUSED;
{
#ifdef FEAT_SEARCHPATH
char_u *fname;
@@ -10751,9 +10751,9 @@ static void foldclosed_both __ARGS((typval_T *argvars, typval_T *rettv, int end)
*/
static void
foldclosed_both(argvars, rettv, end)
- typval_T *argvars;
+ typval_T *argvars UNUSED;
typval_T *rettv;
- int end;
+ int end UNUSED;
{
#ifdef FEAT_FOLDING
linenr_T lnum;
@@ -10802,8 +10802,8 @@ f_foldclosedend(argvars, rettv)
*/
static void
f_foldlevel(argvars, rettv)
- typval_T *argvars;
- typval_T *rettv;
+ typval_T *argvars UNUSED;
+ typval_T *rettv UNUSED;
{
#ifdef FEAT_FOLDING
linenr_T lnum;
@@ -11583,7 +11583,7 @@ f_getline(argvars, rettv)
static void
f_getmatches(argvars, rettv)
typval_T *argvars UNUSED;
- typval_T *rettv;
+ typval_T *rettv UNUSED;
{
#ifdef FEAT_SEARCH_EXTRA
dict_T *dict;
@@ -13589,7 +13589,7 @@ f_line2byte(argvars, rettv)
*/
static void
f_lispindent(argvars, rettv)
- typval_T *argvars;
+ typval_T *argvars UNUSED;
typval_T *rettv;
{
#ifdef FEAT_LISP
@@ -13983,8 +13983,8 @@ f_match(argvars, rettv)
*/
static void
f_matchadd(argvars, rettv)
- typval_T *argvars;
- typval_T *rettv;
+ typval_T *argvars UNUSED;
+ typval_T *rettv UNUSED;
{
#ifdef FEAT_SEARCH_EXTRA
char_u buf[NUMBUFLEN];
@@ -14021,7 +14021,7 @@ f_matchadd(argvars, rettv)
*/
static void
f_matcharg(argvars, rettv)
- typval_T *argvars;
+ typval_T *argvars UNUSED;
typval_T *rettv;
{
if (rettv_list_alloc(rettv) == OK)
@@ -14053,8 +14053,8 @@ f_matcharg(argvars, rettv)
*/
static void
f_matchdelete(argvars, rettv)
- typval_T *argvars;
- typval_T *rettv;
+ typval_T *argvars UNUSED;
+ typval_T *rettv UNUSED;
{
#ifdef FEAT_SEARCH_EXTRA
rettv->vval.v_number = match_delete(curwin,
@@ -14871,8 +14871,8 @@ list2proftime(arg, tm)
*/
static void
f_reltime(argvars, rettv)
- typval_T *argvars;
- typval_T *rettv;
+ typval_T *argvars UNUSED;
+ typval_T *rettv UNUSED;
{
#ifdef FEAT_RELTIME
proftime_T res;
@@ -14920,7 +14920,7 @@ f_reltime(argvars, rettv)
*/
static void
f_reltimestr(argvars, rettv)
- typval_T *argvars;
+ typval_T *argvars UNUSED;
typval_T *rettv;
{
#ifdef FEAT_RELTIME
@@ -15965,7 +15965,7 @@ do_searchpair(spat, mpat, epat, dir, skip, flags, match_pos,
int flags; /* SP_SETPCMARK and other SP_ values */
pos_T *match_pos;
linenr_T lnum_stop; /* stop at this line if not zero */
- long time_limit; /* stop after this many msec */
+ long time_limit UNUSED; /* stop after this many msec */
{
char_u *save_cpo;
char_u *pat, *pat2 = NULL, *pat3 = NULL;
@@ -16390,8 +16390,8 @@ f_setloclist(argvars, rettv)
*/
static void
f_setmatches(argvars, rettv)
- typval_T *argvars;
- typval_T *rettv;
+ typval_T *argvars UNUSED;
+ typval_T *rettv UNUSED;
{
#ifdef FEAT_SEARCH_EXTRA
list_T *l;
@@ -18463,7 +18463,7 @@ f_type(argvars, rettv)
*/
static void
f_undofile(argvars, rettv)
- typval_T *argvars;
+ typval_T *argvars UNUSED;
typval_T *rettv;
{
rettv->v_type = VAR_STRING;
View
12 src/ex_docmd.c
@@ -1734,6 +1734,8 @@ do_one_cmd(cmdlinep, sourcing,
#ifdef FEAT_EVAL
/* avoid that a function call in 'statusline' does this */
&& !getline_equal(fgetline, cookie, get_func_line)
+#endif
+#ifdef FEAT_AUTOCMD
/* avoid that an autocommand, e.g. QuitPre, does this */
&& !getline_equal(fgetline, cookie, getnextac)
#endif
@@ -5375,7 +5377,9 @@ uc_add_command(name, name_len, rep, argt, def, flags, compl, compl_arg, force)
#endif
return FAIL;
}
+#endif
+#if defined(FEAT_USR_CMDS) || defined(FEAT_EVAL) || defined(PROTO)
/*
* List of names for completion for ":command" with the EXPAND_ flag.
* Must be alphabetical for completion.
@@ -5430,7 +5434,9 @@ static struct
{EXPAND_USER_VARS, "var"},
{0, NULL}
};
+#endif
+#if defined(FEAT_USR_CMDS) || defined(PROTO)
static void
uc_list(name, name_len)
char_u *name;
@@ -6375,10 +6381,12 @@ parse_compl_arg(value, vallen, complp, argt, compl_arg)
int vallen;
int *complp;
long *argt;
- char_u **compl_arg;
+ char_u **compl_arg UNUSED;
{
char_u *arg = NULL;
+# if defined(FEAT_EVAL) && defined(FEAT_CMDL_COMPL)
size_t arglen = 0;
+# endif
int i;
int valend = vallen;
@@ -6388,7 +6396,9 @@ parse_compl_arg(value, vallen, complp, argt, compl_arg)
if (value[i] == ',')
{
arg = &value[i + 1];
+# if defined(FEAT_EVAL) && defined(FEAT_CMDL_COMPL)
arglen = vallen - i - 1;
+# endif
valend = i;
break;
}
View
7 src/feature.h
@@ -392,6 +392,13 @@
#endif
/*
+ * +python and +python3 require FEAT_EVAL.
+ */
+#if !defined(FEAT_EVAL) && (defined(FEAT_PYTHON3) || defined(FEAT_PYTHON))
+# define FEAT_EVAL
+#endif
+
+/*
* +profile Profiling for functions and scripts.
*/
#if defined(FEAT_HUGE) \
View
3  src/gui_gtk_x11.c
@@ -5164,8 +5164,7 @@ gui_mch_haskey(char_u *name)
return FAIL;
}
-#if defined(FEAT_TITLE) \
- || defined(PROTO)
+#if defined(FEAT_TITLE) || defined(FEAT_EVAL) || defined(PROTO)
/*
* Return the text window-id and display. Only required for X-based GUI's
*/
View
6 src/if_lua.c
@@ -845,8 +845,9 @@ luaV_dict_len (lua_State *L)
}
static int
-luaV_dict_iter (lua_State *L)
+luaV_dict_iter (lua_State *L UNUSED)
{
+#ifdef FEAT_EVAL
hashitem_T *hi = (hashitem_T *) lua_touserdata(L, lua_upvalueindex(2));
int n = lua_tointeger(L, lua_upvalueindex(3));
dictitem_T *di;
@@ -860,6 +861,9 @@ luaV_dict_iter (lua_State *L)
lua_pushinteger(L, n - 1);
lua_replace(L, lua_upvalueindex(3));
return 2;
+#else
+ return 0;
+#endif
}
static int
View
6 src/if_perl.xs
@@ -600,9 +600,9 @@ msg_split(s, attr)
*/
char_u *
eval_to_string(arg, nextcmd, dolist)
- char_u *arg;
- char_u **nextcmd;
- int dolist;
+ char_u *arg UNUSED;
+ char_u **nextcmd UNUSED;
+ int dolist UNUSED;
{
return NULL;
}
View
16 src/if_py_both.h
@@ -310,7 +310,6 @@ VimCommand(PyObject *self UNUSED, PyObject *args)
return result;
}
-#ifdef FEAT_EVAL
/*
* Function to translate a typval_T into a PyObject; this will recursively
* translate lists/dictionaries into their Python equivalents.
@@ -425,12 +424,10 @@ VimToPython(typval_T *our_tv, int depth, PyObject *lookupDict)
return result;
}
-#endif
static PyObject *
VimEval(PyObject *self UNUSED, PyObject *args UNUSED)
{
-#ifdef FEAT_EVAL
char *expr;
typval_T *our_tv;
PyObject *result;
@@ -466,10 +463,6 @@ VimEval(PyObject *self UNUSED, PyObject *args UNUSED)
Py_END_ALLOW_THREADS
return result;
-#else
- PyErr_SetVim(_("expressions disabled at compile time"));
- return NULL;
-#endif
}
static PyObject *ConvertToPyObject(typval_T *);
@@ -477,7 +470,6 @@ static PyObject *ConvertToPyObject(typval_T *);
static PyObject *
VimEvalPy(PyObject *self UNUSED, PyObject *args UNUSED)
{
-#ifdef FEAT_EVAL
char *expr;
typval_T *our_tv;
PyObject *result;
@@ -506,10 +498,6 @@ VimEvalPy(PyObject *self UNUSED, PyObject *args UNUSED)
Py_END_ALLOW_THREADS
return result;
-#else
- PyErr_SetVim(_("expressions disabled at compile time"));
- return NULL;
-#endif
}
static PyObject *
@@ -946,7 +934,7 @@ DictionaryAssItem(PyObject *self, PyObject *keyObject, PyObject *valObject)
}
static PyObject *
-DictionaryListKeys(PyObject *self)
+DictionaryListKeys(PyObject *self UNUSED)
{
dict_T *dict = ((DictionaryObject *)(self))->dict;
long_u todo = dict->dv_hashtab.ht_used;
@@ -2549,7 +2537,6 @@ set_string_copy(char_u *str, typval_T *tv)
return 0;
}
-#ifdef FEAT_EVAL
typedef int (*pytotvfunc)(PyObject *, typval_T *, PyObject *);
static int
@@ -2781,4 +2768,3 @@ ConvertToPyObject(typval_T *tv)
return NULL;
}
}
-#endif
View
10 src/if_ruby.c
@@ -1210,21 +1210,21 @@ static VALUE window_set_height(VALUE self, VALUE height)
return height;
}
-static VALUE window_width(VALUE self)
+static VALUE window_width(VALUE self UNUSED)
{
- win_T *win = get_win(self);
-
- return INT2NUM(win->w_width);
+ return INT2NUM(W_WIDTH(get_win(self)));
}
-static VALUE window_set_width(VALUE self, VALUE width)
+static VALUE window_set_width(VALUE self UNUSED, VALUE width)
{
+#ifdef FEAT_VERTSPLIT
win_T *win = get_win(self);
win_T *savewin = curwin;
curwin = win;
win_setwidth(NUM2INT(width));
curwin = savewin;
+#endif
return width;
}
View
6 src/normal.c
@@ -2292,7 +2292,9 @@ op_function(oap)
{
#ifdef FEAT_EVAL
char_u *(argv[1]);
+# ifdef FEAT_VIRTUALEDIT
int save_virtual_op = virtual_op;
+# endif
if (*p_opfunc == NUL)
EMSG(_("E774: 'operatorfunc' is empty"));
@@ -2312,13 +2314,17 @@ op_function(oap)
else
argv[0] = (char_u *)"char";
+# ifdef FEAT_VIRTUALEDIT
/* Reset virtual_op so that 'virtualedit' can be changed in the
* function. */
virtual_op = MAYBE;
+# endif
(void)call_func_retnr(p_opfunc, 1, argv, FALSE);
+# ifdef FEAT_VIRTUALEDIT
virtual_op = save_virtual_op;
+# endif
}
#else
EMSG(_("E775: Eval feature not available"));
View
30 src/testdir/test40.in
@@ -3,18 +3,18 @@ Test for "*Cmd" autocommands
STARTTEST
:so small.vim
:/^start/,$w! Xxx " write lines below to Xxx
-:au BufReadCmd testA 0r Xxx|$del
-:e testA " will read text of Xxd instead
-:au BufWriteCmd testA call append(line("$"), "write")
+:au BufReadCmd XtestA 0r Xxx|$del
+:e XtestA " will read text of Xxd instead
+:au BufWriteCmd XtestA call append(line("$"), "write")
:w " will append a line to the file
-:r testA " should not read anything
+:r XtestA " should not read anything
: " now we have:
: " 1 start of Xxx
: " 2 test40
: " 3 end of Xxx
: " 4 write
-:au FileReadCmd testB '[r Xxx
-:2r testB " will read Xxx below line 2 instead
+:au FileReadCmd XtestB '[r Xxx
+:2r XtestB " will read Xxx below line 2 instead
: " 1 start of Xxx
: " 2 test40
: " 3 start of Xxx
@@ -22,10 +22,10 @@ STARTTEST
: " 5 end of Xxx
: " 6 end of Xxx
: " 7 write
-:au FileWriteCmd testC '[,']copy $
+:au FileWriteCmd XtestC '[,']copy $
4GA1
-:4,5w testC " will copy lines 4 and 5 to the end
-:r testC " should not read anything
+:4,5w XtestC " will copy lines 4 and 5 to the end
+:r XtestC " should not read anything
: " 1 start of Xxx
: " 2 test40
: " 3 start of Xxx
@@ -35,14 +35,14 @@ STARTTEST
: " 7 write
: " 8 test401
: " 9 end of Xxx
-:au FILEAppendCmd testD '[,']w! test.out
-:w >>testD " will write all lines to test.out
-:$r testD " should not read anything
+:au FILEAppendCmd XtestD '[,']w! test.out
+:w >>XtestD " will write all lines to test.out
+:$r XtestD " should not read anything
:$w >>test.out " append "end of Xxx" to test.out
-:au BufReadCmd testE 0r test.out|$del
-:sp testE " split window with test.out
+:au BufReadCmd XtestE 0r test.out|$del
+:sp XtestE " split window with test.out
5Goasdf:"
-:au BufWriteCmd testE w! test.out
+:au BufWriteCmd XtestE w! test.out
:wall " will write other window to test.out
: " 1 start of Xxx
: " 2 test40
View
1  src/testdir/test89.in
@@ -1,6 +1,7 @@
Some tests for setting 'number' and 'relativenumber'
STARTTEST
+:so small.vim
:set hidden nocp nu rnu
:redir @a | set nu? rnu? | redir END
:e! xx
View
8 src/version.c
@@ -726,6 +726,14 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 820,
+/**/
+ 819,
+/**/
+ 818,
+/**/
+ 817,
+/**/
816,
/**/
815,

No commit comments for this range

Something went wrong with that request. Please try again.