Patch 8.2.2923

5 views
Skip to first unread message

Bram Moolenaar

unread,
Jun 2, 2021, 8:57:20 AM6/2/21
to vim...@googlegroups.com

Patch 8.2.2923
Problem: EBCDIC build is broken.
Solution: Move sortFunctions() to evalfunc.c. (Ken Takata, closes #8306)
Files: src/eval.c, src/evalfunc.c, src/proto/evalfunc.pro


*** ../vim-8.2.2922/src/eval.c 2021-06-02 13:28:11.423120478 +0200
--- src/eval.c 2021-06-02 14:53:47.704356143 +0200
***************
*** 104,136 ****
return (n2 == 0) ? 0 : (n1 % n2);
}

- #if defined(EBCDIC) || defined(PROTO)
- /*
- * Compare struct fst by function name.
- */
- static int
- compare_func_name(const void *s1, const void *s2)
- {
- struct fst *p1 = (struct fst *)s1;
- struct fst *p2 = (struct fst *)s2;
-
- return STRCMP(p1->f_name, p2->f_name);
- }
-
- /*
- * Sort the function table by function name.
- * The sorting of the table above is ASCII dependent.
- * On machines using EBCDIC we have to sort it.
- */
- static void
- sortFunctions(void)
- {
- int funcCnt = (int)ARRAY_LENGTH(functions) - 1;
-
- qsort(functions, (size_t)funcCnt, sizeof(struct fst), compare_func_name);
- }
- #endif
-
/*
* Initialize the global and v: variables.
*/
--- 104,109 ----
*** ../vim-8.2.2922/src/evalfunc.c 2021-06-02 13:28:11.427120469 +0200
--- src/evalfunc.c 2021-06-02 14:53:47.704356143 +0200
***************
*** 1855,1860 ****
--- 1855,1887 ----
ret_number, f_xor},
};

+ #if defined(EBCDIC) || defined(PROTO)
+ /*
+ * Compare funcentry_T by function name.
+ */
+ static int
+ compare_func_name(const void *s1, const void *s2)
+ {
+ funcentry_T *p1 = (funcentry_T *)s1;
+ funcentry_T *p2 = (funcentry_T *)s2;
+
+ return STRCMP(p1->f_name, p2->f_name);
+ }
+
+ /*
+ * Sort the function table by function name.
+ * The sorting of the table above is ASCII dependent.
+ * On machines using EBCDIC we have to sort it.
+ */
+ void
+ sortFunctions(void)
+ {
+ size_t funcCnt = ARRAY_LENGTH(global_functions);
+
+ qsort(global_functions, funcCnt, sizeof(funcentry_T), compare_func_name);
+ }
+ #endif
+
/*
* Function given to ExpandGeneric() to obtain the list of internal
* or user defined function names.
*** ../vim-8.2.2922/src/proto/evalfunc.pro 2021-02-06 12:38:47.623324174 +0100
--- src/proto/evalfunc.pro 2021-06-02 14:55:13.896172066 +0200
***************
*** 1,4 ****
--- 1,5 ----
/* evalfunc.c */
+ void sortFunctions(void);
char_u *get_function_name(expand_T *xp, int idx);
char_u *get_expr_name(expand_T *xp, int idx);
int find_internal_func(char_u *name);
***************
*** 23,27 ****
float_T vim_round(float_T f);
long do_searchpair(char_u *spat, char_u *mpat, char_u *epat, int dir, typval_T *skip, int flags, pos_T *match_pos, linenr_T lnum_stop, long time_limit);
void f_string(typval_T *argvars, typval_T *rettv);
- void f_fullcommand(typval_T *argvars, typval_T *rettv);
/* vim: set ft=c : */
--- 24,27 ----
*** ../vim-8.2.2922/src/version.c 2021-06-02 13:28:11.439120443 +0200
--- src/version.c 2021-06-02 14:55:05.260190521 +0200
***************
*** 752,753 ****
--- 752,755 ----
{ /* Add new patch number below this line */
+ /**/
+ 2923,
/**/

--
Every person is responsible for the choices he makes.

/// Bram Moolenaar -- Br...@Moolenaar.net -- http://www.Moolenaar.net \\\
/// \\\
\\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
Reply all
Reply to author
Forward
0 new messages