summaryrefslogtreecommitdiff
path: root/src/gui_photon.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2019-05-28 23:08:19 +0200
committerBram Moolenaar <Bram@vim.org>2019-05-28 23:08:19 +0200
commitc799fe206e61f2e2c1231bc46cbe4bb354f3da69 (patch)
tree68b3d2a8bb82519e29fc95f317d2ee02b07f95fa /src/gui_photon.c
parentb58a4b938c4bc7e0499700859bd7abba9acc5b11 (diff)
downloadvim-git-c799fe206e61f2e2c1231bc46cbe4bb354f3da69.tar.gz
patch 8.1.1414: alloc() returning "char_u *" causes a lot of type castsv8.1.1414
Problem: Alloc() returning "char_u *" causes a lot of type casts. Solution: Have it return "void *". (Mike Williams) Define ALLOC_ONE() to check the simple allocations.
Diffstat (limited to 'src/gui_photon.c')
-rw-r--r--src/gui_photon.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/gui_photon.c b/src/gui_photon.c
index d7731853b..8d0c27171 100644
--- a/src/gui_photon.c
+++ b/src/gui_photon.c
@@ -976,7 +976,7 @@ gui_ph_pg_add_buffer(char *name)
{
char **new_titles = NULL;
- new_titles = (char **) alloc((num_panels + 1) * sizeof(char **));
+ new_titles = ALLOC_MULT(char *, (num_panels + 1));
if (new_titles != NULL)
{
if (num_panels > 0)
@@ -1001,7 +1001,7 @@ gui_ph_pg_remove_buffer(char *name)
/* If there is only 1 panel, we just use the temporary place holder */
if (num_panels > 1)
{
- new_titles = (char **) alloc((num_panels - 1) * sizeof(char **));
+ new_titles = ALLOC_MULT(char *, num_panels - 1);
if (new_titles != NULL)
{
char **s = new_titles;
@@ -1108,7 +1108,7 @@ gui_mch_init(void)
PhDim_t window_size = {100, 100}; /* Arbitrary values */
PhPoint_t pos = {0, 0};
- gui.event_buffer = (PhEvent_t *) alloc(EVENT_BUFFER_SIZE);
+ gui.event_buffer = alloc(EVENT_BUFFER_SIZE);
if (gui.event_buffer == NULL)
return FAIL;
@@ -1519,7 +1519,7 @@ gui_mch_dialog(
title = "Vim";
buttons_copy = alloc(len + 1);
- button_array = (char_u **) alloc(button_count * sizeof(char_u *));
+ button_array = ALLOC_MULT(char_u *, button_count);
if (buttons_copy != NULL && button_array != NULL)
{
STRCPY(buttons_copy, buttons);