From 35bc2ccbb89a6b499e0e3b6f7095afea214f0c59 Mon Sep 17 00:00:00 2001 From: Vincent Sanders Date: Sun, 5 May 2019 22:46:40 +0100 Subject: change content get_source_data interfaces to return uint8_t and size_t previously these interfaces returned char * and unsigned int which was undesirable. --- content/handlers/css/css.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'content/handlers/css') diff --git a/content/handlers/css/css.c b/content/handlers/css/css.c index dda044d15..0dcbe9907 100644 --- a/content/handlers/css/css.c +++ b/content/handlers/css/css.c @@ -80,8 +80,6 @@ typedef struct { * imports array */ } nscss_import_ctx; -static bool nscss_process_data(struct content *c, const char *data, - unsigned int size); static bool nscss_convert(struct content *c); static void nscss_destroy(struct content *c); static nserror nscss_clone(const struct content *old, struct content **newc); @@ -245,7 +243,8 @@ static nserror nscss_create_css_data(struct content_css_data *c, * \param size Number of bytes to process * \return true on success, false on failure */ -bool nscss_process_data(struct content *c, const char *data, unsigned int size) +static bool +nscss_process_data(struct content *c, const char *data, unsigned int size) { nscss_content *css = (nscss_content *) c; css_error error; @@ -374,8 +373,8 @@ nserror nscss_clone(const struct content *old, struct content **newc) { const nscss_content *old_css = (const nscss_content *) old; nscss_content *new_css; - const char *data; - unsigned long size; + const uint8_t *data; + size_t size; nserror error; new_css = calloc(1, sizeof(nscss_content)); @@ -402,7 +401,9 @@ nserror nscss_clone(const struct content *old, struct content **newc) data = content__get_source_data(&new_css->base, &size); if (size > 0) { - if (nscss_process_data(&new_css->base, data, size) == false) { + if (nscss_process_data(&new_css->base, + (char *)data, + (unsigned int)size) == false) { content_destroy(&new_css->base); return NSERROR_CLONE_FAILED; } -- cgit v1.2.3