Mercurial > vim
comparison src/eval.c @ 24770:e75971b83263 v8.2.2923
patch 8.2.2923: EBCDIC build is broken
Commit: https://github.com/vim/vim/commit/eecf2b35a146d7d5512f2525ad631d796e19edac
Author: K.Takata <kentkt@csc.jp>
Date: Wed Jun 2 14:56:39 2021 +0200
patch 8.2.2923: EBCDIC build is broken
Problem: EBCDIC build is broken.
Solution: Move sortFunctions() to evalfunc.c. (Ken Takata, closes https://github.com/vim/vim/issues/8306)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Wed, 02 Jun 2021 15:00:03 +0200 |
parents | 7334bf933510 |
children | 7bc92a651472 |
comparison
equal
deleted
inserted
replaced
24769:b373619355a3 | 24770:e75971b83263 |
---|---|
101 if (failed != NULL) | 101 if (failed != NULL) |
102 *failed = TRUE; | 102 *failed = TRUE; |
103 } | 103 } |
104 return (n2 == 0) ? 0 : (n1 % n2); | 104 return (n2 == 0) ? 0 : (n1 % n2); |
105 } | 105 } |
106 | |
107 #if defined(EBCDIC) || defined(PROTO) | |
108 /* | |
109 * Compare struct fst by function name. | |
110 */ | |
111 static int | |
112 compare_func_name(const void *s1, const void *s2) | |
113 { | |
114 struct fst *p1 = (struct fst *)s1; | |
115 struct fst *p2 = (struct fst *)s2; | |
116 | |
117 return STRCMP(p1->f_name, p2->f_name); | |
118 } | |
119 | |
120 /* | |
121 * Sort the function table by function name. | |
122 * The sorting of the table above is ASCII dependent. | |
123 * On machines using EBCDIC we have to sort it. | |
124 */ | |
125 static void | |
126 sortFunctions(void) | |
127 { | |
128 int funcCnt = (int)ARRAY_LENGTH(functions) - 1; | |
129 | |
130 qsort(functions, (size_t)funcCnt, sizeof(struct fst), compare_func_name); | |
131 } | |
132 #endif | |
133 | 106 |
134 /* | 107 /* |
135 * Initialize the global and v: variables. | 108 * Initialize the global and v: variables. |
136 */ | 109 */ |
137 void | 110 void |