diff options
author | Tavian Barnes <tavianator@gmail.com> | 2010-05-05 20:09:38 -0600 |
---|---|---|
committer | Tavian Barnes <tavianator@gmail.com> | 2010-05-05 22:47:44 -0600 |
commit | 6c2943e735c99579b5b861f67f2d98e5ddd6306f (patch) | |
tree | e882a1dda2726dd9dfca3fe2dd44750b17b1edda /libdimension/dimension/canvas.h | |
parent | b14506e501770aeaf54d1160c0073398cc29a038 (diff) | |
download | dimension-6c2943e735c99579b5b861f67f2d98e5ddd6306f.tar.xz |
Use C99 for loop initializers.
Diffstat (limited to 'libdimension/dimension/canvas.h')
-rw-r--r-- | libdimension/dimension/canvas.h | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/libdimension/dimension/canvas.h b/libdimension/dimension/canvas.h index 306b55c..7caae69 100644 --- a/libdimension/dimension/canvas.h +++ b/libdimension/dimension/canvas.h @@ -25,9 +25,11 @@ #ifndef DIMENSION_CANVAS_H #define DIMENSION_CANVAS_H +#include <stddef.h> + typedef struct { /* width, height */ - unsigned int x, y; + size_t x, y; /* An array of dmnsn_canvas_optimizer's */ dmnsn_array *optimizers; @@ -45,7 +47,7 @@ typedef struct dmnsn_canvas_optimizer dmnsn_canvas_optimizer; /* Canvas optimizer callback types */ typedef void dmnsn_canvas_optimizer_fn(dmnsn_canvas *canvas, dmnsn_canvas_optimizer optimizer, - unsigned int x, unsigned int y); + size_t x, size_t y); /* Canvas optimizer */ struct dmnsn_canvas_optimizer { @@ -58,7 +60,7 @@ struct dmnsn_canvas_optimizer { }; /* Allocate and free a canvas */ -dmnsn_canvas *dmnsn_new_canvas(unsigned int x, unsigned int y); +dmnsn_canvas *dmnsn_new_canvas(size_t x, size_t y); void dmnsn_delete_canvas(dmnsn_canvas *canvas); /* Set a canvas optimizer */ @@ -68,12 +70,12 @@ void dmnsn_optimize_canvas(dmnsn_canvas *canvas, /* Pixel accessors */ DMNSN_INLINE dmnsn_color -dmnsn_get_pixel(const dmnsn_canvas *canvas, unsigned int x, unsigned int y) +dmnsn_get_pixel(const dmnsn_canvas *canvas, size_t x, size_t y) { return canvas->pixels[y*canvas->x + x]; } -void dmnsn_set_pixel(dmnsn_canvas *canvas, unsigned int x, unsigned int y, +void dmnsn_set_pixel(dmnsn_canvas *canvas, size_t x, size_t y, dmnsn_color color); void dmnsn_clear_canvas(dmnsn_canvas *canvas, dmnsn_color color); |