From 5e887908b34b804a19b2b7370b0aa358d0e55973 Mon Sep 17 00:00:00 2001 From: Daniel Silverstone Date: Fri, 30 Apr 2010 16:06:03 +0000 Subject: 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 --- css/css.c | 23 +++-------------------- 1 file changed, 3 insertions(+), 20 deletions(-) (limited to 'css') diff --git a/css/css.c b/css/css.c index 7fb17519b..69e0d4e33 100644 --- a/css/css.c +++ b/css/css.c @@ -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" @@ -50,24 +51,6 @@ static css_error nscss_import_complete(struct content_css_data *c, 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 * @@ -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) { -- cgit v1.2.3