summaryrefslogtreecommitdiff
path: root/data/vim/patches/8.1.0183
blob: f21beffc53002649b469b0a3f0d684d98706cd63 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
To: vim_dev@googlegroups.com
Subject: Patch 8.1.0183
Fcc: outbox
From: Bram Moolenaar <Bram@moolenaar.net>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
------------

Patch 8.1.0183
Problem:    Lua API changed, breaking the build.
Solution:   Adjust prototype of lua_rawgeti(). (Ken Takata,
            closes #3157, closes #3144)
Files:	    src/if_lua.c


*** ../vim-8.1.0182/src/if_lua.c	Fri Jul 13 22:08:19 2018
--- src/if_lua.c	Sat Jul 14 20:48:49 2018
***************
*** 253,266 ****
--- 253,275 ----
  void (*dll_lua_pushboolean) (lua_State *L, int b);
  void (*dll_lua_pushlightuserdata) (lua_State *L, void *p);
  void (*dll_lua_getfield) (lua_State *L, int idx, const char *k);
+ #if LUA_VERSION_NUM <= 502
  void (*dll_lua_rawget) (lua_State *L, int idx);
  void (*dll_lua_rawgeti) (lua_State *L, int idx, int n);
+ #else
+ int (*dll_lua_rawget) (lua_State *L, int idx);
+ int (*dll_lua_rawgeti) (lua_State *L, int idx, lua_Integer n);
+ #endif
  void (*dll_lua_createtable) (lua_State *L, int narr, int nrec);
  void *(*dll_lua_newuserdata) (lua_State *L, size_t sz);
  int (*dll_lua_getmetatable) (lua_State *L, int objindex);
  void (*dll_lua_setfield) (lua_State *L, int idx, const char *k);
  void (*dll_lua_rawset) (lua_State *L, int idx);
+ #if LUA_VERSION_NUM <= 502
  void (*dll_lua_rawseti) (lua_State *L, int idx, int n);
+ #else
+ void (*dll_lua_rawseti) (lua_State *L, int idx, lua_Integer n);
+ #endif
  int (*dll_lua_setmetatable) (lua_State *L, int objindex);
  int (*dll_lua_next) (lua_State *L, int idx);
  /* libs */
***************
*** 962,968 ****
  	return 0;
      if (*key == NUL)
  	luaL_error(L, "empty key");
!     if (!lua_isnil(L, 3)) { /* read value? */
  	luaV_checktypval(L, 3, &v, "setting dict item");
  	if (d->dv_scope == VAR_DEF_SCOPE && v.v_type == VAR_FUNC)
  	    luaL_error(L, "cannot assign funcref to builtin scope");
--- 971,978 ----
  	return 0;
      if (*key == NUL)
  	luaL_error(L, "empty key");
!     if (!lua_isnil(L, 3)) /* read value? */
!     {
  	luaV_checktypval(L, 3, &v, "setting dict item");
  	if (d->dv_scope == VAR_DEF_SCOPE && v.v_type == VAR_FUNC)
  	    luaL_error(L, "cannot assign funcref to builtin scope");
***************
*** 1074,1080 ****
  	status = FAIL;
      else
      {
! 	for (i = 0; i < n; i++) {
  	    luaV_checktypval(L, i + 2, &v, "calling funcref");
  	    list_append_tv(f->args.vval.v_list, &v);
  	}
--- 1084,1091 ----
  	status = FAIL;
      else
      {
! 	for (i = 0; i < n; i++)
! 	{
  	    luaV_checktypval(L, i + 2, &v, "calling funcref");
  	    list_append_tv(f->args.vval.v_list, &v);
  	}
***************
*** 1531,1543 ****
      else
      {
  	luaV_newlist(L, l);
! 	if (initarg) { /* traverse table to init dict */
  	    int notnil, i = 0;
  	    typval_T v;
! 	    do {
  		lua_rawgeti(L, 1, ++i);
  		notnil = !lua_isnil(L, -1);
! 		if (notnil) {
  		    luaV_checktypval(L, -1, &v, "vim.list");
  		    list_append_tv(l, &v);
  		}
--- 1542,1557 ----
      else
      {
  	luaV_newlist(L, l);
! 	if (initarg) /* traverse table to init list */
! 	{
  	    int notnil, i = 0;
  	    typval_T v;
! 	    do
! 	    {
  		lua_rawgeti(L, 1, ++i);
  		notnil = !lua_isnil(L, -1);
! 		if (notnil)
! 		{
  		    luaV_checktypval(L, -1, &v, "vim.list");
  		    list_append_tv(l, &v);
  		}
*** ../vim-8.1.0182/src/version.c	Sat Jul 14 19:30:32 2018
--- src/version.c	Sat Jul 14 20:49:07 2018
***************
*** 791,792 ****
--- 791,794 ----
  {   /* Add new patch number below this line */
+ /**/
+     183,
  /**/

-- 
Hear about the guy who played a blank tape at full blast?
The mime next door went nuts.

 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///