summaryrefslogtreecommitdiffstats
path: root/src/gui_gtk_x11.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/gui_gtk_x11.c
parentd33a764123a8aedb20cd84aeff3b94810ee67c4c (diff)
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/gui_gtk_x11.c')
-rw-r--r--src/gui_gtk_x11.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/gui_gtk_x11.c b/src/gui_gtk_x11.c
index 7d1d8d0c51..17ef6eabdc 100644
--- a/src/gui_gtk_x11.c
+++ b/src/gui_gtk_x11.c
@@ -429,7 +429,7 @@ gui_mch_prepare(int *argc, char **argv)
* into gui_argv. Freed later in gui_mch_init().
*/
gui_argc = 0;
- gui_argv = (char **)alloc((unsigned)((*argc + 1) * sizeof(char *)));
+ gui_argv = (char **)alloc((*argc + 1) * sizeof(char *));
g_return_if_fail(gui_argv != NULL);
@@ -1544,7 +1544,7 @@ selection_get_cb(GtkWidget *widget UNUSED,
if (info == (guint)TARGET_VIM)
{
- tmpbuf = alloc((unsigned)length + 1);
+ tmpbuf = alloc(length + 1);
if (tmpbuf != NULL)
{
tmpbuf[0] = motion_type;
@@ -1603,7 +1603,7 @@ selection_get_cb(GtkWidget *widget UNUSED,
int l = STRLEN(p_enc);
/* contents: motion_type 'encoding' NUL text */
- tmpbuf = alloc((unsigned)length + l + 2);
+ tmpbuf = alloc(length + l + 2);
if (tmpbuf != NULL)
{
tmpbuf[0] = motion_type;
@@ -2512,8 +2512,7 @@ setup_save_yourself(void)
if (i == count)
{
/* allocate an Atoms array which is one item longer */
- new_atoms = (Atom *)alloc((unsigned)((count + 1)
- * sizeof(Atom)));
+ new_atoms = (Atom *)alloc((count + 1) * sizeof(Atom));
if (new_atoms != NULL)
{
memcpy(new_atoms, existing_atoms, count * sizeof(Atom));