summaryrefslogtreecommitdiff
path: root/src/fileio.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2019-05-24 19:39:03 +0200
committerBram Moolenaar <Bram@vim.org>2019-05-24 19:39:03 +0200
commit18a4ba29aeccb9841d5bfdd2eaaffdfae2f15ced (patch)
tree408ad339f6b34876d2fa481ac61568c7739b1160 /src/fileio.c
parent71de720c2c117137185a6fc233b35aab37f0d4bc (diff)
downloadvim-git-18a4ba29aeccb9841d5bfdd2eaaffdfae2f15ced.tar.gz
patch 8.1.1386: unessesary type casts for lalloc()v8.1.1386
Problem: Unessesary type casts for lalloc(). Solution: Remove type casts. Change lalloc(size, TRUE) to alloc(size).
Diffstat (limited to 'src/fileio.c')
-rw-r--r--src/fileio.c16
1 files changed, 6 insertions, 10 deletions
diff --git a/src/fileio.c b/src/fileio.c
index 4182d563f..96207ab9c 100644
--- a/src/fileio.c
+++ b/src/fileio.c
@@ -89,7 +89,7 @@ struct bw_info
int bw_restlen; /* nr of bytes in bw_rest[] */
int bw_first; /* first write call */
char_u *bw_conv_buf; /* buffer for writing converted chars */
- int bw_conv_buflen; /* size of bw_conv_buf */
+ size_t bw_conv_buflen; /* size of bw_conv_buf */
int bw_conv_error; /* set for conversion error */
linenr_T bw_conv_error_lnum; /* first line with error or zero */
linenr_T bw_start_lnum; /* line number at start of buffer */
@@ -1189,7 +1189,7 @@ retry:
{
for ( ; size >= 10; size = (long)((long_u)size >> 1))
{
- if ((new_buffer = lalloc((long_u)(size + linerest + 1),
+ if ((new_buffer = lalloc(size + linerest + 1,
FALSE)) != NULL)
break;
}
@@ -4168,8 +4168,7 @@ buf_write(
write_info.bw_conv_buflen = bufsize * 2;
else /* FIO_UCS4 */
write_info.bw_conv_buflen = bufsize * 4;
- write_info.bw_conv_buf
- = lalloc((long_u)write_info.bw_conv_buflen, TRUE);
+ write_info.bw_conv_buf = alloc(write_info.bw_conv_buflen);
if (write_info.bw_conv_buf == NULL)
end = 0;
}
@@ -4180,8 +4179,7 @@ buf_write(
{
/* Convert UTF-8 -> UCS-2 and UCS-2 -> DBCS. Worst-case * 4: */
write_info.bw_conv_buflen = bufsize * 4;
- write_info.bw_conv_buf
- = lalloc((long_u)write_info.bw_conv_buflen, TRUE);
+ write_info.bw_conv_buf = alloc(write_info.bw_conv_buflen);
if (write_info.bw_conv_buf == NULL)
end = 0;
}
@@ -4191,8 +4189,7 @@ buf_write(
if (converted && wb_flags == 0 && (wb_flags = get_mac_fio_flags(fenc)) != 0)
{
write_info.bw_conv_buflen = bufsize * 3;
- write_info.bw_conv_buf
- = lalloc((long_u)write_info.bw_conv_buflen, TRUE);
+ write_info.bw_conv_buf = alloc(write_info.bw_conv_buflen);
if (write_info.bw_conv_buf == NULL)
end = 0;
}
@@ -4212,8 +4209,7 @@ buf_write(
{
/* We're going to use iconv(), allocate a buffer to convert in. */
write_info.bw_conv_buflen = bufsize * ICONV_MULT;
- write_info.bw_conv_buf
- = lalloc((long_u)write_info.bw_conv_buflen, TRUE);
+ write_info.bw_conv_buf = alloc(write_info.bw_conv_buflen);
if (write_info.bw_conv_buf == NULL)
end = 0;
write_info.bw_first = TRUE;