diff options
author | Vincent Sanders <vince@kyllikki.org> | 2019-05-05 22:46:40 +0100 |
---|---|---|
committer | Vincent Sanders <vince@kyllikki.org> | 2019-05-05 22:50:25 +0100 |
commit | 35bc2ccbb89a6b499e0e3b6f7095afea214f0c59 (patch) | |
tree | cd494ae1e33ab55d0e644d11eb973ddde4decbb6 /frontends/riscos/theme_install.c | |
parent | f966580d22d47ab97bceb2f067fc2b9402af01b7 (diff) | |
download | netsurf-35bc2ccbb89a6b499e0e3b6f7095afea214f0c59.tar.gz netsurf-35bc2ccbb89a6b499e0e3b6f7095afea214f0c59.tar.bz2 |
change content get_source_data interfaces to return uint8_t and size_t
previously these interfaces returned char * and unsigned int which was
undesirable.
Diffstat (limited to 'frontends/riscos/theme_install.c')
-rw-r--r-- | frontends/riscos/theme_install.c | 61 |
1 files changed, 31 insertions, 30 deletions
diff --git a/frontends/riscos/theme_install.c b/frontends/riscos/theme_install.c index fbca9e4fa..a235fe471 100644 --- a/frontends/riscos/theme_install.c +++ b/frontends/riscos/theme_install.c @@ -47,8 +47,6 @@ wimp_w dialog_theme_install; static void theme_install_close(wimp_w w); static nserror theme_install_callback(struct hlcache_handle *handle, const hlcache_event *event, void *pw); -static bool theme_install_read(const char *source_data, - unsigned long source_size); /** @@ -80,6 +78,33 @@ void theme_install_start(struct hlcache_handle *c) /** + * Fill in theme_install_descriptor from received theme data. + * + * \param source_data received data + * \param source_size size of data + * \return true if data is a correct theme, false on error + * + * If the data is a correct theme, theme_install_descriptor is filled in. + */ + +static bool +theme_install_read(const uint8_t *source_data, size_t source_size) +{ + const void *data = source_data; + + if (source_size < sizeof(struct theme_file_header)) + return false; + if (!ro_gui_theme_read_file_header(&theme_install_descriptor, + (struct theme_file_header *) data)) + return false; + if (source_size - sizeof(struct theme_file_header) != + theme_install_descriptor.compressed_size) + return false; + return true; +} + + +/** * Callback for fetchcache() for theme install fetches. */ @@ -90,8 +115,8 @@ nserror theme_install_callback(struct hlcache_handle *handle, case CONTENT_MSG_DONE: { - const char *source_data; - unsigned long source_size; + const uint8_t *source_data; + size_t source_size; int author_indent = 0; char buffer[256]; @@ -135,30 +160,6 @@ nserror theme_install_callback(struct hlcache_handle *handle, } -/** - * Fill in theme_install_descriptor from received theme data. - * - * \param source_data received data - * \param source_size size of data - * \return true if data is a correct theme, false on error - * - * If the data is a correct theme, theme_install_descriptor is filled in. - */ - -bool theme_install_read(const char *source_data, unsigned long source_size) -{ - const void *data = source_data; - - if (source_size < sizeof(struct theme_file_header)) - return false; - if (!ro_gui_theme_read_file_header(&theme_install_descriptor, - (struct theme_file_header *) data)) - return false; - if (source_size - sizeof(struct theme_file_header) != - theme_install_descriptor.compressed_size) - return false; - return true; -} /** @@ -174,8 +175,8 @@ bool ro_gui_theme_install_apply(wimp_w w) struct theme_descriptor *theme_install; os_error *error; char *fix; - const char *source_data; - unsigned long source_size; + const uint8_t *source_data; + size_t source_size; assert(theme_install_content); |