aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2007-09-25 17:32:12 +0000
committerRoy Marples <roy@marples.name>2007-09-25 17:32:12 +0000
commit6a14825e74c9abdbc024202543fd5fea0ca4a3de (patch)
tree5866d2d818fb6cb00515bcb5e39f8d6d050cc66b
parentc6c7df47a00a8a974eb026f31e94bfc07984ac13 (diff)
Use bools
-rw-r--r--src/librc-strlist.c10
-rw-r--r--src/rc.h4
2 files changed, 7 insertions, 7 deletions
diff --git a/src/librc-strlist.c b/src/librc-strlist.c
index 9645acb0..34f454dd 100644
--- a/src/librc-strlist.c
+++ b/src/librc-strlist.c
@@ -110,26 +110,26 @@ char *rc_strlist_addsortu (char ***list, const char *item)
}
librc_hidden_def(rc_strlist_addsortu)
-int rc_strlist_delete (char ***list, const char *item)
+bool rc_strlist_delete (char ***list, const char *item)
{
char **lst = *list;
int i = 0;
- int retval = -1;
+ bool retval = false;
if (!lst || ! item)
- return (-1);
+ return (false);
while (lst[i])
if (! strcmp (lst[i], item)) {
free (lst[i]);
- retval = 0;
+ retval = true;
do {
lst[i] = lst[i + 1];
i++;
} while (lst[i]);
}
- if (retval)
+ if (! retval)
errno = ENOENT;
return (retval);
}
diff --git a/src/rc.h b/src/rc.h
index a4d88d77..324d13fa 100644
--- a/src/rc.h
+++ b/src/rc.h
@@ -457,8 +457,8 @@ char *rc_strlist_addsortu (char ***list, const char *item);
/*! Free the item and remove it from the list. Return 0 on success otherwise -1.
* @param list to add the item too
* @param item to add.
- * @return 0 on success, otherwise -1 */
-int rc_strlist_delete (char ***list, const char *item);
+ * @return true on success, otherwise false */
+bool rc_strlist_delete (char ***list, const char *item);
/*! Moves the contents of list2 onto list1, so list2 is effectively emptied.
* Returns a pointer to the last item on the new list.
* @param list1 to append to