diff options
author | K.Takata <kentkt@csc.jp> | 2021-06-02 14:56:39 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2021-06-02 14:56:39 +0200 |
commit | eecf2b35a146d7d5512f2525ad631d796e19edac (patch) | |
tree | f0c23ecc84b037ccf886fbed295db48614a4e3f4 | |
parent | eeec2548785b2dd245a31ab25d7bde0f88ea1a6d (diff) | |
download | vim-git-eecf2b35a146d7d5512f2525ad631d796e19edac.tar.gz |
patch 8.2.2923: EBCDIC build is brokenv8.2.2923
Problem: EBCDIC build is broken.
Solution: Move sortFunctions() to evalfunc.c. (Ken Takata, closes #8306)
-rw-r--r-- | src/eval.c | 27 | ||||
-rw-r--r-- | src/evalfunc.c | 27 | ||||
-rw-r--r-- | src/proto/evalfunc.pro | 2 | ||||
-rw-r--r-- | src/version.c | 2 |
4 files changed, 30 insertions, 28 deletions
diff --git a/src/eval.c b/src/eval.c index 1ee4a3dbc..e39c604ad 100644 --- a/src/eval.c +++ b/src/eval.c @@ -104,33 +104,6 @@ num_modulus(varnumber_T n1, varnumber_T n2, int *failed) 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. */ diff --git a/src/evalfunc.c b/src/evalfunc.c index fcb64f67a..8ea48f9bd 100644 --- a/src/evalfunc.c +++ b/src/evalfunc.c @@ -1855,6 +1855,33 @@ static funcentry_T global_functions[] = 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. diff --git a/src/proto/evalfunc.pro b/src/proto/evalfunc.pro index 2b194486f..c1ac55f5b 100644 --- a/src/proto/evalfunc.pro +++ b/src/proto/evalfunc.pro @@ -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,5 +24,4 @@ void range_list_materialize(list_T *list); 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 : */ diff --git a/src/version.c b/src/version.c index 812731417..ee1dfa719 100644 --- a/src/version.c +++ b/src/version.c @@ -751,6 +751,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 2923, +/**/ 2922, /**/ 2921, |