summaryrefslogtreecommitdiff
path: root/src/netbeans.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2019-05-24 18:54:09 +0200
committerBram Moolenaar <Bram@vim.org>2019-05-24 18:54:09 +0200
commit964b3746b9c81e65887e2ac9a335f181db2bb592 (patch)
tree9afaaac41a1c4f71b359fd6706b88df00e22e7a1 /src/netbeans.c
parentd33a764123a8aedb20cd84aeff3b94810ee67c4c (diff)
downloadvim-git-964b3746b9c81e65887e2ac9a335f181db2bb592.tar.gz
patch 8.1.1384: using "int" for alloc() often results in compiler warningsv8.1.1384
Problem: Using "int" for alloc() often results in compiler warnings. Solution: Use "size_t" and remove type casts. Remove alloc_check(), Vim only works with 32 bit ints anyway.
Diffstat (limited to 'src/netbeans.c')
-rw-r--r--src/netbeans.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/src/netbeans.c b/src/netbeans.c
index 7c2ab42b9..f1ba01a08 100644
--- a/src/netbeans.c
+++ b/src/netbeans.c
@@ -790,7 +790,7 @@ nb_reply_text(int cmdno, char_u *result)
nbdebug(("REP %d: %s\n", cmdno, (char *)result));
- reply = alloc((unsigned)STRLEN(result) + 32);
+ reply = alloc(STRLEN(result) + 32);
sprintf((char *)reply, "%d %s\n", cmdno, (char *)result);
nb_send((char *)reply, "nb_reply_text");
@@ -819,7 +819,7 @@ nb_reply_nr(int cmdno, long result)
static char_u *
nb_quote(char_u *txt)
{
- char_u *buf = alloc((unsigned)(2 * STRLEN(txt) + 1));
+ char_u *buf = alloc(2 * STRLEN(txt) + 1);
char_u *p = txt;
char_u *q = buf;
@@ -951,7 +951,7 @@ nb_joinlines(linenr_T first, linenr_T other)
len_first = (int)STRLEN(ml_get(first));
len_other = (int)STRLEN(ml_get(other));
- p = alloc((unsigned)(len_first + len_other + 1));
+ p = alloc(len_first + len_other + 1);
if (p != NULL)
{
mch_memmove(p, ml_get(first), len_first);
@@ -1084,8 +1084,7 @@ nb_do_cmd(
{
len = get_buf_size(buf->bufp);
nlines = buf->bufp->b_ml.ml_line_count;
- text = alloc((unsigned)((len > 0)
- ? ((len + nlines) * 2) : 4));
+ text = alloc((len > 0) ? ((len + nlines) * 2) : 4);
if (text == NULL)
{
nbdebug((" nb_do_cmd: getText has null text field\n"));
@@ -1395,8 +1394,7 @@ nb_do_cmd(
char_u *newline;
/* Insert halfway a line. */
- newline = alloc_check(
- (unsigned)(STRLEN(oldline) + len + 1));
+ newline = alloc(STRLEN(oldline) + len + 1);
if (newline != NULL)
{
mch_memmove(newline, oldline, (size_t)pos->col);