diff options
author | Daniel Silverstone <dsilvers@netsurf-browser.org> | 2010-04-30 16:06:03 +0000 |
---|---|---|
committer | Daniel Silverstone <dsilvers@netsurf-browser.org> | 2010-04-30 16:06:03 +0000 |
commit | 5e887908b34b804a19b2b7370b0aa358d0e55973 (patch) | |
tree | 68935c8d2fe196a64a17bace1508884d538a5e17 /css/css.c | |
parent | f0237aac922a3ee5b14233fa98baf19df97866ed (diff) | |
download | netsurf-5e887908b34b804a19b2b7370b0aa358d0e55973.tar.gz netsurf-5e887908b34b804a19b2b7370b0aa358d0e55973.tar.bz2 |
Consolidate several 'myrealloc' functions into ns_realloc, rename one which *is* different, thereby eliminating the word 'myrealloc' from the NS codebase
svn path=/trunk/netsurf/; revision=10530
Diffstat (limited to 'css/css.c')
-rw-r--r-- | css/css.c | 23 |
1 files changed, 3 insertions, 20 deletions
@@ -27,6 +27,7 @@ #include "css/internal.h" #include "desktop/gui.h" #include "render/html.h" +#include "utils/utils.h" #include "utils/http.h" #include "utils/messages.h" @@ -51,24 +52,6 @@ static nserror nscss_import(hlcache_handle *handle, const hlcache_event *event, void *pw); /** - * Allocation callback for libcss - * - * \param ptr Pointer to reallocate, or NULL for new allocation - * \param size Number of bytes requires - * \param pw Allocation context - * \return Pointer to allocated block, or NULL on failure - */ -static void *myrealloc(void *ptr, size_t size, void *pw) -{ - if (size == 0) { - free(ptr); - return NULL; - } - - return realloc(ptr, size); -} - -/** * Initialise a CSS content * * \param c Content to initialise @@ -125,7 +108,7 @@ nserror nscss_create_css_data(struct content_css_data *c, error = css_stylesheet_create(CSS_LEVEL_21, charset, url, NULL, quirks, false, - myrealloc, NULL, + ns_realloc, NULL, nscss_resolve_url, NULL, &c->sheet); if (error != CSS_OK) { @@ -448,7 +431,7 @@ css_error nscss_import_complete(struct content_css_data *c, if (blank_import == NULL) { error = css_stylesheet_create(CSS_LEVEL_DEFAULT, NULL, "", NULL, false, false, - myrealloc, NULL, + ns_realloc, NULL, nscss_resolve_url, NULL, &blank_import); if (error != CSS_OK) { |