Mercurial > vim
comparison src/ui.c @ 16768:695d9ef00b03 v8.1.1386
patch 8.1.1386: unessesary type casts for lalloc()
commit https://github.com/vim/vim/commit/18a4ba29aeccb9841d5bfdd2eaaffdfae2f15ced
Author: Bram Moolenaar <Bram@vim.org>
Date: Fri May 24 19:39:03 2019 +0200
patch 8.1.1386: unessesary type casts for lalloc()
Problem: Unessesary type casts for lalloc().
Solution: Remove type casts. Change lalloc(size, TRUE) to alloc(size).
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Fri, 24 May 2019 19:45:05 +0200 |
parents | 7ae2396cef62 |
children | ce04ebdf26b8 |
comparison
equal
deleted
inserted
replaced
16767:3959544fc067 | 16768:695d9ef00b03 |
---|---|
1512 len = (row2 - row1 + 1) * Columns + 1; | 1512 len = (row2 - row1 + 1) * Columns + 1; |
1513 if (enc_dbcs != 0) | 1513 if (enc_dbcs != 0) |
1514 len *= 2; /* max. 2 bytes per display cell */ | 1514 len *= 2; /* max. 2 bytes per display cell */ |
1515 else if (enc_utf8) | 1515 else if (enc_utf8) |
1516 len *= MB_MAXBYTES; | 1516 len *= MB_MAXBYTES; |
1517 buffer = lalloc((long_u)len, TRUE); | 1517 buffer = alloc(len); |
1518 if (buffer == NULL) /* out of memory */ | 1518 if (buffer == NULL) /* out of memory */ |
1519 return; | 1519 return; |
1520 | 1520 |
1521 /* Process each row in the selection */ | 1521 /* Process each row in the selection */ |
1522 for (bufp = buffer, row = row1; row <= row2; row++) | 1522 for (bufp = buffer, row = row1; row <= row2; row++) |
1895 get_input_buf(void) | 1895 get_input_buf(void) |
1896 { | 1896 { |
1897 garray_T *gap; | 1897 garray_T *gap; |
1898 | 1898 |
1899 /* We use a growarray to store the data pointer and the length. */ | 1899 /* We use a growarray to store the data pointer and the length. */ |
1900 gap = (garray_T *)alloc((unsigned)sizeof(garray_T)); | 1900 gap = (garray_T *)alloc(sizeof(garray_T)); |
1901 if (gap != NULL) | 1901 if (gap != NULL) |
1902 { | 1902 { |
1903 /* Add one to avoid a zero size. */ | 1903 /* Add one to avoid a zero size. */ |
1904 gap->ga_data = alloc((unsigned)inbufcount + 1); | 1904 gap->ga_data = alloc(inbufcount + 1); |
1905 if (gap->ga_data != NULL) | 1905 if (gap->ga_data != NULL) |
1906 mch_memmove(gap->ga_data, inbuf, (size_t)inbufcount); | 1906 mch_memmove(gap->ga_data, inbuf, (size_t)inbufcount); |
1907 gap->ga_len = inbufcount; | 1907 gap->ga_len = inbufcount; |
1908 } | 1908 } |
1909 trash_input_buf(); | 1909 trash_input_buf(); |