summaryrefslogtreecommitdiff
path: root/render
diff options
context:
space:
mode:
authorDaniel Silverstone <dsilvers@netsurf-browser.org>2010-04-30 16:06:03 +0000
committerDaniel Silverstone <dsilvers@netsurf-browser.org>2010-04-30 16:06:03 +0000
commit5e887908b34b804a19b2b7370b0aa358d0e55973 (patch)
tree68935c8d2fe196a64a17bace1508884d538a5e17 /render
parentf0237aac922a3ee5b14233fa98baf19df97866ed (diff)
downloadnetsurf-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 'render')
-rw-r--r--render/html.c20
-rw-r--r--render/hubbub_binding.c6
2 files changed, 4 insertions, 22 deletions
diff --git a/render/html.c b/render/html.c
index caada3c96..c818d6e36 100644
--- a/render/html.c
+++ b/render/html.c
@@ -97,24 +97,6 @@ static const char empty_document[] =
"</html>";
/**
- * Allocator
- *
- * \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 len, void *pw)
-{
- if (len == 0) {
- free(ptr);
- return NULL;
- }
-
- return realloc(ptr, len);
-}
-
-/**
* Create a CONTENT_HTML.
*
* The content_html_data structure is initialized and the HTML parser is
@@ -484,7 +466,7 @@ void html_finish_conversion(struct content *c)
}
/* Create selection context */
- error = css_select_ctx_create(myrealloc, c, &c->data.html.select_ctx);
+ error = css_select_ctx_create(ns_realloc, c, &c->data.html.select_ctx);
if (error != CSS_OK) {
msg_data.error = messages_get("NoMemory");
content_broadcast(c, CONTENT_MSG_ERROR, msg_data);
diff --git a/render/hubbub_binding.c b/render/hubbub_binding.c
index bc509b4eb..f050862a0 100644
--- a/render/hubbub_binding.c
+++ b/render/hubbub_binding.c
@@ -126,7 +126,7 @@ static hubbub_tree_handler tree_handler = {
NULL
};
-static void *myrealloc(void *ptr, size_t len, void *pw)
+static void *ns_talloc_based_realloc(void *ptr, size_t len, void *pw)
{
/* talloc_realloc_size(pw, ptr, 0) == talloc_free(ptr) */
return talloc_realloc_size(pw, ptr, len);
@@ -152,8 +152,8 @@ binding_error binding_create_tree(void *arena, const char *charset, void **ctx)
c->quirks = BINDING_QUIRKS_MODE_NONE;
c->forms = NULL;
- error = hubbub_parser_create(charset, true, myrealloc, arena,
- &c->parser);
+ error = hubbub_parser_create(charset, true, ns_talloc_based_realloc,
+ arena, &c->parser);
if (error != HUBBUB_OK) {
free(c);
if (error == HUBBUB_BADENCODING)