summaryrefslogtreecommitdiffstats
path: root/usr.bin
diff options
context:
space:
mode:
authorharti <harti@FreeBSD.org>2004-12-09 15:31:32 +0000
committerharti <harti@FreeBSD.org>2004-12-09 15:31:32 +0000
commit972d6db1ca14d90fc3676b343115398d30ba5e17 (patch)
tree1e5bac48533726b3eea91d5474e238c375a2ceb4 /usr.bin
parenta007e1cba7c483d7a14d89c866c6ce59f624c3ef (diff)
downloadFreeBSD-src-972d6db1ca14d90fc3676b343115398d30ba5e17.zip
FreeBSD-src-972d6db1ca14d90fc3676b343115398d30ba5e17.tar.gz
Nobody actually checked the return codes from Lst_Append and Lst_Insert
so don't return anything.
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/make/lst.h4
-rw-r--r--usr.bin/make/lst.lib/lstAppend.c16
-rw-r--r--usr.bin/make/lst.lib/lstDupl.c12
-rw-r--r--usr.bin/make/lst.lib/lstInsert.c20
4 files changed, 9 insertions, 43 deletions
diff --git a/usr.bin/make/lst.h b/usr.bin/make/lst.h
index e9c8f1c..f78d523 100644
--- a/usr.bin/make/lst.h
+++ b/usr.bin/make/lst.h
@@ -112,9 +112,9 @@ void Lst_Destroy(Lst *, FreeProc *);
* Functions to modify a list
*/
/* Insert an element before another */
-ReturnStatus Lst_Insert(Lst *, LstNode *, void *);
+void Lst_Insert(Lst *, LstNode *, void *);
/* Insert an element after another */
-ReturnStatus Lst_Append(Lst *, LstNode *, void *);
+void Lst_Append(Lst *, LstNode *, void *);
/* Place an element at the front of a lst. */
#define Lst_AtFront(LST, D) (Lst_Insert((LST), Lst_First(LST), (D)))
/* Place an element at the end of a lst. */
diff --git a/usr.bin/make/lst.lib/lstAppend.c b/usr.bin/make/lst.lib/lstAppend.c
index b5c201d..297926c 100644
--- a/usr.bin/make/lst.lib/lstAppend.c
+++ b/usr.bin/make/lst.lib/lstAppend.c
@@ -54,9 +54,6 @@ __FBSDID("$FreeBSD$");
* Lst_Append --
* Create a new node and add it to the given list after the given node.
*
- * Results:
- * SUCCESS if all went well.
- *
* Arguments:
* l affected list
* ln node after which to append the datum
@@ -70,20 +67,11 @@ __FBSDID("$FreeBSD$");
*
*-----------------------------------------------------------------------
*/
-ReturnStatus
+void
Lst_Append(Lst *list, LstNode *ln, void *d)
{
LstNode *nLNode;
- if (Lst_Valid(list) && (ln == NULL && Lst_IsEmpty(list))) {
- goto ok;
- }
-
- if (!Lst_Valid(list) || Lst_IsEmpty(list) || ! Lst_NodeValid(ln, list)) {
- return (FAILURE);
- }
- ok:
-
nLNode = emalloc(sizeof(*nLNode));
nLNode->datum = d;
nLNode->useCount = nLNode->flags = 0;
@@ -104,6 +92,4 @@ Lst_Append(Lst *list, LstNode *ln, void *d)
list->lastPtr = nLNode;
}
}
-
- return (SUCCESS);
}
diff --git a/usr.bin/make/lst.lib/lstDupl.c b/usr.bin/make/lst.lib/lstDupl.c
index 364c526..2596816 100644
--- a/usr.bin/make/lst.lib/lstDupl.c
+++ b/usr.bin/make/lst.lib/lstDupl.c
@@ -84,14 +84,10 @@ Lst_Duplicate(Lst *list, DuplicateProc *copyProc)
ln = list->firstPtr;
while (ln != NULL) {
- if (copyProc != NOCOPY) {
- if (Lst_AtEnd(nl, (*copyProc)(ln->datum)) == FAILURE) {
- return (NULL);
- }
- } else if (Lst_AtEnd (nl, ln->datum) == FAILURE) {
- return (NULL);
- }
-
+ if (copyProc != NOCOPY)
+ Lst_AtEnd(nl, (*copyProc)(ln->datum));
+ else
+ Lst_AtEnd(nl, ln->datum);
ln = ln->nextPtr;
}
diff --git a/usr.bin/make/lst.lib/lstInsert.c b/usr.bin/make/lst.lib/lstInsert.c
index 61010ca..5bb7a0d 100644
--- a/usr.bin/make/lst.lib/lstInsert.c
+++ b/usr.bin/make/lst.lib/lstInsert.c
@@ -55,9 +55,7 @@ __FBSDID("$FreeBSD$");
* Insert a new node with the given piece of data before the given
* node in the given list.
*
- * Results:
- * SUCCESS or FAILURE.
- *
+ * Parameters:
* l list to manipulate
* ln node before which to insert d
* d datum to be inserted
@@ -68,24 +66,12 @@ __FBSDID("$FreeBSD$");
*
*-----------------------------------------------------------------------
*/
-ReturnStatus
+void
Lst_Insert(Lst *list, LstNode *ln, void *d)
{
LstNode *nLNode; /* new lnode for d */
- /*
- * check validity of arguments
- */
- if (Lst_Valid(list) && (Lst_IsEmpty(list) && ln == NULL))
- goto ok;
-
- if (!Lst_Valid(list) || Lst_IsEmpty(list) || !Lst_NodeValid(ln, list)) {
- return (FAILURE);
- }
-
- ok:
nLNode = emalloc(sizeof(*nLNode));
-
nLNode->datum = d;
nLNode->useCount = nLNode->flags = 0;
@@ -105,6 +91,4 @@ Lst_Insert(Lst *list, LstNode *ln, void *d)
list->firstPtr = nLNode;
}
}
-
- return (SUCCESS);
}
OpenPOWER on IntegriCloud