mirror of
https://gitlab.freedesktop.org/cairo/cairo.git
synced 2025-12-20 04:40:07 +01:00
test : Maintain consistency in the usage of xcalloc
xcalloc is a wrapper for calloc. If it can't allocate memory then it terminates the program. The current changes replace the usages of calloc by xcalloc in tests. Signed-off-by: Ravi Nanjundappa <nravi.n@samsung.com>
This commit is contained in:
parent
69e10bc8b5
commit
d1453c512c
2 changed files with 2 additions and 2 deletions
|
|
@ -41,7 +41,7 @@ draw (cairo_t *cr, int width, int height)
|
|||
png = cairo_test_create_surface_from_png (ctx, png_filename);
|
||||
|
||||
stride = cairo_format_stride_for_width (format, width);
|
||||
data = calloc (stride, height);
|
||||
data = xcalloc (stride, height);
|
||||
inv = cairo_image_surface_create_for_data (data + stride * (height - 1),
|
||||
format, width, height, -stride);
|
||||
|
||||
|
|
|
|||
|
|
@ -41,7 +41,7 @@ draw (cairo_t *cr, int width, int height)
|
|||
png = cairo_test_create_surface_from_png (ctx, png_filename);
|
||||
|
||||
stride = cairo_format_stride_for_width (format, width) + 12;
|
||||
data = calloc (stride, height);
|
||||
data = xcalloc (stride, height);
|
||||
src = cairo_image_surface_create_for_data (data, format,
|
||||
width, height, stride);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue