From 1e35288fee100dd3ba5cac0a128cd2b6858381c1 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Fri, 20 May 2016 20:51:57 -0400 Subject: TITANIC: Change TTnode addNode to addToTail --- engines/titanic/true_talk/tt_node.cpp | 2 +- engines/titanic/true_talk/tt_node.h | 9 ++++----- engines/titanic/true_talk/tt_sentence.cpp | 4 ++-- engines/titanic/true_talk/tt_word.cpp | 4 ++-- 4 files changed, 9 insertions(+), 10 deletions(-) (limited to 'engines/titanic/true_talk') diff --git a/engines/titanic/true_talk/tt_node.cpp b/engines/titanic/true_talk/tt_node.cpp index c72dfd3e51..cbbb1dd756 100644 --- a/engines/titanic/true_talk/tt_node.cpp +++ b/engines/titanic/true_talk/tt_node.cpp @@ -32,7 +32,7 @@ TTnode::~TTnode() { detach(); } -void TTnode::addNode(TTnode *newNode) { +void TTnode::addToTail(TTnode *newNode) { TTnode *tail = getTail(); tail->_nextP = newNode; newNode->_priorP = this; diff --git a/engines/titanic/true_talk/tt_node.h b/engines/titanic/true_talk/tt_node.h index 8faebae18f..36d44288fd 100644 --- a/engines/titanic/true_talk/tt_node.h +++ b/engines/titanic/true_talk/tt_node.h @@ -33,16 +33,15 @@ public: TTnode(); virtual ~TTnode(); - /** - * Links the passed node to this node as a linked list - */ - void addNode(TTnode *newNode); - /** * Adds a new node at the beginning of the linked list */ void addToHead(TTnode *newNode); + /** + * Links the passed node to this node as a linked list + */ + void addToTail(TTnode *newNode); /** * Detaches a node from any predecessor and/or successor diff --git a/engines/titanic/true_talk/tt_sentence.cpp b/engines/titanic/true_talk/tt_sentence.cpp index ca808884d7..67e1a977ce 100644 --- a/engines/titanic/true_talk/tt_sentence.cpp +++ b/engines/titanic/true_talk/tt_sentence.cpp @@ -89,7 +89,7 @@ void TTsentence::copyFrom(const TTsentence &src) { node = static_cast(node->_nextP)) { TTsentenceNode *newNode = new TTsentenceNode(node->_wordP); if (_nodesP) - _nodesP->addNode(newNode); + _nodesP->addToTail(newNode); else _nodesP = newNode; } @@ -102,7 +102,7 @@ int TTsentence::storeVocabHit(TTword *word) { TTsentenceNode *node = new TTsentenceNode(word); if (_nodesP) { - _nodesP->addNode(node); + _nodesP->addToTail(node); } else { _nodesP = node; } diff --git a/engines/titanic/true_talk/tt_word.cpp b/engines/titanic/true_talk/tt_word.cpp index c277b871a4..dc686b88b6 100644 --- a/engines/titanic/true_talk/tt_word.cpp +++ b/engines/titanic/true_talk/tt_word.cpp @@ -98,7 +98,7 @@ int TTword::readSyn(SimpleFile *file) { if (_synP) { // A synonym already exists, so add new one as a tail // at the end of the linked list of synonyms - _synP->addNode(synNode); + _synP->addToTail(synNode); } else { // Very first synonym, so set it _synP = synNode; @@ -128,7 +128,7 @@ int TTword::setSynStr(TTstring &str) { void TTword::appendNode(TTsynonym *node) { if (_synP) - _synP->addNode(node); + _synP->addToTail(node); else _synP = node; } -- cgit v1.2.3