diff options
author | Patrick McDermott <patrick.mcdermott@libiquity.com> | 2019-07-18 02:43:45 (EDT) |
---|---|---|
committer | Patrick McDermott <patrick.mcdermott@libiquity.com> | 2019-07-18 02:43:45 (EDT) |
commit | c5da456687d8b51d8d2360cabc1966387ebc72b9 (patch) | |
tree | 23f97459ec1fcb4f4620e6985fa632e353e03a6f | |
parent | f0351693ac1558505cf15c61c3ea4a1f12c3d67b (diff) |
font_*(), text_*(), image_*(): Add const qualifiers
-rw-r--r-- | src/font.c | 6 | ||||
-rw-r--r-- | src/font.h | 6 | ||||
-rw-r--r-- | src/image.c | 3 | ||||
-rw-r--r-- | src/image.h | 3 | ||||
-rw-r--r-- | src/text.c | 6 | ||||
-rw-r--r-- | src/text.h | 6 |
6 files changed, 16 insertions, 14 deletions
@@ -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; @@ -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); @@ -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; @@ -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); |