Mercurial > vim
comparison src/evalfunc.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 |
---|---|
1853 ret_number_bool, f_writefile}, | 1853 ret_number_bool, f_writefile}, |
1854 {"xor", 2, 2, FEARG_1, NULL, | 1854 {"xor", 2, 2, FEARG_1, NULL, |
1855 ret_number, f_xor}, | 1855 ret_number, f_xor}, |
1856 }; | 1856 }; |
1857 | 1857 |
1858 #if defined(EBCDIC) || defined(PROTO) | |
1859 /* | |
1860 * Compare funcentry_T by function name. | |
1861 */ | |
1862 static int | |
1863 compare_func_name(const void *s1, const void *s2) | |
1864 { | |
1865 funcentry_T *p1 = (funcentry_T *)s1; | |
1866 funcentry_T *p2 = (funcentry_T *)s2; | |
1867 | |
1868 return STRCMP(p1->f_name, p2->f_name); | |
1869 } | |
1870 | |
1871 /* | |
1872 * Sort the function table by function name. | |
1873 * The sorting of the table above is ASCII dependent. | |
1874 * On machines using EBCDIC we have to sort it. | |
1875 */ | |
1876 void | |
1877 sortFunctions(void) | |
1878 { | |
1879 size_t funcCnt = ARRAY_LENGTH(global_functions); | |
1880 | |
1881 qsort(global_functions, funcCnt, sizeof(funcentry_T), compare_func_name); | |
1882 } | |
1883 #endif | |
1884 | |
1858 /* | 1885 /* |
1859 * Function given to ExpandGeneric() to obtain the list of internal | 1886 * Function given to ExpandGeneric() to obtain the list of internal |
1860 * or user defined function names. | 1887 * or user defined function names. |
1861 */ | 1888 */ |
1862 char_u * | 1889 char_u * |