Mercurial > vim
comparison src/version.c @ 16825:ce04ebdf26b8 v8.1.1414
patch 8.1.1414: alloc() returning "char_u *" causes a lot of type casts
commit https://github.com/vim/vim/commit/c799fe206e61f2e2c1231bc46cbe4bb354f3da69
Author: Bram Moolenaar <Bram@vim.org>
Date: Tue May 28 23:08:19 2019 +0200
patch 8.1.1414: alloc() returning "char_u *" causes a lot of type casts
Problem: Alloc() returning "char_u *" causes a lot of type casts.
Solution: Have it return "void *". (Mike Williams) Define ALLOC_ONE() to
check the simple allocations.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Tue, 28 May 2019 23:15:10 +0200 |
parents | b1b7c7a31679 |
children | ce562b9f702e |
comparison
equal
deleted
inserted
replaced
16824:1f6bb29738d2 | 16825:ce04ebdf26b8 |
---|---|
59 size_t len = strlen(msg) | 59 size_t len = strlen(msg) |
60 + strlen(VIM_VERSION_LONG_ONLY) | 60 + strlen(VIM_VERSION_LONG_ONLY) |
61 + strlen(VIM_VERSION_DATE_ONLY) | 61 + strlen(VIM_VERSION_DATE_ONLY) |
62 + strlen(date_time); | 62 + strlen(date_time); |
63 | 63 |
64 longVersion = (char *)alloc(len); | 64 longVersion = alloc(len); |
65 if (longVersion == NULL) | 65 if (longVersion == NULL) |
66 longVersion = VIM_VERSION_LONG; | 66 longVersion = VIM_VERSION_LONG; |
67 else | 67 else |
68 vim_snprintf(longVersion, len, msg, | 68 vim_snprintf(longVersion, len, msg, |
69 VIM_VERSION_LONG_ONLY, VIM_VERSION_DATE_ONLY, date_time); | 69 VIM_VERSION_LONG_ONLY, VIM_VERSION_DATE_ONLY, date_time); |
765 NULL | 765 NULL |
766 }; | 766 }; |
767 | 767 |
768 static int included_patches[] = | 768 static int included_patches[] = |
769 { /* Add new patch number below this line */ | 769 { /* Add new patch number below this line */ |
770 /**/ | |
771 1414, | |
770 /**/ | 772 /**/ |
771 1413, | 773 1413, |
772 /**/ | 774 /**/ |
773 1412, | 775 1412, |
774 /**/ | 776 /**/ |