Apply memset-calloc.cocci
Change calls to malloc + memset to calloc whenever an automatic conversion can be done. Possible candidates are not treated here, only the ones we can be sure the conversion is safe. SVN revision: 51078
This commit is contained in:
parent
96d043addc
commit
5962d9d66c
|
@ -142,8 +142,7 @@ __imlib_ProduceImage(void)
|
|||
{
|
||||
ImlibImage *im;
|
||||
|
||||
im = malloc(sizeof(ImlibImage));
|
||||
memset(im, 0, sizeof(ImlibImage));
|
||||
im = calloc(1, sizeof(ImlibImage));
|
||||
im->data = NULL;
|
||||
im->file = NULL;
|
||||
im->real_file = NULL;
|
||||
|
@ -393,8 +392,7 @@ __imlib_ProduceImagePixmap(void)
|
|||
{
|
||||
ImlibImagePixmap *ip;
|
||||
|
||||
ip = malloc(sizeof(ImlibImagePixmap));
|
||||
memset(ip, 0, sizeof(ImlibImagePixmap));
|
||||
ip = calloc(1, sizeof(ImlibImagePixmap));
|
||||
ip->display = NULL;
|
||||
ip->visual = NULL;
|
||||
ip->image = NULL;
|
||||
|
|
|
@ -587,8 +587,7 @@ __imlib_RenderImageSkewed(Display * d, ImlibImage * im, Drawable w, Drawable m,
|
|||
ct = __imlib_GetContext(d, v, cm, depth);
|
||||
|
||||
back = __imlib_CreateImage(dw, dh, NULL);
|
||||
back->data = malloc(dw * dh * sizeof(DATA32));
|
||||
memset(back->data, 0, dw * dh * sizeof(DATA32));
|
||||
back->data = calloc(dw * dh, sizeof(DATA32));
|
||||
__imlib_GrabDrawableToRGBA(back->data, 0, 0, dw, dh, d, w, 0, v, cm,
|
||||
depth, dx1, dy1, dw, dh, 0, 1);
|
||||
|
||||
|
|
Loading…
Reference in New Issue