To: vim_dev@googlegroups.com Subject: Patch 8.2.1492 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.2.1492 Problem: Build failures. Solution: Move typedef out of #ifdef. Adjust argument types. Discover America. Files: src/structs.h, src/ex_docmd.c *** ../vim-8.2.1491/src/structs.h 2020-08-20 15:02:38.536534973 +0200 --- src/structs.h 2020-08-20 15:15:08.184556430 +0200 *************** *** 1533,1538 **** --- 1533,1545 ---- typedef int (*cfunc_T)(int argcount, typval_T *argvars, typval_T *rettv, void *state); typedef void (*cfunc_free_T)(void *state); + // type of getline() last argument + typedef enum { + GETLINE_NONE, // do not concatenate any lines + GETLINE_CONCAT_CONT, // concatenate continuation lines + GETLINE_CONCAT_ALL // concatenate continuation and Vim9 # comment lines + } getline_opt_T; + #if defined(FEAT_EVAL) || defined(PROTO) typedef struct funccall_S funccall_T; *************** *** 1761,1773 **** # endif } scriptitem_T; - // type of getline() last argument - typedef enum { - GETLINE_NONE, // do not concatenate any lines - GETLINE_CONCAT_CONT, // concatenate continuation lines - GETLINE_CONCAT_ALL // concatenate continuation and Vim9 # comment lines - } getline_opt_T; - // Struct passed through eval() functions. // See EVALARG_EVALUATE for a fixed value with eval_flags set to EVAL_EVALUATE. typedef struct { --- 1768,1773 ---- *** ../vim-8.2.1491/src/ex_docmd.c 2020-08-20 15:02:38.536534973 +0200 --- src/ex_docmd.c 2020-08-20 15:20:30.751178452 +0200 *************** *** 20,28 **** #endif #ifdef FEAT_EVAL ! static char_u *do_one_cmd(char_u **, int, cstack_T *, char_u *(*fgetline)(int, void *, int, int), void *cookie); #else ! static char_u *do_one_cmd(char_u **, int, char_u *(*fgetline)(int, void *, int, int), void *cookie); static int if_level = 0; // depth in :if #endif static void append_command(char_u *cmd); --- 20,28 ---- #endif #ifdef FEAT_EVAL ! static char_u *do_one_cmd(char_u **, int, cstack_T *, char_u *(*fgetline)(int, void *, int, getline_opt_T), void *cookie); #else ! static char_u *do_one_cmd(char_u **, int, char_u *(*fgetline)(int, void *, int, getline_opt_T), void *cookie); static int if_level = 0; // depth in :if #endif static void append_command(char_u *cmd); *************** *** 403,413 **** int current_line; // last read line from growarray int repeating; // TRUE when looping a second time // When "repeating" is FALSE use "getline" and "cookie" to get lines ! char_u *(*getline)(int, void *, int, int); void *cookie; }; ! static char_u *get_loop_line(int c, void *cookie, int indent, int do_concat); static int store_loop_line(garray_T *gap, char_u *line); static void free_cmdlines(garray_T *gap); --- 403,413 ---- int current_line; // last read line from growarray int repeating; // TRUE when looping a second time // When "repeating" is FALSE use "getline" and "cookie" to get lines ! char_u *(*getline)(int, void *, int, getline_opt_T); void *cookie; }; ! static char_u *get_loop_line(int c, void *cookie, int indent, getline_opt_T options); static int store_loop_line(garray_T *gap, char_u *line); static void free_cmdlines(garray_T *gap); *************** *** 1419,1425 **** * Obtain a line when inside a ":while" or ":for" loop. */ static char_u * ! get_loop_line(int c, void *cookie, int indent, int do_concat) { struct loop_cookie *cp = (struct loop_cookie *)cookie; wcmd_T *wp; --- 1419,1425 ---- * Obtain a line when inside a ":while" or ":for" loop. */ static char_u * ! get_loop_line(int c, void *cookie, int indent, getline_opt_T options) { struct loop_cookie *cp = (struct loop_cookie *)cookie; wcmd_T *wp; *************** *** 1432,1440 **** // First time inside the ":while"/":for": get line normally. if (cp->getline == NULL) ! line = getcmdline(c, 0L, indent, do_concat); else ! line = cp->getline(c, cp->cookie, indent, do_concat); if (line != NULL && store_loop_line(cp->lines_gap, line) == OK) ++cp->current_line; --- 1432,1440 ---- // First time inside the ":while"/":for": get line normally. if (cp->getline == NULL) ! line = getcmdline(c, 0L, indent, options); else ! line = cp->getline(c, cp->cookie, indent, options); if (line != NULL && store_loop_line(cp->lines_gap, line) == OK) ++cp->current_line; *************** *** 1487,1493 **** char_u *(*func)(int, void *, int, getline_opt_T)) { #ifdef FEAT_EVAL ! char_u *(*gp)(int, void *, int, int); struct loop_cookie *cp; // When "fgetline" is "get_loop_line()" use the "cookie" to find the --- 1487,1493 ---- char_u *(*func)(int, void *, int, getline_opt_T)) { #ifdef FEAT_EVAL ! char_u *(*gp)(int, void *, int, getline_opt_T); struct loop_cookie *cp; // When "fgetline" is "get_loop_line()" use the "cookie" to find the *************** *** 1516,1522 **** void *cookie) // argument for fgetline() { #ifdef FEAT_EVAL ! char_u *(*gp)(int, void *, int, int); struct loop_cookie *cp; // When "fgetline" is "get_loop_line()" use the "cookie" to find the --- 1516,1522 ---- void *cookie) // argument for fgetline() { #ifdef FEAT_EVAL ! char_u *(*gp)(int, void *, int, getline_opt_T); struct loop_cookie *cp; // When "fgetline" is "get_loop_line()" use the "cookie" to find the *************** *** 1544,1550 **** char_u *(*fgetline)(int, void *, int, getline_opt_T) UNUSED, void *cookie) // argument for fgetline() { ! char_u *(*gp)(int, void *, int, int); struct loop_cookie *cp; wcmd_T *wp; --- 1544,1550 ---- char_u *(*fgetline)(int, void *, int, getline_opt_T) UNUSED, void *cookie) // argument for fgetline() { ! char_u *(*gp)(int, void *, int, getline_opt_T); struct loop_cookie *cp; wcmd_T *wp; *************** *** 1694,1700 **** #ifdef FEAT_EVAL cstack_T *cstack, #endif ! char_u *(*fgetline)(int, void *, int, int), void *cookie) // argument for fgetline() { char_u *p; --- 1694,1700 ---- #ifdef FEAT_EVAL cstack_T *cstack, #endif ! char_u *(*fgetline)(int, void *, int, getline_opt_T), void *cookie) // argument for fgetline() { char_u *p; *** ../vim-8.2.1491/src/version.c 2020-08-20 15:02:38.540534948 +0200 --- src/version.c 2020-08-20 15:21:32.426924971 +0200 *************** *** 756,757 **** --- 756,759 ---- { /* Add new patch number below this line */ + /**/ + 1492, /**/ -- 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 ///