Re: Patch 8.2.1880
John Marriott wrote: > On 22-Oct-2020 01:50, Bram Moolenaar wrote: > > Patch 8.2.1880 > > Problem:Vim9: Asan complains about adding zero to NULL. > > Solution: Check for argument count first. > > Files: src/vim9compile.c > > > > > > > After this patch mingw64 (gcc 10.2) throws this warning: > > gcc -c -I. -Iproto -DWIN32 -DWINVER=0x0603 -D_WIN32_WINNT=0x0603 > -DHAVE_PATHDEF -DFEAT_NORMAL -DHAVE_STDINT_H -D__USE_MINGW_ANSI_STDIO > -pipe -march=native -Wall -O3 -fomit-frame-pointer -freg-struct-return > -fpie -fPIE -DFEAT_GUI_MSWIN -DFEAT_CLIPBOARD vim9compile.c -o > gobjnative/vim9compile.o > vim9compile.c: In function 'compile_call': > vim9compile.c:1496:6: warning: 'argtypes' may be used uninitialized in > this function [-Wmaybe-uninitialized] > 1496 | internal_func_ret_type(func_idx, argcount, argtypes); > | ^~~~ > vim9compile.c:1463:14: note: 'argtypes' was declared here > 1463 | type_T **argtypes; > | ^~~~ > > > Not sure what the fix should be. Perhaps as simple as initialising > argtypes to NULL? Using NULL should work. -- Contrary to popular belief, Unix is user friendly. It just happens to be selective about who it makes friends with. -- Dave Parnas /// Bram Moolenaar -- b...@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/// -- -- You received this message from the "vim_dev" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php --- You received this message because you are subscribed to the Google Groups "vim_dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/vim_dev/202010212037.09LKbjJ4175081%40masaka.moolenaar.net.
Patch 8.2.1883
Patch 8.2.1883 Problem:Compiler warnings when using Python. Solution: Adjust PyCFunction to also have the second argument. Use "int" return type for some functions. Insert "(void *)" to get rid of the remaining warnings. Files: src/if_py_both.h, src/if_python.c, src/if_python3.c *** ../vim-8.2.1882/src/if_py_both.h2020-10-11 18:04:58.284030792 +0200 --- src/if_py_both.h2020-10-21 20:57:42.379092835 +0200 *** *** 324,330 }; static PyObject * ! OutputDir(PyObject *self) { return ObjectDir(self, OutputAttrs); } --- 324,330 }; static PyObject * ! OutputDir(PyObject *self, PyObject *args UNUSED) { return ObjectDir(self, OutputAttrs); } *** *** 468,497 } static PyObject * ! AlwaysNone(PyObject *self UNUSED) { // do nothing Py_INCREF(Py_None); return Py_None; } static PyObject * ! AlwaysFalse(PyObject *self UNUSED) { // do nothing PyObject *ret = Py_False; Py_INCREF(ret); return ret; } static PyObject * ! AlwaysTrue(PyObject *self UNUSED) { // do nothing PyObject *ret = Py_True; Py_INCREF(ret); return ret; } /***/ --- 468,500 } static PyObject * ! AlwaysNone(PyObject *self UNUSED, PyObject *args UNUSED) { // do nothing Py_INCREF(Py_None); return Py_None; } + #define ALWAYS_NONE AlwaysNone(NULL, NULL) static PyObject * ! AlwaysFalse(PyObject *self UNUSED, PyObject *args UNUSED) { // do nothing PyObject *ret = Py_False; Py_INCREF(ret); return ret; } + #define ALWAYS_FALSE AlwaysFalse(NULL, NULL) static PyObject * ! AlwaysTrue(PyObject *self UNUSED, PyObject *args UNUSED) { // do nothing PyObject *ret = Py_True; Py_INCREF(ret); return ret; } + #define ALWAYS_TRUE AlwaysTrue(NULL, NULL) /***/ *** *** 1179,1185 } static PyObject * ! Vim_GetPaths(PyObject *self UNUSED) { PyObject *ret; --- 1182,1188 } static PyObject * ! Vim_GetPaths(PyObject *self UNUSED, PyObject *args UNUSED) { PyObject *ret; *** *** 1209,1215 if (!PyArg_ParseTuple(args, "s|O", &fullname, &target)) return NULL; ! if (!(paths = Vim_GetPaths(self))) return NULL; spec = PyObject_CallFunction(py_find_spec, "sOO", fullname, paths, target); --- 1212,1218 if (!PyArg_ParseTuple(args, "s|O", &fullname, &target)) return NULL; ! if (!(paths = Vim_GetPaths(self, NULL))) return NULL; spec = PyObject_CallFunction(py_find_spec, "sOO", fullname, paths, target); *** *** 1344,1350 if (!PyArg_ParseTuple(args, "s", &fullname)) return NULL; ! if (!(new_path = Vim_GetPaths(self))) return NULL; result = find_module(fullname, fullname, new_path); --- 1347,1353 if (!PyArg_ParseTuple(args, "s", &fullname)) return NULL; ! if (!(new_path = Vim_GetPaths(self, NULL))) return NULL; result = find_module(fullname, fullname, new_path); *** *** 1408,1415 {"eval", VimEval,METH_VARARGS, "Evaluate an expression using Vim evaluator" }, {"bindeval",VimEvalPy,METH_O, "Like eval(), but returns objects attached to Vim ones"}, {"strwidth",VimStrwidth, METH_O, "Screen string width, counts as having width 1"}, ! {"chdir", (PyCFunction)VimChdir, METH_VARARGS|METH_KEYWORDS, "Change directory"}, ! {"fchdir",(PyCFunction)VimFchdir, METH_VARARGS|METH_KEYWORDS, "Change directory"}, {"foreach_rtp", VimForeachRTP,METH_O, "Call given callable for each path in &rtp"}, #if PY_VERSION_HEX >= 0x030700f0 {"find_spec", FinderFindSpec, METH_VARARGS, "Internal use only, returns spec object for any input it receives"}, --- 1411,1418 {"eval", VimEval,METH_VARARGS, "Evaluate an expression using Vim evaluator" }, {"bindeval",VimEvalPy,METH_O, "Like eval(), but returns objects attached to Vim ones"}, {"strwidth",VimStrwidth, METH_O, "Screen string width, counts as having width 1"}, ! {"chdir", (PyCFunction)(void *)VimChdir, METH_VARARGS|METH_KEYWORDS, "Change directory"}, ! {"fchdir",(PyCFunction)(void *)VimFchdir, METH_VARARGS|METH_KEYWORDS, "Change directory"}, {"foreach_rtp", VimForeachRTP,METH_O, "Call given callable for each p
Patch 8.2.1882
Patch 8.2.1882 Problem:Vim9: v:disallow_let is no longer needed. Solution: Remove v:disallow_let. Files: src/evalvars.c, src/vim.h, src/vim9compile.c *** ../vim-8.2.1881/src/evalvars.c 2020-10-15 20:42:16.414311131 +0200 --- src/evalvars.c 2020-10-21 20:05:49.849848329 +0200 *** *** 146,152 {VV_NAME("echospace", VAR_NUMBER), VV_RO}, {VV_NAME("argv", VAR_LIST), VV_RO}, {VV_NAME("collate",VAR_STRING), VV_RO}, - {VV_NAME("disallow_let", VAR_NUMBER), 0}, // TODO: remove }; // shorthand --- 146,151 *** *** 243,251 set_vim_var_nr(VV_ECHOSPACE,sc_col - 1); - // TODO: remove later - set_vim_var_nr(VV_DISALLOW_LET, 1); - // Default for v:register is not 0 but '"'. This is adjusted once the // clipboard has been setup by calling reset_reg_var(). set_reg_var(0); --- 242,247 *** *** 749,756 ex_finally(eap); return; } ! if (get_vim_var_nr(VV_DISALLOW_LET) ! && eap->cmdidx == CMD_let && vim9script) { emsg(_(e_cannot_use_let_in_vim9_script)); return; --- 745,751 ex_finally(eap); return; } ! if (eap->cmdidx == CMD_let && vim9script) { emsg(_(e_cannot_use_let_in_vim9_script)); return; *** ../vim-8.2.1881/src/vim.h 2020-10-21 12:19:50.080854732 +0200 --- src/vim.h 2020-10-21 20:06:29.525726608 +0200 *** *** 1994,2001 #define VV_ECHOSPACE 93 #define VV_ARGV 94 #define VV_COLLATE 95 ! #define VV_DISALLOW_LET 96// TODO: remove again ! #define VV_LEN97 // number of v: vars // used for v_number in VAR_BOOL and VAR_SPECIAL #define VVAL_FALSE0L // VAR_BOOL --- 1994,2000 #define VV_ECHOSPACE 93 #define VV_ARGV 94 #define VV_COLLATE 95 ! #define VV_LEN96 // number of v: vars // used for v_number in VAR_BOOL and VAR_SPECIAL #define VVAL_FALSE0L // VAR_BOOL *** ../vim-8.2.1881/src/vim9compile.c 2020-10-21 16:49:13.992979808 +0200 --- src/vim9compile.c 2020-10-21 20:06:21.593750942 +0200 *** *** 7319,7330 break; case CMD_let: ! if (get_vim_var_nr(VV_DISALLOW_LET)) ! { ! emsg(_(e_cannot_use_let_in_vim9_script)); ! break; ! } ! // FALLTHROUGH case CMD_var: case CMD_final: case CMD_const: --- 7319,7326 break; case CMD_let: ! emsg(_(e_cannot_use_let_in_vim9_script)); ! break; case CMD_var: case CMD_final: case CMD_const: *** ../vim-8.2.1881/src/version.c 2020-10-21 17:28:23.922809103 +0200 --- src/version.c 2020-10-21 20:58:02.855028822 +0200 *** *** 752,753 --- 752,755 { /* Add new patch number below this line */ + /**/ + 1882, /**/ -- hundred-and-one symptoms of being an internet addict: 100. The most exciting sporting events you noticed during summer 1996 was Netscape vs. Microsoft. /// Bram Moolenaar -- b...@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/// -- -- You received this message from the "vim_dev" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php --- You received this message because you are subscribed to the Google Groups "vim_dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/vim_dev/202010211859.09LIxJ6U150787%40masaka.moolenaar.net.
Re: Patch 8.2.1880
On 22-Oct-2020 01:50, Bram Moolenaar wrote: Patch 8.2.1880 Problem:Vim9: Asan complains about adding zero to NULL. Solution: Check for argument count first. Files: src/vim9compile.c After this patch mingw64 (gcc 10.2) throws this warning: gcc -c -I. -Iproto -DWIN32 -DWINVER=0x0603 -D_WIN32_WINNT=0x0603 -DHAVE_PATHDEF -DFEAT_NORMAL -DHAVE_STDINT_H -D__USE_MINGW_ANSI_STDIO -pipe -march=native -Wall -O3 -fomit-frame-pointer -freg-struct-return -fpie -fPIE -DFEAT_GUI_MSWIN -DFEAT_CLIPBOARD vim9compile.c -o gobjnative/vim9compile.o vim9compile.c: In function 'compile_call': vim9compile.c:1496:6: warning: 'argtypes' may be used uninitialized in this function [-Wmaybe-uninitialized] 1496 | internal_func_ret_type(func_idx, argcount, argtypes); | ^~~~ vim9compile.c:1463:14: note: 'argtypes' was declared here 1463 | type_T **argtypes; | ^~~~ Not sure what the fix should be. Perhaps as simple as initialising argtypes to NULL? Cheers John -- -- You received this message from the "vim_dev" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php --- You received this message because you are subscribed to the Google Groups "vim_dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/vim_dev/8456d43f-f5ae-a41e-ff02-c777f9e9de89%40internode.on.net.
After 8.2.1881 GTK3 Vim builds again
After patch 8.2.1881 the problems from 1875 and 1878 are solved AFAICT: Vim with GTK3 builds again. Best regards, Tony. -- -- You received this message from the "vim_dev" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php --- You received this message because you are subscribed to the Google Groups "vim_dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/vim_dev/CAJkCKXsqPvU2vO3zo3vdqVQhOANbyhB2WgC82Dtx0YnjBYvkkg%40mail.gmail.com.
Patch 8.2.1881
Patch 8.2.1881 Problem:Cannot build with GTK3. Solution: Adjust form functions. Files: src/gui_gtk_f.c *** ../vim-8.2.1880/src/gui_gtk_f.c 2020-10-21 16:10:16.382485983 +0200 --- src/gui_gtk_f.c 2020-10-21 17:26:49.015080921 +0200 *** *** 48,55 }; ! static void form_class_init(GtkFormClass *klass); ! static void form_init(GtkForm *form, void *g_class); static void form_realize(GtkWidget *widget); static void form_unrealize(GtkWidget *widget); --- 48,59 }; ! static void gui_gtk_form_class_init(GtkFormClass *klass); ! #if GTK_CHECK_VERSION(3,0,0) ! static void gui_gtk_form_init(GtkForm *form); ! #else ! static void gui_gtk_form_init(GtkForm *form, void *g_class); ! #endif static void form_realize(GtkWidget *widget); static void form_unrealize(GtkWidget *widget); *** *** 195,202 } // Basic Object handling procedures #if GTK_CHECK_VERSION(3,0,0) ! G_DEFINE_TYPE(GtkForm, gtk_form, GTK_TYPE_CONTAINER) #else GtkType gui_gtk_form_get_type(void) --- 199,207 } // Basic Object handling procedures + #if GTK_CHECK_VERSION(3,0,0) ! G_DEFINE_TYPE(GtkForm, gui_gtk_form, GTK_TYPE_CONTAINER) #else GtkType gui_gtk_form_get_type(void) *** *** 211,218 form_info.type_name = "GtkForm"; form_info.object_size = sizeof(GtkForm); form_info.class_size = sizeof(GtkFormClass); ! form_info.class_init_func = (GtkClassInitFunc)form_class_init; ! form_info.object_init_func = (GtkObjectInitFunc)form_init; form_type = gtk_type_unique(GTK_TYPE_CONTAINER, &form_info); } --- 216,223 form_info.type_name = "GtkForm"; form_info.object_size = sizeof(GtkForm); form_info.class_size = sizeof(GtkFormClass); ! form_info.class_init_func = (GtkClassInitFunc)gui_gtk_form_class_init; ! form_info.object_init_func = (GtkObjectInitFunc)gui_gtk_form_init; form_type = gtk_type_unique(GTK_TYPE_CONTAINER, &form_info); } *** *** 221,227 #endif // !GTK_CHECK_VERSION(3,0,0) static void ! form_class_init(GtkFormClass *klass) { GtkWidgetClass *widget_class; GtkContainerClass *container_class; --- 226,232 #endif // !GTK_CHECK_VERSION(3,0,0) static void ! gui_gtk_form_class_init(GtkFormClass *klass) { GtkWidgetClass *widget_class; GtkContainerClass *container_class; *** *** 254,260 } static void ! form_init(GtkForm *form, void *g_class UNUSED) { #if GTK_CHECK_VERSION(3,0,0) gtk_widget_set_has_window(GTK_WIDGET(form), TRUE); --- 259,269 } static void ! gui_gtk_form_init(GtkForm *form ! #if !GTK_CHECK_VERSION(3,0,0) ! , void *g_class UNUSED ! #endif ! ) { #if GTK_CHECK_VERSION(3,0,0) gtk_widget_set_has_window(GTK_WIDGET(form), TRUE); *** *** 416,423 } #if GTK_CHECK_VERSION(3,0,0) ! if (GTK_WIDGET_CLASS (gtk_form_parent_class)->unrealize) !(* GTK_WIDGET_CLASS (gtk_form_parent_class)->unrealize) (widget); #else if (GTK_WIDGET_CLASS (parent_class)->unrealize) (* GTK_WIDGET_CLASS (parent_class)->unrealize) (widget); --- 425,432 } #if GTK_CHECK_VERSION(3,0,0) ! if (GTK_WIDGET_CLASS (gui_gtk_form_parent_class)->unrealize) !(* GTK_WIDGET_CLASS (gui_gtk_form_parent_class)->unrealize) (widget); #else if (GTK_WIDGET_CLASS (parent_class)->unrealize) (* GTK_WIDGET_CLASS (parent_class)->unrealize) (widget); *** *** 555,561 } } ! return GTK_WIDGET_CLASS(gtk_form_parent_class)->draw(widget, cr); } #else // !GTK_CHECK_VERSION(3,0,0) static gint --- 564,570 } } ! return GTK_WIDGET_CLASS(gui_gtk_form_parent_class)->draw(widget, cr); } #else // !GTK_CHECK_VERSION(3,0,0) static gint *** ../vim-8.2.1880/src/version.c 2020-10-21 16:49:13.992979808 +0200 --- src/version.c 2020-10-21 17:28:02.202871125 +0200 *** *** 752,753 --- 752,755 { /* Add new patch number below this line */ + /**/ + 1881, /**/ -- hundred-and-one symptoms of being an internet addict: 98. The Alta Vista administrators ask you what sites are missing in their index files. /// Bram Moolenaar -- b...@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/// -- -- You received this message from the "vim_dev" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php --- You received this message because you are subscribed to the Google Groups "vim_dev" group. To unsubscribe from this group and
Re: Patch 8.2.1878
Tony wrote: > The problem in gui_gtk_f has now become a warning, but there is a > fatal in the link: Oh, that G_DEFINE_TYPE() macro is doing some magic, mangling function names. Only with GTK3 though. -- hundred-and-one symptoms of being an internet addict: 97. Your mother tells you to remember something, and you look for a File/Save command. /// Bram Moolenaar -- b...@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/// -- -- You received this message from the "vim_dev" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php --- You received this message because you are subscribed to the Google Groups "vim_dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/vim_dev/202010211523.09LFNvr9087702%40masaka.moolenaar.net.
Patch 8.2.1880
Patch 8.2.1880 Problem:Vim9: Asan complains about adding zero to NULL. Solution: Check for argument count first. Files: src/vim9compile.c *** ../vim-8.2.1879/src/vim9compile.c 2020-10-21 16:42:18.517821898 +0200 --- src/vim9compile.c 2020-10-21 16:47:57.057129882 +0200 *** *** 1475,1485 isn->isn_arg.shuffle.shfl_up = argoff - 1; } ! // Check the types of the arguments. ! argtypes = ((type_T **)stack->ga_data) + stack->ga_len - argcount; ! if (argcount > 0 && internal_func_check_arg_types( ! argtypes, func_idx, argcount) == FAIL) return FAIL; if ((isn = generate_instr(cctx, ISN_BCALL)) == NULL) return FAIL; --- 1475,1487 isn->isn_arg.shuffle.shfl_up = argoff - 1; } ! if (argcount > 0) ! { ! // Check the types of the arguments. ! argtypes = ((type_T **)stack->ga_data) + stack->ga_len - argcount; ! if (internal_func_check_arg_types(argtypes, func_idx, argcount) == FAIL) return FAIL; + } if ((isn = generate_instr(cctx, ISN_BCALL)) == NULL) return FAIL; *** ../vim-8.2.1879/src/version.c 2020-10-21 16:42:18.517821898 +0200 --- src/version.c 2020-10-21 16:48:57.637012434 +0200 *** *** 752,753 --- 752,755 { /* Add new patch number below this line */ + /**/ + 1880, /**/ -- hundred-and-one symptoms of being an internet addict: 96. On Super Bowl Sunday, you followed the score by going to the Yahoo main page instead of turning on the TV. /// Bram Moolenaar -- b...@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/// -- -- You received this message from the "vim_dev" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php --- You received this message because you are subscribed to the Google Groups "vim_dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/vim_dev/202010211450.09LEoDTE072573%40masaka.moolenaar.net.
Patch 8.2.1879
Patch 8.2.1879 Problem:Vim9: argument types of insert() not checked when compiling. Solution: Add argument type checks for insert(). Files: src/evalfunc.c, src/proto/evalfunc.pro, src/vim9compile.c, src/testdir/test_vim9_builtin.vim *** ../vim-8.2.1878/src/evalfunc.c 2020-10-21 14:49:05.033959899 +0200 --- src/evalfunc.c 2020-10-21 16:34:45.971094405 +0200 *** *** 266,273 // Context passed to an arg_ function. typedef struct { ! int arg_count; // actual argument count ! int arg_idx;// current argument index (first arg is zero) } argcontext_T; // A function to check one argument type. The first argument is the type to --- 266,274 // Context passed to an arg_ function. typedef struct { ! int arg_count; // actual argument count ! type_T**arg_types;// list of argument types ! int arg_idx;// current argument index (first arg is zero) } argcontext_T; // A function to check one argument type. The first argument is the type to *** *** 278,293 static int arg_float_or_nr(type_T *type, argcontext_T *context) { ! if (type->tt_type == VAR_FLOAT || type->tt_type == VAR_NUMBER) return OK; arg_type_mismatch(&t_number, type, context->arg_idx + 1); return FAIL; } /* * Lists of functions that check the argument types of a builtin function. */ argcheck_T arg1_float_or_nr[] = {arg_float_or_nr}; /* * Functions that return the return type of a builtin function. --- 279,333 static int arg_float_or_nr(type_T *type, argcontext_T *context) { ! if (type->tt_type == VAR_ANY ! || type->tt_type == VAR_FLOAT || type->tt_type == VAR_NUMBER) return OK; arg_type_mismatch(&t_number, type, context->arg_idx + 1); return FAIL; } + static int + arg_number(type_T *type, argcontext_T *context) + { + return check_type(&t_number, type, TRUE, context->arg_idx + 1); + } + + static int + arg_list_or_blob(type_T *type, argcontext_T *context) + { + if (type->tt_type == VAR_ANY +|| type->tt_type == VAR_LIST || type->tt_type == VAR_BLOB) + return OK; + arg_type_mismatch(&t_list_any, type, context->arg_idx + 1); + return FAIL; + } + + /* + * Check the type is an item of the list or blob of the previous arg. + * Must not be used for the first argcheck_T entry. + */ + static int + arg_item_of_prev(type_T *type, argcontext_T *context) + { + type_T *prev_type = context->arg_types[context->arg_idx - 1]; + type_T *expected; + + if (prev_type->tt_type == VAR_LIST) + expected = prev_type->tt_member; + else if (prev_type->tt_type == VAR_BLOB) + expected = &t_number; + else + // probably VAR_ANY, can't check + return OK; + + return check_type(expected, type, TRUE, context->arg_idx + 1); + } + /* * Lists of functions that check the argument types of a builtin function. */ argcheck_T arg1_float_or_nr[] = {arg_float_or_nr}; + argcheck_T arg3_insert[] = {arg_list_or_blob, arg_item_of_prev, arg_number}; /* * Functions that return the return type of a builtin function. *** *** 936,942 ret_number, f_inputsave}, {"inputsecret", 1, 2, FEARG_1, NULL, ret_string, f_inputsecret}, ! {"insert",2, 3, FEARG_1, NULL, ret_first_arg, f_insert}, {"interrupt", 0, 0, 0,NULL, ret_void, f_interrupt}, --- 976,982 ret_number, f_inputsave}, {"inputsecret", 1, 2, FEARG_1, NULL, ret_string, f_inputsecret}, ! {"insert",2, 3, FEARG_1, arg3_insert, ret_first_arg, f_insert}, {"interrupt", 0, 0, 0,NULL, ret_void, f_interrupt}, *** *** 1763,1769 * Return FAIL and gives an error message when a type is wrong. */ int ! internal_func_check_arg_types(type_T *types, int idx, int argcount) { argcheck_T*argchecks = global_functions[idx].f_argcheck; int i; --- 1803,1809 * Return FAIL and gives an error message when a type is wrong. */ int ! internal_func_check_arg_types(type_T **types, int idx, int argcount) { argcheck_T*argchecks = global_functions[idx].f_argcheck; int i; *** *** 1773,1783 argcontext_T context; context.arg_count = argcount; for (i = 0; i < argcount; ++i) if (argchecks[i] != NULL) { context.arg_idx = i; ! if (argchecks[i](types + i, &context) == F
Re: Patch 8.2.1878
The problem in gui_gtk_f has now become a warning, but there is a fatal in the link: gui_gtk_f: gcc -c -I. -Iproto -DHAVE_CONFIG_H -DFEAT_GUI_GTK -pthread -I/usr/include/gtk-3.0 -I/usr/include/at-spi2-atk/2.0 -I/usr/include/at-spi-2.0 -I/usr/include/dbus-1.0 -I/usr/lib64/dbus-1.0/include -I/usr/include/gtk-3.0 -I/usr/include/gio-unix-2.0 -I/usr/include/libxkbcommon -I/usr/include/wayland -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/fribidi -I/usr/include/harfbuzz -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/uuid -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -O2 -fno-strength-reduce -Wall -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1 -o objects/gui_gtk_f.o gui_gtk_f.c In file included from /usr/include/glib-2.0/gobject/gobject.h:24:0, from /usr/include/glib-2.0/gobject/gbinding.h:29, from /usr/include/glib-2.0/glib-object.h:23, from /usr/include/glib-2.0/gio/gioenums.h:28, from /usr/include/glib-2.0/gio/giotypes.h:28, from /usr/include/glib-2.0/gio/gio.h:26, from /usr/include/gtk-3.0/gdk/gdkapplaunchcontext.h:28, from /usr/include/gtk-3.0/gdk/gdk.h:32, from /usr/include/gtk-3.0/gtk/gtk.h:30, from beval.h:15, from vim.h:1810, from gui_gtk_f.c:26: gui_gtk_f.c:199:24: warning: ‘gtk_form_init’ used but never defined G_DEFINE_TYPE(GtkForm, gtk_form, GTK_TYPE_CONTAINER) ^ /usr/include/glib-2.0/gobject/gtype.h:1979:17: note: in definition of macro ‘_G_DEFINE_TYPE_EXTENDED_BEGIN_PRE’ static void type_name##_init (TypeName*self); \ ^ /usr/include/glib-2.0/gobject/gtype.h:1761:60: note: in expansion of macro ‘_G_DEFINE_TYPE_EXTENDED_BEGIN’ #define G_DEFINE_TYPE_EXTENDED(TN, t_n, T_P, _f_, _C_) _G_DEFINE_TYPE_EXTENDED_BEGIN (TN, t_n, T_P, _f_) {_C_;} _G_DEFINE_TYPE_EXTENDED_END() ^ /usr/include/glib-2.0/gobject/gtype.h:1602:43: note: in expansion of macro ‘G_DEFINE_TYPE_EXTENDED’ #define G_DEFINE_TYPE(TN, t_n, T_P) G_DEFINE_TYPE_EXTENDED (TN, t_n, T_P, 0, {}) ^~ gui_gtk_f.c:199:1: note: in expansion of macro ‘G_DEFINE_TYPE’ G_DEFINE_TYPE(GtkForm, gtk_form, GTK_TYPE_CONTAINER) ^ gui_gtk_f.c:199:24: warning: ‘gtk_form_class_init’ used but never defined G_DEFINE_TYPE(GtkForm, gtk_form, GTK_TYPE_CONTAINER) ^ /usr/include/glib-2.0/gobject/gtype.h:1980:17: note: in definition of macro ‘_G_DEFINE_TYPE_EXTENDED_BEGIN_PRE’ static void type_name##_class_init(TypeName##Class *klass); \ ^ /usr/include/glib-2.0/gobject/gtype.h:1761:60: note: in expansion of macro ‘_G_DEFINE_TYPE_EXTENDED_BEGIN’ #define G_DEFINE_TYPE_EXTENDED(TN, t_n, T_P, _f_, _C_) _G_DEFINE_TYPE_EXTENDED_BEGIN (TN, t_n, T_P, _f_) {_C_;} _G_DEFINE_TYPE_EXTENDED_END() ^ /usr/include/glib-2.0/gobject/gtype.h:1602:43: note: in expansion of macro ‘G_DEFINE_TYPE_EXTENDED’ #define G_DEFINE_TYPE(TN, t_n, T_P) G_DEFINE_TYPE_EXTENDED (TN, t_n, T_P, 0, {}) ^~ gui_gtk_f.c:199:1: note: in expansion of macro ‘G_DEFINE_TYPE’ G_DEFINE_TYPE(GtkForm, gtk_form, GTK_TYPE_CONTAINER) ^ gui_gtk_f.c:257:1: warning: ‘form_init’ defined but not used [-Wunused-function] form_init(GtkForm *form, void *g_class UNUSED) ^ gui_gtk_f.c:224:1: warning: ‘form_class_init’ defined but not used [-Wunused-function] form_class_init(GtkFormClass *klass) ^~~ Linking: link.sh: $LINK_AS_NEEDED set to 'yes': invoking linker directly. gcc -L/usr/local/lib -Wl,--as-needed-o vim-normal objects/arabic.o objects/arglist.o objects/autocmd.o objects/beval.o objects/buffer.o objects/change.o objects/blob.o objects/blowfish.o objects/cindent.o objects/clientserver.o objects/clipboard.o objects/cmdexpand.o objects/cmdhist.o objects/crypt.o objects/crypt_zip.o objects/debugger.o objects/dict.o objects/diff.o objects/digraph.o objects/drawline.o objects/drawscreen.o objects/edit.o objects/eval.o objects/evalbuffer.o objects/evalfunc.o objects/evalvars.o objects/evalwindow.o objects/ex_cmds.o objects/ex_cmds2.o objects/ex_docmd.o objects/ex_eval.o objects/ex_getln.o objects/fileio.o objects/filepath.o objects/findfile.o objects/fold.o objects/getchar.o objects/gui_xim.o objects/hardcopy.o objects/hashtab.o objects/help.o objects/highlight.o objects/if_cscope.o objects/if_xcmdsrv.o objects/indent.o objects/insexpand.o objects/list.o objects/locale.o objects/map.o objects/mark.o objects/match.o objects/mbyte.o objects/memline.o objects/menu.o objects/misc1.o o
Re: Patch 8.2.1875
Tony wrote: > On Wed, Oct 21, 2020 at 12:38 PM Bram Moolenaar wrote: > > > > > > Patch 8.2.1875 > > Problem:Warning when building GTK gui. > > Solution: Add missing function parameter. > > Files: src/gui_gtk_f.c > > Fatal error in gui_gtk_f.c after applying patches 8.2.1874 to 1876 > (not yet 1877): > > gcc -c -I. -Iproto -DHAVE_CONFIG_H -DFEAT_GUI_GTK -pthread > -I/usr/include/gtk-3.0 -I/usr/include/at-spi2-atk/2.0 > -I/usr/include/at-spi-2.0 -I/usr/include/dbus-1.0 > -I/usr/lib64/dbus-1.0/include -I/usr/include/gtk-3.0 > -I/usr/include/gio-unix-2.0 -I/usr/include/libxkbcommon > -I/usr/include/wayland -I/usr/include/cairo -I/usr/include/pango-1.0 > -I/usr/include/fribidi -I/usr/include/harfbuzz -I/usr/include/atk-1.0 > -I/usr/include/cairo -I/usr/include/pixman-1 -I/usr/include/freetype2 > -I/usr/include/libpng16 -I/usr/include/gdk-pixbuf-2.0 > -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/uuid > -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -O2 > -fno-strength-reduce -Wall -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1 > -o objects/gui_gtk_f.o gui_gtk_f.c > In file included from /usr/include/glib-2.0/gobject/gobject.h:24:0, > from /usr/include/glib-2.0/gobject/gbinding.h:29, > from /usr/include/glib-2.0/glib-object.h:23, > from /usr/include/glib-2.0/gio/gioenums.h:28, > from /usr/include/glib-2.0/gio/giotypes.h:28, > from /usr/include/glib-2.0/gio/gio.h:26, > from /usr/include/gtk-3.0/gdk/gdkapplaunchcontext.h:28, > from /usr/include/gtk-3.0/gdk/gdk.h:32, > from /usr/include/gtk-3.0/gtk/gtk.h:30, > from beval.h:15, > from vim.h:1810, > from gui_gtk_f.c:28: > gui_gtk_f.c:215:24: error: conflicting types for ‘gtk_form_init’ > G_DEFINE_TYPE(GtkForm, gtk_form, GTK_TYPE_CONTAINER) > ^ > /usr/include/glib-2.0/gobject/gtype.h:1979:17: note: in definition of > macro ‘_G_DEFINE_TYPE_EXTENDED_BEGIN_PRE’ > static void type_name##_init (TypeName*self); \ > ^ > /usr/include/glib-2.0/gobject/gtype.h:1761:60: note: in expansion of > macro ‘_G_DEFINE_TYPE_EXTENDED_BEGIN’ > #define G_DEFINE_TYPE_EXTENDED(TN, t_n, T_P, _f_, _C_) > _G_DEFINE_TYPE_EXTENDED_BEGIN (TN, t_n, T_P, _f_) {_C_;} > _G_DEFINE_TYPE_EXTENDED_END() > > ^ > /usr/include/glib-2.0/gobject/gtype.h:1602:43: note: in expansion of > macro ‘G_DEFINE_TYPE_EXTENDED’ > #define G_DEFINE_TYPE(TN, t_n, T_P) G_DEFINE_TYPE_EXTENDED (TN, > t_n, T_P, 0, {}) >^~ > gui_gtk_f.c:215:1: note: in expansion of macro ‘G_DEFINE_TYPE’ > G_DEFINE_TYPE(GtkForm, gtk_form, GTK_TYPE_CONTAINER) > ^ > gui_gtk_f.c:54:13: note: previous declaration of ‘gtk_form_init’ was here > static void gtk_form_init(GtkForm *form, void *g_class); > ^ > gui_gtk_f.c:273:1: error: conflicting types for ‘gtk_form_init’ > gtk_form_init(GtkForm *form, void *g_class UNUSED) > ^ This must always have been a problem, we got away with it because the function signatures happened to be the same. It looks like prepending local functions with "gtk_" is asking for trouble, since most gtk library functions start with that. Seems safe to just remove the "gtk_" prefix for all of them. -- hundred-and-one symptoms of being an internet addict: 93. New mail alarm on your palmtop annoys other churchgoers. /// Bram Moolenaar -- b...@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/// -- -- You received this message from the "vim_dev" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php --- You received this message because you are subscribed to the Google Groups "vim_dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/vim_dev/202010211410.09LEAvfJ063928%40masaka.moolenaar.net.
Patch 8.2.1878
Patch 8.2.1878 Problem:GTK: error for redefining function. (Tony Mechelynck) Solution: Remove "gtk_" prefix from local functions and prepend "gui_" to global functions. Files: src/gui_gtk_f.c, src/gui_gtk_f.h, src/gui_gtk.c, src/gui_gtk_x11.c *** ../vim-8.2.1877/src/gui_gtk_f.c 2020-10-21 12:37:56.270973451 +0200 --- src/gui_gtk_f.c 2020-10-21 16:08:48.386725805 +0200 *** *** 11,17 * (C) 1998,1999 by Marcin Dalecki * * Support for GTK+ 2 was added by: - * * (C) 2002,2003 Jason Hildebrand * Daniel Elstner * --- 11,16 *** *** 21,27 * long time. * * Support for GTK+ 3 was added by: - * * 2016 Kazunobu Kuriyama */ --- 20,25 *** *** 50,101 }; ! static void gtk_form_class_init(GtkFormClass *klass); ! static void gtk_form_init(GtkForm *form, void *g_class); ! static void gtk_form_realize(GtkWidget *widget); ! static void gtk_form_unrealize(GtkWidget *widget); ! static void gtk_form_map(GtkWidget *widget); ! static void gtk_form_size_request(GtkWidget *widget, ! GtkRequisition *requisition); ! #if GTK_CHECK_VERSION(3,0,0) ! static void gtk_form_get_preferred_width(GtkWidget *widget, !gint *minimal_width, !gint *natural_width); ! static void gtk_form_get_preferred_height(GtkWidget *widget, ! gint *minimal_height, ! gint *natural_height); ! #endif ! static void gtk_form_size_allocate(GtkWidget *widget, ! GtkAllocation *allocation); ! #if GTK_CHECK_VERSION(3,0,0) ! static gboolean gtk_form_draw(GtkWidget *widget, ! cairo_t *cr); ! #else ! static gint gtk_form_expose(GtkWidget *widget, ! GdkEventExpose *event); ! #endif ! ! static void gtk_form_remove(GtkContainer *container, ! GtkWidget *widget); ! static void gtk_form_forall(GtkContainer *container, ! gboolean include_internals, ! GtkCallback callback, ! gpointer callback_data); ! ! static void gtk_form_attach_child_window(GtkForm *form, !GtkFormChild *child); ! static void gtk_form_realize_child(GtkForm *form, ! GtkFormChild *child); ! static void gtk_form_position_child(GtkForm *form, ! GtkFormChild *child, ! gboolean force_allocate); ! static void gtk_form_position_children(GtkForm *form); ! static void gtk_form_send_configure(GtkForm *form); ! static void gtk_form_child_map(GtkWidget *widget, gpointer user_data); ! static void gtk_form_child_unmap(GtkWidget *widget, gpointer user_data); #if !GTK_CHECK_VERSION(3,0,0) static GtkWidgetClass *parent_class = NULL; --- 48,83 }; ! static void form_class_init(GtkFormClass *klass); ! static void form_init(GtkForm *form, void *g_class); ! ! static void form_realize(GtkWidget *widget); ! static void form_unrealize(GtkWidget *widget); ! static void form_map(GtkWidget *widget); ! static void form_size_request(GtkWidget *widget, GtkRequisition *requisition); ! #if GTK_CHECK_VERSION(3,0,0) ! static void form_get_preferred_width(GtkWidget *widget, gint *minimal_width, gint *natural_width); ! static void form_get_preferred_height(GtkWidget *widget, gint *minimal_height, gint *natural_height); ! #endif ! static void form_size_allocate(GtkWidget *widget, GtkAllocation *allocation); ! #if GTK_CHECK_VERSION(3,0,0) ! static gboolean form_draw(GtkWidget *widget, cairo_t *cr); ! #else ! static gint form_expose(GtkWidget *widget, GdkEventExpose *event); ! #endif ! ! static void form_remove(GtkContainer *container, GtkWidget *widget); ! static void form_forall(GtkContainer *container, gboolean include_internals, GtkCallback callback, gpointer callback_data); ! static void form_attach_child_window(GtkForm *form, GtkFormChild *child); ! static void form_realize_child(GtkForm *form, GtkFormChild *child); ! static void form_position_child(GtkForm *form, GtkFormChild *child, gboolean force_allocate); ! static void form_position_children(GtkForm *form); ! static void form_send_configure(GtkForm *form); ! static void form_child_map(GtkWidget *widget, gpointer user_data); ! static void form_child_unmap(GtkWidget *widget, gpointer user_data); #if !GTK_CHECK_VERSION(3,0,0) static GtkWidgetClass *parent_class = NULL; *** *** 104,127 // Public interface GtkWidget * ! gtk_form_new(void) { GtkForm *form; #if GTK_CHECK_VERSION(3,0,0) form = g_object_new(GTK_TYPE_FORM, NULL); #else ! form = gtk_type_new(gtk_form_get_type()); #endif return GTK_WIDGET(form); }
Re: Patch 8.2.1875
P.S. "make reconfig" does not clear the problem. My GTK3 version is 3.24.20 and my compiler is gcc 7.5.0. On Wed, Oct 21, 2020 at 2:53 PM Tony Mechelynck wrote: > > On Wed, Oct 21, 2020 at 12:38 PM Bram Moolenaar wrote: > > > > > > Patch 8.2.1875 > > Problem:Warning when building GTK gui. > > Solution: Add missing function parameter. > > Files: src/gui_gtk_f.c > > Fatal error in gui_gtk_f.c after applying patches 8.2.1874 to 1876 > (not yet 1877): > > gcc -c -I. -Iproto -DHAVE_CONFIG_H -DFEAT_GUI_GTK -pthread > -I/usr/include/gtk-3.0 -I/usr/include/at-spi2-atk/2.0 > -I/usr/include/at-spi-2.0 -I/usr/include/dbus-1.0 > -I/usr/lib64/dbus-1.0/include -I/usr/include/gtk-3.0 > -I/usr/include/gio-unix-2.0 -I/usr/include/libxkbcommon > -I/usr/include/wayland -I/usr/include/cairo -I/usr/include/pango-1.0 > -I/usr/include/fribidi -I/usr/include/harfbuzz -I/usr/include/atk-1.0 > -I/usr/include/cairo -I/usr/include/pixman-1 -I/usr/include/freetype2 > -I/usr/include/libpng16 -I/usr/include/gdk-pixbuf-2.0 > -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/uuid > -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -O2 > -fno-strength-reduce -Wall -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1 > -o objects/gui_gtk_f.o gui_gtk_f.c > In file included from /usr/include/glib-2.0/gobject/gobject.h:24:0, > from /usr/include/glib-2.0/gobject/gbinding.h:29, > from /usr/include/glib-2.0/glib-object.h:23, > from /usr/include/glib-2.0/gio/gioenums.h:28, > from /usr/include/glib-2.0/gio/giotypes.h:28, > from /usr/include/glib-2.0/gio/gio.h:26, > from /usr/include/gtk-3.0/gdk/gdkapplaunchcontext.h:28, > from /usr/include/gtk-3.0/gdk/gdk.h:32, > from /usr/include/gtk-3.0/gtk/gtk.h:30, > from beval.h:15, > from vim.h:1810, > from gui_gtk_f.c:28: > gui_gtk_f.c:215:24: error: conflicting types for ‘gtk_form_init’ > G_DEFINE_TYPE(GtkForm, gtk_form, GTK_TYPE_CONTAINER) > ^ > /usr/include/glib-2.0/gobject/gtype.h:1979:17: note: in definition of > macro ‘_G_DEFINE_TYPE_EXTENDED_BEGIN_PRE’ > static void type_name##_init (TypeName*self); \ > ^ > /usr/include/glib-2.0/gobject/gtype.h:1761:60: note: in expansion of > macro ‘_G_DEFINE_TYPE_EXTENDED_BEGIN’ > #define G_DEFINE_TYPE_EXTENDED(TN, t_n, T_P, _f_, _C_) > _G_DEFINE_TYPE_EXTENDED_BEGIN (TN, t_n, T_P, _f_) {_C_;} > _G_DEFINE_TYPE_EXTENDED_END() > > ^ > /usr/include/glib-2.0/gobject/gtype.h:1602:43: note: in expansion of > macro ‘G_DEFINE_TYPE_EXTENDED’ > #define G_DEFINE_TYPE(TN, t_n, T_P) G_DEFINE_TYPE_EXTENDED (TN, > t_n, T_P, 0, {}) >^~ > gui_gtk_f.c:215:1: note: in expansion of macro ‘G_DEFINE_TYPE’ > G_DEFINE_TYPE(GtkForm, gtk_form, GTK_TYPE_CONTAINER) > ^ > gui_gtk_f.c:54:13: note: previous declaration of ‘gtk_form_init’ was here > static void gtk_form_init(GtkForm *form, void *g_class); > ^ > gui_gtk_f.c:273:1: error: conflicting types for ‘gtk_form_init’ > gtk_form_init(GtkForm *form, void *g_class UNUSED) > ^ > In file included from /usr/include/glib-2.0/gobject/gobject.h:24:0, > from /usr/include/glib-2.0/gobject/gbinding.h:29, > from /usr/include/glib-2.0/glib-object.h:23, > from /usr/include/glib-2.0/gio/gioenums.h:28, > from /usr/include/glib-2.0/gio/giotypes.h:28, > from /usr/include/glib-2.0/gio/gio.h:26, > from /usr/include/gtk-3.0/gdk/gdkapplaunchcontext.h:28, > from /usr/include/gtk-3.0/gdk/gdk.h:32, > from /usr/include/gtk-3.0/gtk/gtk.h:30, > from beval.h:15, > from vim.h:1810, > from gui_gtk_f.c:28: > gui_gtk_f.c:215:24: note: previous declaration of ‘gtk_form_init’ was here > G_DEFINE_TYPE(GtkForm, gtk_form, GTK_TYPE_CONTAINER) > ^ > /usr/include/glib-2.0/gobject/gtype.h:1979:17: note: in definition of > macro ‘_G_DEFINE_TYPE_EXTENDED_BEGIN_PRE’ > static void type_name##_init (TypeName*self); \ > ^ > /usr/include/glib-2.0/gobject/gtype.h:1761:60: note: in expansion of > macro ‘_G_DEFINE_TYPE_EXTENDED_BEGIN’ > #define G_DEFINE_TYPE_EXTENDED(TN, t_n, T_P, _f_, _C_) > _G_DEFINE_TYPE_EXTENDED_BEGIN (TN, t_n, T_P, _f_) {_C_;} > _G_DEFINE_TYPE_EXTENDED_END() > > ^ > /usr/include/glib-2.0/gobject/gtype.h:1602:43: note: in expansion of > macro ‘G_DEFINE_TYPE_EXTENDED’ > #define G_DEFINE_TYPE(TN, t_n, T_P) G_DEFINE_TYPE_EXTENDED (TN, > t_n, T_P, 0, {}) >^~ > gui_gtk_f.c:215:1: note: in expansi
Re: Patch 8.2.1875
On Wed, Oct 21, 2020 at 12:38 PM Bram Moolenaar wrote: > > > Patch 8.2.1875 > Problem:Warning when building GTK gui. > Solution: Add missing function parameter. > Files: src/gui_gtk_f.c Fatal error in gui_gtk_f.c after applying patches 8.2.1874 to 1876 (not yet 1877): gcc -c -I. -Iproto -DHAVE_CONFIG_H -DFEAT_GUI_GTK -pthread -I/usr/include/gtk-3.0 -I/usr/include/at-spi2-atk/2.0 -I/usr/include/at-spi-2.0 -I/usr/include/dbus-1.0 -I/usr/lib64/dbus-1.0/include -I/usr/include/gtk-3.0 -I/usr/include/gio-unix-2.0 -I/usr/include/libxkbcommon -I/usr/include/wayland -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/fribidi -I/usr/include/harfbuzz -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/uuid -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -O2 -fno-strength-reduce -Wall -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1 -o objects/gui_gtk_f.o gui_gtk_f.c In file included from /usr/include/glib-2.0/gobject/gobject.h:24:0, from /usr/include/glib-2.0/gobject/gbinding.h:29, from /usr/include/glib-2.0/glib-object.h:23, from /usr/include/glib-2.0/gio/gioenums.h:28, from /usr/include/glib-2.0/gio/giotypes.h:28, from /usr/include/glib-2.0/gio/gio.h:26, from /usr/include/gtk-3.0/gdk/gdkapplaunchcontext.h:28, from /usr/include/gtk-3.0/gdk/gdk.h:32, from /usr/include/gtk-3.0/gtk/gtk.h:30, from beval.h:15, from vim.h:1810, from gui_gtk_f.c:28: gui_gtk_f.c:215:24: error: conflicting types for ‘gtk_form_init’ G_DEFINE_TYPE(GtkForm, gtk_form, GTK_TYPE_CONTAINER) ^ /usr/include/glib-2.0/gobject/gtype.h:1979:17: note: in definition of macro ‘_G_DEFINE_TYPE_EXTENDED_BEGIN_PRE’ static void type_name##_init (TypeName*self); \ ^ /usr/include/glib-2.0/gobject/gtype.h:1761:60: note: in expansion of macro ‘_G_DEFINE_TYPE_EXTENDED_BEGIN’ #define G_DEFINE_TYPE_EXTENDED(TN, t_n, T_P, _f_, _C_) _G_DEFINE_TYPE_EXTENDED_BEGIN (TN, t_n, T_P, _f_) {_C_;} _G_DEFINE_TYPE_EXTENDED_END() ^ /usr/include/glib-2.0/gobject/gtype.h:1602:43: note: in expansion of macro ‘G_DEFINE_TYPE_EXTENDED’ #define G_DEFINE_TYPE(TN, t_n, T_P) G_DEFINE_TYPE_EXTENDED (TN, t_n, T_P, 0, {}) ^~ gui_gtk_f.c:215:1: note: in expansion of macro ‘G_DEFINE_TYPE’ G_DEFINE_TYPE(GtkForm, gtk_form, GTK_TYPE_CONTAINER) ^ gui_gtk_f.c:54:13: note: previous declaration of ‘gtk_form_init’ was here static void gtk_form_init(GtkForm *form, void *g_class); ^ gui_gtk_f.c:273:1: error: conflicting types for ‘gtk_form_init’ gtk_form_init(GtkForm *form, void *g_class UNUSED) ^ In file included from /usr/include/glib-2.0/gobject/gobject.h:24:0, from /usr/include/glib-2.0/gobject/gbinding.h:29, from /usr/include/glib-2.0/glib-object.h:23, from /usr/include/glib-2.0/gio/gioenums.h:28, from /usr/include/glib-2.0/gio/giotypes.h:28, from /usr/include/glib-2.0/gio/gio.h:26, from /usr/include/gtk-3.0/gdk/gdkapplaunchcontext.h:28, from /usr/include/gtk-3.0/gdk/gdk.h:32, from /usr/include/gtk-3.0/gtk/gtk.h:30, from beval.h:15, from vim.h:1810, from gui_gtk_f.c:28: gui_gtk_f.c:215:24: note: previous declaration of ‘gtk_form_init’ was here G_DEFINE_TYPE(GtkForm, gtk_form, GTK_TYPE_CONTAINER) ^ /usr/include/glib-2.0/gobject/gtype.h:1979:17: note: in definition of macro ‘_G_DEFINE_TYPE_EXTENDED_BEGIN_PRE’ static void type_name##_init (TypeName*self); \ ^ /usr/include/glib-2.0/gobject/gtype.h:1761:60: note: in expansion of macro ‘_G_DEFINE_TYPE_EXTENDED_BEGIN’ #define G_DEFINE_TYPE_EXTENDED(TN, t_n, T_P, _f_, _C_) _G_DEFINE_TYPE_EXTENDED_BEGIN (TN, t_n, T_P, _f_) {_C_;} _G_DEFINE_TYPE_EXTENDED_END() ^ /usr/include/glib-2.0/gobject/gtype.h:1602:43: note: in expansion of macro ‘G_DEFINE_TYPE_EXTENDED’ #define G_DEFINE_TYPE(TN, t_n, T_P) G_DEFINE_TYPE_EXTENDED (TN, t_n, T_P, 0, {}) ^~ gui_gtk_f.c:215:1: note: in expansion of macro ‘G_DEFINE_TYPE’ G_DEFINE_TYPE(GtkForm, gtk_form, GTK_TYPE_CONTAINER) ^ gui_gtk_f.c:215:24: warning: ‘gtk_form_init’ used but never defined G_DEFINE_TYPE(GtkForm, gtk_form, GTK_TYPE_CONTAINER) ^ /usr/include/glib-2.0/gobject/gtype.h:1979:17: note: in definition of macro ‘_G_DEFINE_TYPE_EXTENDED_BEGIN_P
Patch 8.2.1877
Patch 8.2.1877 (after 8.2.1876) Problem:Test for function list fails. Solution: Move "obsolete" comments one line up. Files: src/evalfunc.c *** ../vim-8.2.1876/src/evalfunc.c 2020-10-21 14:24:51.178015688 +0200 --- src/evalfunc.c 2020-10-21 14:48:03.090118446 +0200 *** *** 604,615 ret_number, f_bufadd}, {"bufexists", 1, 1, FEARG_1, NULL, ret_number, f_bufexists}, ! {"buffer_exists", 1, 1, FEARG_1, NULL, ! ret_number, f_bufexists}, // obsolete ! {"buffer_name", 0, 1, FEARG_1, NULL, ! ret_string, f_bufname}, // obsolete ! {"buffer_number", 0, 1, FEARG_1, NULL, ! ret_number, f_bufnr}, // obsolete {"buflisted", 1, 1, FEARG_1, NULL, ret_number, f_buflisted}, {"bufload", 1, 1, FEARG_1, NULL, --- 604,615 ret_number, f_bufadd}, {"bufexists", 1, 1, FEARG_1, NULL, ret_number, f_bufexists}, ! {"buffer_exists", 1, 1, FEARG_1, NULL, // obsolete ! ret_number, f_bufexists}, ! {"buffer_name", 0, 1, FEARG_1, NULL, // obsolete ! ret_string, f_bufname}, ! {"buffer_number", 0, 1, FEARG_1, NULL, // obsolete ! ret_number, f_bufnr}, {"buflisted", 1, 1, FEARG_1, NULL, ret_number, f_buflisted}, {"bufload", 1, 1, FEARG_1, NULL, *** *** 756,763 ret_first_arg, f_extend}, {"feedkeys", 1, 2, FEARG_1, NULL, ret_void, f_feedkeys}, ! {"file_readable", 1, 1, FEARG_1, NULL, ! ret_number, f_filereadable}, // obsolete {"filereadable", 1, 1, FEARG_1, NULL, ret_number, f_filereadable}, {"filewritable", 1, 1, FEARG_1, NULL, --- 756,763 ret_first_arg, f_extend}, {"feedkeys", 1, 2, FEARG_1, NULL, ret_void, f_feedkeys}, ! {"file_readable", 1, 1, FEARG_1, NULL, // obsolete ! ret_number, f_filereadable}, {"filereadable", 1, 1, FEARG_1, NULL, ret_number, f_filereadable}, {"filewritable", 1, 1, FEARG_1, NULL, *** *** 900,909 ret_number, f_haslocaldir}, {"hasmapto", 1, 3, FEARG_1, NULL, ret_number, f_hasmapto}, ! {"highlightID", 1, 1, FEARG_1, NULL, ! ret_number, f_hlID},// obsolete ! {"highlight_exists",1, 1, FEARG_1,NULL, ! ret_number, f_hlexists},// obsolete {"histadd", 2, 2, FEARG_2, NULL, ret_number, f_histadd}, {"histdel", 1, 2, FEARG_1, NULL, --- 900,909 ret_number, f_haslocaldir}, {"hasmapto", 1, 3, FEARG_1, NULL, ret_number, f_hasmapto}, ! {"highlightID", 1, 1, FEARG_1, NULL, // obsolete ! ret_number, f_hlID}, ! {"highlight_exists",1, 1, FEARG_1,NULL, // obsolete ! ret_number, f_hlexists}, {"histadd", 2, 2, FEARG_2, NULL, ret_number, f_histadd}, {"histdel", 1, 2, FEARG_1, NULL, *** *** 976,983 ret_string, f_json_encode}, {"keys", 1, 1, FEARG_1, NULL, ret_list_string,f_keys}, ! {"last_buffer_nr",0, 0, 0,NULL, ! ret_number, f_last_buffer_nr}, // obsolete {"len", 1, 1, FEARG_1, NULL, ret_number, f_len}, {"libcall", 3, 3, FEARG_3, NULL, --- 976,983 ret_string, f_json_encode}, {"keys", 1, 1, FEARG_1, NULL, ret_list_string,f_keys}, ! {"last_buffer_nr",0, 0, 0,NULL, // obsolete ! ret_number, f_last_buffer_nr}, {"len", 1, 1, FEARG_1, NULL, ret_number, f_len}, {"libcall", 3, 3, FEARG_3, NULL, *** ../vim-8.2.1876/src/version.c 2020-10-21 14:24:51.178015688 +0200 --- src/version.c 2020-10-21 14:48
Patch 8.2.1876
Patch 8.2.1876 Problem:Vim9: argument types for builtin functions are not checked at compile time. Solution: Add an argument type checking mechanism. Implement type checks for one function. Files: src/evalfunc.c, src/proto/evalfunc.pro, src/vim9compile.c, src/testdir/test_vim9_func.vim, src/testdir/test_vim9_builtin.vim, src/testdir/Make_all.mak *** ../vim-8.2.1875/src/evalfunc.c 2020-10-17 19:29:47.526935795 +0200 --- src/evalfunc.c 2020-10-21 14:23:33.110211557 +0200 *** *** 259,264 --- 259,297 static void f_xor(typval_T *argvars, typval_T *rettv); + /* + * Functions that check the argument type of a builtin function. + * Each function returns FAIL and gives an error message if the type is wrong. + */ + + // Context passed to an arg_ function. + typedef struct { + int arg_count; // actual argument count + int arg_idx;// current argument index (first arg is zero) + } argcontext_T; + + // A function to check one argument type. The first argument is the type to + // check. If needed, other argument types can be obtained with the context. + // E.g. if "arg_idx" is 1, then (type - 1) is the first argument type. + typedef int (*argcheck_T)(type_T *, argcontext_T *); + + static int + arg_float_or_nr(type_T *type, argcontext_T *context) + { + if (type->tt_type == VAR_FLOAT || type->tt_type == VAR_NUMBER) + return OK; + arg_type_mismatch(&t_number, type, context->arg_idx + 1); + return FAIL; + } + + /* + * Lists of functions that check the argument types of a builtin function. + */ + argcheck_T arg1_float_or_nr[] = {arg_float_or_nr}; + + /* + * Functions that return the return type of a builtin function. + */ static type_T * ret_void(int argcount UNUSED, type_T **argtypes UNUSED) { *** *** 432,437 --- 465,471 char f_min_argc; // minimal number of arguments char f_max_argc; // maximal number of arguments char f_argtype; // for method: FEARG_ values + argcheck_T*f_argcheck;// list of functions to check argument types type_T*(*f_retfunc)(int argcount, type_T **argtypes); // return type function void (*f_func)(typval_T *args, typval_T *rvar); *** *** 488,1108 static funcentry_T global_functions[] = { ! {"abs", 1, 1, FEARG_1,ret_any, FLOAT_FUNC(f_abs)}, ! {"acos", 1, 1, FEARG_1,ret_float,FLOAT_FUNC(f_acos)}, ! {"add", 2, 2, FEARG_1,ret_first_arg, f_add}, ! {"and", 2, 2, FEARG_1,ret_number, f_and}, ! {"append",2, 2, FEARG_2,ret_number, f_append}, ! {"appendbufline", 3, 3, FEARG_3,ret_number, f_appendbufline}, ! {"argc", 0, 1, 0, ret_number, f_argc}, ! {"argidx",0, 0, 0, ret_number, f_argidx}, ! {"arglistid", 0, 2, 0, ret_number, f_arglistid}, ! {"argv", 0, 2, 0, ret_argv, f_argv}, ! {"asin", 1, 1, FEARG_1,ret_float,FLOAT_FUNC(f_asin)}, ! {"assert_beeps", 1, 2, FEARG_1,ret_number, f_assert_beeps}, ! {"assert_equal", 2, 3, FEARG_2,ret_number, f_assert_equal}, ! {"assert_equalfile", 2, 3, FEARG_1, ret_number, f_assert_equalfile}, ! {"assert_exception", 1, 2, 0, ret_number, f_assert_exception}, ! {"assert_fails", 1, 5, FEARG_1,ret_number, f_assert_fails}, ! {"assert_false", 1, 2, FEARG_1,ret_number, f_assert_false}, ! {"assert_inrange",3, 4, FEARG_3,ret_number, f_assert_inrange}, ! {"assert_match", 2, 3, FEARG_2,ret_number, f_assert_match}, ! {"assert_notequal", 2, 3, FEARG_2,ret_number, f_assert_notequal}, ! {"assert_notmatch", 2, 3, FEARG_2,ret_number, f_assert_notmatch}, ! {"assert_report", 1, 1, FEARG_1,ret_number, f_assert_report}, ! {"assert_true", 1, 2, FEARG_1,ret_number, f_assert_true}, ! {"atan", 1, 1, FEARG_1,ret_float,FLOAT_FUNC(f_atan)}, ! {"atan2", 2, 2, FEARG_1,ret_float,FLOAT_FUNC(f_atan2)}, ! {"balloon_gettext", 0, 0, 0, ret_string, #ifdef FEAT_BEVAL f_balloon_gettext #else NULL #endif }, ! {"balloon_show", 1, 1, FEARG_1,ret_void, #ifdef FEAT_BEVAL f_balloon_show #else NULL #endif }, ! {"balloon_split", 1, 1, FEARG_1,ret_list_string, #if defined(FEAT_BEVAL_TERM) f_balloon_split #else NULL #endif }, ! {"browse",4, 4, 0, ret_string, f_browse}, ! {"browsedir", 2, 2, 0, ret_string, f_browsedi
Patch 8.2.1875
Patch 8.2.1875 Problem:Warning when building GTK gui. Solution: Add missing function parameter. Files: src/gui_gtk_f.c *** ../vim-8.2.1874/src/gui_gtk_f.c 2020-04-12 19:37:13.510297280 +0200 --- src/gui_gtk_f.c 2020-10-21 12:15:23.445883076 +0200 *** *** 51,57 static void gtk_form_class_init(GtkFormClass *klass); ! static void gtk_form_init(GtkForm *form); static void gtk_form_realize(GtkWidget *widget); static void gtk_form_unrealize(GtkWidget *widget); --- 51,57 static void gtk_form_class_init(GtkFormClass *klass); ! static void gtk_form_init(GtkForm *form, void *g_class); static void gtk_form_realize(GtkWidget *widget); static void gtk_form_unrealize(GtkWidget *widget); *** *** 270,276 } static void ! gtk_form_init(GtkForm *form) { #if GTK_CHECK_VERSION(3,0,0) gtk_widget_set_has_window(GTK_WIDGET(form), TRUE); --- 270,276 } static void ! gtk_form_init(GtkForm *form, void *g_class UNUSED) { #if GTK_CHECK_VERSION(3,0,0) gtk_widget_set_has_window(GTK_WIDGET(form), TRUE); *** ../vim-8.2.1874/src/version.c 2020-10-21 12:19:50.080854732 +0200 --- src/version.c 2020-10-21 12:37:27.814864303 +0200 *** *** 752,753 --- 752,755 { /* Add new patch number below this line */ + /**/ + 1875, /**/ -- Common sense is what tells you that the world is flat. /// Bram Moolenaar -- b...@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/// -- -- You received this message from the "vim_dev" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php --- You received this message because you are subscribed to the Google Groups "vim_dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/vim_dev/202010211038.09LAcWGE019247%40masaka.moolenaar.net.
Patch 8.2.1874
Patch 8.2.1874 Problem:Can't do something just before leaving Insert mode. Solution: Add the InsertLeavePre autocommand event. (closes #7177) Files: runtime/doc/autocmd.txt, src/edit.c, src/vim.h, src/autocmd.c, src/testdir/test_edit.vim *** ../vim-8.2.1873/runtime/doc/autocmd.txt 2020-06-12 22:08:56.414965077 +0200 --- runtime/doc/autocmd.txt 2020-10-21 12:06:06.018654049 +0200 *** *** 881,889 The cursor is restored afterwards. If you do not want that set |v:char| to a non-empty string. *InsertLeave* ! InsertLeave When leaving Insert mode. Also when using ! CTRL-O |i_CTRL-O|. But not for |i_CTRL-C|. *MenuPopup* MenuPopup Just before showing the popup menu (under the right mouse button). Useful for adjusting the --- 881,894 The cursor is restored afterwards. If you do not want that set |v:char| to a non-empty string. + *InsertLeavePre* + InsertLeavePreJust before leaving Insert mode. Also when + using CTRL-O |i_CTRL-O|. Be caseful not to + change mode or use `:normal`, it will likely + cause trouble. *InsertLeave* ! InsertLeave Just after leaving Insert mode. Also when ! using CTRL-O |i_CTRL-O|. But not for |i_CTRL-C|. *MenuPopup* MenuPopup Just before showing the popup menu (under the right mouse button). Useful for adjusting the *** ../vim-8.2.1873/src/edit.c 2020-09-27 20:12:49.417331796 +0200 --- src/edit.c 2020-10-21 12:00:20.965391532 +0200 *** *** 3607,3612 --- 3607,3615 undisplay_dollar(); } + if (cmdchar != 'r' && cmdchar != 'v') + ins_apply_autocmds(EVENT_INSERTLEAVEPRE); + // When an autoindent was removed, curswant stays after the // indent if (restart_edit == NUL && (colnr_T)temp == curwin->w_cursor.col) *** ../vim-8.2.1873/src/vim.h 2020-09-27 15:19:23.638118934 +0200 --- src/vim.h 2020-10-21 12:03:59.358030595 +0200 *** *** 1298,1304 EVENT_INSERTCHANGE, // when changing Insert/Replace mode EVENT_INSERTCHARPRE, // before inserting a char EVENT_INSERTENTER,// when entering Insert mode ! EVENT_INSERTLEAVE,// when leaving Insert mode EVENT_MENUPOPUP, // just before popup menu is displayed EVENT_OPTIONSET, // option was set EVENT_QUICKFIXCMDPOST,// after :make, :grep etc. --- 1298,1305 EVENT_INSERTCHANGE, // when changing Insert/Replace mode EVENT_INSERTCHARPRE, // before inserting a char EVENT_INSERTENTER,// when entering Insert mode ! EVENT_INSERTLEAVEPRE, // just before leaving Insert mode ! EVENT_INSERTLEAVE,// just after leaving Insert mode EVENT_MENUPOPUP, // just before popup menu is displayed EVENT_OPTIONSET, // option was set EVENT_QUICKFIXCMDPOST,// after :make, :grep etc. *** *** 1325,1331 EVENT_TABNEW, // when entering a new tab page EVENT_TERMCHANGED,// after changing 'term' EVENT_TERMINALOPEN, // after a terminal buffer was created ! EVENT_TERMINALWINOPEN,// after a terminal buffer was created and entering its window EVENT_TERMRESPONSE, // after setting "v:termresponse" EVENT_TEXTCHANGED,// text was modified not in Insert mode EVENT_TEXTCHANGEDI, // text was modified in Insert mode --- 1326,1333 EVENT_TABNEW, // when entering a new tab page EVENT_TERMCHANGED,// after changing 'term' EVENT_TERMINALOPEN, // after a terminal buffer was created ! EVENT_TERMINALWINOPEN,// after a terminal buffer was created and ! // entering its window EVENT_TERMRESPONSE, // after setting "v:termresponse" EVENT_TEXTCHANGED,// text was modified not in Insert mode EVENT_TEXTCHANGEDI, // text was modified in Insert mode *** ../vim-8.2.1873/src/autocmd.c 2020-10-01 22:37:36.403376674 +0200 --- src/autocmd.c 2020-10-21 12:16:43.157448322