summaryrefslogtreecommitdiff
path: root/desktop
diff options
context:
space:
mode:
authorMichael Drake <tlsa@netsurf-browser.org>2014-02-19 14:08:52 +0000
committerMichael Drake <tlsa@netsurf-browser.org>2014-02-19 14:08:52 +0000
commit32a522241f94970df9681517edc999d7b6d6675a (patch)
tree815f6509c19f408a7ded0bf99c83754a93262ebf /desktop
parent71cb70065e6819c26f101ff11e34c10383487b30 (diff)
downloadnetsurf-32a522241f94970df9681517edc999d7b6d6675a.tar.gz
netsurf-32a522241f94970df9681517edc999d7b6d6675a.tar.bz2
Rename function arguments to avoid using 'new'.
Diffstat (limited to 'desktop')
-rw-r--r--desktop/browser_history.c25
-rw-r--r--desktop/browser_history.h4
2 files changed, 16 insertions, 13 deletions
diff --git a/desktop/browser_history.c b/desktop/browser_history.c
index ca551f75d..8c21eed8e 100644
--- a/desktop/browser_history.c
+++ b/desktop/browser_history.c
@@ -443,36 +443,39 @@ nserror browser_window_history_create(struct browser_window *bw)
/**
* Clone a bw's history tree for new bw
*
- * \param bw browser window with history to clone.
- * \param new browser window to make cloned history for.
+ * \param existing browser window with history to clone.
+ * \param clone browser window to make cloned history for.
*
* \return NSERROR_OK or appropriate error otherwise
*/
-nserror browser_window_history_clone(const struct browser_window *bw,
- struct browser_window *new)
+nserror browser_window_history_clone(const struct browser_window *existing,
+ struct browser_window *clone)
{
struct history *new_history;
- new->history = NULL;
+ clone->history = NULL;
- if (bw == NULL || bw->history == NULL || bw->history->start == NULL)
- return browser_window_history_create(new);
+ if (existing == NULL || existing->history == NULL ||
+ existing->history->start == NULL)
+ /* Nothing to clone, create new history for clone window */
+ return browser_window_history_create(clone);
+ /* Make cloned history */
new_history = malloc(sizeof *new_history);
if (!new_history)
return NSERROR_NOMEM;
- new->history = new_history;
- memcpy(new_history, bw->history, sizeof *new_history);
+ clone->history = new_history;
+ memcpy(new_history, existing->history, sizeof *new_history);
new_history->start = browser_window_history__clone_entry(new_history,
new_history->start);
if (!new_history->start) {
LOG(("Insufficient memory to clone history"));
warn_user("NoMemory", 0);
- browser_window_history_destroy(new);
- new->history = NULL;
+ browser_window_history_destroy(clone);
+ clone->history = NULL;
return NSERROR_NOMEM;
}
diff --git a/desktop/browser_history.h b/desktop/browser_history.h
index 11b58e4dd..f3e524baf 100644
--- a/desktop/browser_history.h
+++ b/desktop/browser_history.h
@@ -34,8 +34,8 @@ struct history_entry;
struct redraw_context;
nserror browser_window_history_create(struct browser_window *bw);
-nserror browser_window_history_clone(const struct browser_window *bw,
- struct browser_window *new);
+nserror browser_window_history_clone(const struct browser_window *existing,
+ struct browser_window *clone);
void browser_window_history_add(struct browser_window *bw,
struct hlcache_handle *content, lwc_string *frag_id);
void browser_window_history_update(struct browser_window *bw,