Mercurial > vim
comparison src/dosinst.c @ 16782:fc58fee685e2 v8.1.1393
patch 8.1.1393: unnecessary type casts
commit https://github.com/vim/vim/commit/51e14387f120392b74b84408cafec33942337a05
Author: Bram Moolenaar <Bram@vim.org>
Date: Sat May 25 20:21:28 2019 +0200
patch 8.1.1393: unnecessary type casts
Problem: Unnecessary type casts.
Solution: Remove type casts from alloc() and lalloc() calls. (Mike Williams)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sat, 25 May 2019 20:30:06 +0200 |
parents | 7e733046db1d |
children | 1ec6539cef68 |
comparison
equal
deleted
inserted
replaced
16781:db5dc8db015c | 16782:fc58fee685e2 |
---|---|
304 if (strchr("/\\", *cp++) == NULL | 304 if (strchr("/\\", *cp++) == NULL |
305 || strchr(cp, '\\') != NULL | 305 || strchr(cp, '\\') != NULL |
306 || strchr(cp, '/') != NULL) | 306 || strchr(cp, '/') != NULL) |
307 return; | 307 return; |
308 | 308 |
309 tmpname = alloc((int)strlen(cp) + 1); | 309 tmpname = alloc(strlen(cp) + 1); |
310 strcpy(tmpname, cp); | 310 strcpy(tmpname, cp); |
311 tmpname[strlen(tmpname) - 1] = 'x'; /* .exe -> .exx */ | 311 tmpname[strlen(tmpname) - 1] = 'x'; /* .exe -> .exx */ |
312 | 312 |
313 if (access(tmpname, 0) == 0) | 313 if (access(tmpname, 0) == 0) |
314 { | 314 { |
960 alloc_text(int idx, char *fmt, char *arg) | 960 alloc_text(int idx, char *fmt, char *arg) |
961 { | 961 { |
962 if (choices[idx].text != NULL) | 962 if (choices[idx].text != NULL) |
963 free(choices[idx].text); | 963 free(choices[idx].text); |
964 | 964 |
965 choices[idx].text = alloc((int)(strlen(fmt) + strlen(arg)) - 1); | 965 choices[idx].text = alloc(strlen(fmt) + strlen(arg) - 1); |
966 sprintf(choices[idx].text, fmt, arg); | 966 sprintf(choices[idx].text, fmt, arg); |
967 } | 967 } |
968 | 968 |
969 /* | 969 /* |
970 * Toggle the "Overwrite .../vim.bat" to "Don't overwrite". | 970 * Toggle the "Overwrite .../vim.bat" to "Don't overwrite". |
1038 s = strchr(p, ';'); | 1038 s = strchr(p, ';'); |
1039 if (s == NULL) | 1039 if (s == NULL) |
1040 s = p + strlen(p); | 1040 s = p + strlen(p); |
1041 if (names != NULL) | 1041 if (names != NULL) |
1042 { | 1042 { |
1043 names[count] = alloc((int)(s - p) + 1); | 1043 names[count] = alloc(s - p + 1); |
1044 strncpy(names[count], p, s - p); | 1044 strncpy(names[count], p, s - p); |
1045 names[count][s - p] = NUL; | 1045 names[count][s - p] = NUL; |
1046 } | 1046 } |
1047 ++count; | 1047 ++count; |
1048 p = s; | 1048 p = s; |
1049 if (*p != NUL) | 1049 if (*p != NUL) |
1050 ++p; | 1050 ++p; |
1051 } | 1051 } |
1052 if (names != NULL) | 1052 if (names != NULL) |
1053 break; | 1053 break; |
1054 names = alloc((int)(count + 1) * sizeof(char *)); | 1054 names = alloc((count + 1) * sizeof(char *)); |
1055 } | 1055 } |
1056 names[0] = alloc(50); | 1056 names[0] = alloc(50); |
1057 sprintf(names[0], "Select directory to create %s in:", name); | 1057 sprintf(names[0], "Select directory to create %s in:", name); |
1058 names[count] = alloc(50); | 1058 names[count] = alloc(50); |
1059 if (choices[idx].arg == 0) | 1059 if (choices[idx].arg == 0) |