summaryrefslogtreecommitdiff
path: root/pixman/pixman-edge.c
diff options
context:
space:
mode:
authorSiarhei Siamashka <siarhei.siamashka@gmail.com>2012-12-16 04:19:47 +0200
committerSiarhei Siamashka <siarhei.siamashka@gmail.com>2012-12-20 04:01:44 +0200
commit1d3075734798c845df386016f134cb8b60731925 (patch)
tree45377a5328998047acc003875f7a08b40b53f2d2 /pixman/pixman-edge.c
parent5a7cafaf54225b0adaf17467b4dd42b9ece9a93d (diff)
Fix "malloc/calloc return values need explicit casts" C++ errors
There are a number of places in pixman code which are using functions malloc/calloc/pixman_malloc_ab/pixman_malloc_abc: pixman-access.c: argb8_pixels = pixman_malloc_ab (width, sizeof(uint32_t)); pixman-bits-image.c: if ((alpha = malloc (width * sizeof (uint32_t)))) pixman-bits-image.c: if ((alpha = malloc (width * sizeof (argb_t)))) pixman-bits-image.c: return malloc (buf_size); pixman.c: boxes = pixman_malloc_ab (sizeof (pixman_box32_t), n_rects); pixman-filter.c: p = params = malloc (*width * n_phases * sizeof (pixman_fixed_t)); pixman-filter.c: params = malloc (*n_values * sizeof (pixman_fixed_t)); pixman-general.c: scanline_buffer = pixman_malloc_abc (width, 3, Bpp); pixman-glyph.c: if (!(cache = malloc (sizeof *cache))) pixman-glyph.c: if (!(glyph = malloc (sizeof *glyph))) pixman-image.c: pixman_malloc_ab (n_stops + 2, sizeof (pixman_gradient_stop_t)); pixman-image.c: pixman_image_t *image = malloc (sizeof (pixman_image_t)); pixman-image.c: common->transform = malloc (sizeof (pixman_transform_t)); pixman-image.c: new_params = pixman_malloc_ab (n_params, sizeof (pixman_fixed_t)); pixman-implementation.c: if ((imp = malloc (sizeof (pixman_implementation_t)))) pixman-region.c: return malloc (sz); pixman-region.c: rit = malloc (data_size); pixman-trap.c: traps = pixman_malloc_ab (n_tris, 2 * sizeof (pixman_trapezoid_t)); pixman-utils.c: return malloc (a * b); pixman-utils.c: return malloc (a * b * c); pixman-utils.c: boxes16 = pixman_malloc_ab (n_boxes, sizeof (pixman_box16_t)); pixman-utils.c: boxes32 = pixman_malloc_ab (n_boxes, sizeof (pixman_box32_t)); pixman-bits-image.c: return calloc (buf_size, 1); pixman-compiler.h: type *value = calloc (1, sizeof (type)); pixman-compiler.h: type *value = calloc (1, sizeof (type)); Unfortunately they fail to compile in C++ mode because the compiler wants explicit type casts for the returned pointers: http://stackoverflow.com/questions/3477741/why-does-c-require-a-cast-for-malloc-but-c-doesnt This patch tries to solve the problem in a less invasive way by adding some compatibility wrappers which allow compiling such C code without modifications.
Diffstat (limited to 'pixman/pixman-edge.c')
0 files changed, 0 insertions, 0 deletions