comparison src/userfunc.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 ef00b6bc186b
children ce04ebdf26b8
comparison
equal deleted inserted replaced
16767:3959544fc067 16768:695d9ef00b03
290 char_u *p; 290 char_u *p;
291 char_u name[20]; 291 char_u name[20];
292 292
293 sprintf((char*)name, "<lambda>%d", ++lambda_no); 293 sprintf((char*)name, "<lambda>%d", ++lambda_no);
294 294
295 fp = (ufunc_T *)alloc_clear((unsigned)(sizeof(ufunc_T) + STRLEN(name))); 295 fp = (ufunc_T *)alloc_clear(sizeof(ufunc_T) + STRLEN(name));
296 if (fp == NULL) 296 if (fp == NULL)
297 goto errret; 297 goto errret;
298 pt = (partial_T *)alloc_clear((unsigned)sizeof(partial_T)); 298 pt = (partial_T *)alloc_clear(sizeof(partial_T));
299 if (pt == NULL) 299 if (pt == NULL)
300 goto errret; 300 goto errret;
301 301
302 ga_init2(&newlines, (int)sizeof(char_u *), 1); 302 ga_init2(&newlines, (int)sizeof(char_u *), 1);
303 if (ga_grow(&newlines, 1) == FAIL) 303 if (ga_grow(&newlines, 1) == FAIL)
2578 semsg(_("E746: Function name does not match script file name: %s"), name); 2578 semsg(_("E746: Function name does not match script file name: %s"), name);
2579 goto erret; 2579 goto erret;
2580 } 2580 }
2581 } 2581 }
2582 2582
2583 fp = (ufunc_T *)alloc_clear((unsigned)(sizeof(ufunc_T) + STRLEN(name))); 2583 fp = (ufunc_T *)alloc_clear(sizeof(ufunc_T) + STRLEN(name));
2584 if (fp == NULL) 2584 if (fp == NULL)
2585 goto erret; 2585 goto erret;
2586 2586
2587 if (fudi.fd_dict != NULL) 2587 if (fudi.fd_dict != NULL)
2588 { 2588 {
2749 len = 1; /* avoid getting error for allocating zero bytes */ 2749 len = 1; /* avoid getting error for allocating zero bytes */
2750 fp->uf_tm_count = 0; 2750 fp->uf_tm_count = 0;
2751 profile_zero(&fp->uf_tm_self); 2751 profile_zero(&fp->uf_tm_self);
2752 profile_zero(&fp->uf_tm_total); 2752 profile_zero(&fp->uf_tm_total);
2753 if (fp->uf_tml_count == NULL) 2753 if (fp->uf_tml_count == NULL)
2754 fp->uf_tml_count = (int *)alloc_clear( 2754 fp->uf_tml_count = (int *)alloc_clear(sizeof(int) * len);
2755 (unsigned)(sizeof(int) * len));
2756 if (fp->uf_tml_total == NULL) 2755 if (fp->uf_tml_total == NULL)
2757 fp->uf_tml_total = (proftime_T *)alloc_clear( 2756 fp->uf_tml_total = (proftime_T *)alloc_clear(
2758 (unsigned)(sizeof(proftime_T) * len)); 2757 sizeof(proftime_T) * len);
2759 if (fp->uf_tml_self == NULL) 2758 if (fp->uf_tml_self == NULL)
2760 fp->uf_tml_self = (proftime_T *)alloc_clear( 2759 fp->uf_tml_self = (proftime_T *)alloc_clear(
2761 (unsigned)(sizeof(proftime_T) * len)); 2760 sizeof(proftime_T) * len);
2762 fp->uf_tml_idx = -1; 2761 fp->uf_tml_idx = -1;
2763 if (fp->uf_tml_count == NULL || fp->uf_tml_total == NULL 2762 if (fp->uf_tml_count == NULL || fp->uf_tml_total == NULL
2764 || fp->uf_tml_self == NULL) 2763 || fp->uf_tml_self == NULL)
2765 return; /* out of memory */ 2764 return; /* out of memory */
2766 fp->uf_prof_initialized = TRUE; 2765 fp->uf_prof_initialized = TRUE;