Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
openSUSE:Evergreen:11.1
netpbm
netpbm-10.26.44-aliasing.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File netpbm-10.26.44-aliasing.patch of Package netpbm
--- lib/util/mallocvar.h +++ lib/util/mallocvar.h @@ -12,9 +12,8 @@ #include <limits.h> #include <stdlib.h> -static __inline__ void -mallocProduct(void ** const resultP, - unsigned int const factor1, +static __inline__ void * +mallocProduct(unsigned int const factor1, unsigned int const factor2) { /*---------------------------------------------------------------------------- malloc a space whose size in bytes is the product of 'factor1' and @@ -30,9 +29,9 @@ nobody really needs to allocate more than 4GB of memory. -----------------------------------------------------------------------------*/ if (UINT_MAX / factor2 < factor1) - *resultP = NULL; \ + return NULL; else - *resultP = malloc(factor1 * factor2); + return malloc(factor1 * factor2); } @@ -51,7 +50,7 @@ #define MALLOCARRAY(arrayName, nElements) \ - mallocProduct((void **)(void *)&arrayName, nElements, sizeof(arrayName[0])) + (arrayName = mallocProduct(nElements, sizeof(arrayName[0]))) #define REALLOCARRAY(arrayName, nElements) \ reallocProduct((void **)&arrayName, nElements, sizeof(arrayName[0]))
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor