diff options
author | Alexander Larsson <alexl@redhat.com> | 2010-03-09 11:10:00 +0100 |
---|---|---|
committer | Alexander Larsson <alexl@redhat.com> | 2010-03-09 11:10:00 +0100 |
commit | 90c5766caf16e35cb871116a4655a106a3c272dc (patch) | |
tree | ddc2ea976240a3f8f9c3294b41492256e6eb3f82 /common/canvas_utils.c | |
parent | 5cb99e12c6817592f49ca153a3081dd6b5995cf2 (diff) | |
download | spice-90c5766caf16e35cb871116a4655a106a3c272dc.tar.gz spice-90c5766caf16e35cb871116a4655a106a3c272dc.tar.xz spice-90c5766caf16e35cb871116a4655a106a3c272dc.zip |
Use macros from <spice/macros.h> rather than duplicate them
Diffstat (limited to 'common/canvas_utils.c')
-rw-r--r-- | common/canvas_utils.c | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/common/canvas_utils.c b/common/canvas_utils.c index 89ebe121..2ab8f0b6 100644 --- a/common/canvas_utils.c +++ b/common/canvas_utils.c @@ -18,6 +18,8 @@ #include "canvas_utils.h" +#include <spice/macros.h> + #ifdef __GNUC__ #include <stdlib.h> #include <stdio.h> @@ -42,10 +44,6 @@ extern int gdi_handlers; } #endif -#ifndef ALIGN -#define ALIGN(a, b) (((a) + ((b) - 1)) & ~((b) - 1)) -#endif - static void release_data(pixman_image_t *image, void *release_data) { PixmanData *data = (PixmanData *)release_data; @@ -154,11 +152,11 @@ pixman_image_t * surface_create(pixman_format_code_t format, int width, int heig break; case PIXMAN_a8: bitmap_info.inf.bmiHeader.biBitCount = 8; - nstride = ALIGN(width, 4); + nstride = SPICE_ALIGN(width, 4); break; case PIXMAN_a1: bitmap_info.inf.bmiHeader.biBitCount = 1; - nstride = ALIGN(width, 32) / 8; + nstride = SPICE_ALIGN(width, 32) / 8; break; default: CANVAS_ERROR("invalid format"); @@ -208,10 +206,10 @@ pixman_image_t * surface_create(pixman_format_code_t format, int width, int heig stride = width * 4; break; case PIXMAN_a8: - stride = ALIGN(width, 4); + stride = SPICE_ALIGN(width, 4); break; case PIXMAN_a1: - stride = ALIGN(width, 32) / 8; + stride = SPICE_ALIGN(width, 32) / 8; break; default: CANVAS_ERROR("invalid format"); |