From c5da456687d8b51d8d2360cabc1966387ebc72b9 Mon Sep 17 00:00:00 2001 From: Patrick McDermott Date: Thu, 18 Jul 2019 02:43:45 -0400 Subject: font_*(), text_*(), image_*(): Add const qualifiers --- diff --git a/src/font.c b/src/font.c index c351857..fb54604 100644 --- a/src/font.c +++ b/src/font.c @@ -65,19 +65,19 @@ font_find(const char *name) } int -font_get_width(struct font *font) +font_get_width(const struct font *font) { return font->desc.width; } int -font_get_height(struct font *font) +font_get_height(const struct font *font) { return font->desc.height; } void -font_render(struct font *font, png_const_colorp fg, png_const_colorp bg, +font_render(const struct font *font, png_const_colorp fg, png_const_colorp bg, unsigned char ch, png_bytepp rows, int row, int col) { size_t y; diff --git a/src/font.h b/src/font.h index f82f2a0..27cc08e 100644 --- a/src/font.h +++ b/src/font.h @@ -30,13 +30,13 @@ struct font * font_find(const char *name) __attribute__((pure)); int -font_get_width(struct font *font) __attribute__((pure)); +font_get_width(const struct font *font) __attribute__((pure)); int -font_get_height(struct font *font) __attribute__((pure)); +font_get_height(const struct font *font) __attribute__((pure)); void -font_render(struct font *font, png_const_colorp fg, png_const_colorp bg, +font_render(const struct font *font, png_const_colorp fg, png_const_colorp bg, unsigned char ch, png_bytepp rows, int row, int col); #endif /* FONT_H_ */ diff --git a/src/image.c b/src/image.c index 3c5d98f..e55f955 100644 --- a/src/image.c +++ b/src/image.c @@ -76,7 +76,8 @@ image_new(const char *file_name) } void -image_render(struct image *image, struct text *text, struct font *font) +image_render(struct image *image, const struct text *text, + const struct font *font) { size_t width; size_t height; diff --git a/src/image.h b/src/image.h index b303c23..ece53f7 100644 --- a/src/image.h +++ b/src/image.h @@ -38,7 +38,8 @@ struct image * image_new(const char *file_name); void -image_render(struct image *image, struct text *text, struct font *font); +image_render(struct image *image, const struct text *text, + const struct font *font); struct image * image_destroy(struct image **image); diff --git a/src/text.c b/src/text.c index fedbd3f..995d10e 100644 --- a/src/text.c +++ b/src/text.c @@ -105,13 +105,13 @@ text_new(FILE *stream) } size_t -text_get_width(struct text *text) +text_get_width(const struct text *text) { return text->width; } size_t -text_get_height(struct text *text) +text_get_height(const struct text *text) { return text->height; } @@ -129,7 +129,7 @@ text_set_height(struct text *text, size_t height) } void -text_render(struct text *text, struct font *font, png_bytepp rows) +text_render(const struct text *text, const struct font *font, png_bytepp rows) { unsigned char *string_start; unsigned char *string; diff --git a/src/text.h b/src/text.h index 8ee0245..a76e14e 100644 --- a/src/text.h +++ b/src/text.h @@ -34,10 +34,10 @@ struct text * text_new(FILE *stream); size_t -text_get_width(struct text *text) __attribute__((pure)); +text_get_width(const struct text *text) __attribute__((pure)); size_t -text_get_height(struct text *text) __attribute__((pure)); +text_get_height(const struct text *text) __attribute__((pure)); size_t text_set_width(struct text *text, size_t width); @@ -46,7 +46,7 @@ size_t text_set_height(struct text *text, size_t height); void -text_render(struct text *text, struct font *font, png_bytepp rows); +text_render(const struct text *text, const struct font *font, png_bytepp rows); struct text * text_destroy(struct text **text_p); -- cgit v0.9.1