Module Name: othersrc Committed By: dholland Date: Tue Mar 5 04:32:57 UTC 2013
Modified Files: othersrc/usr.bin/dholland-make2: array.c array.h Log Message: No longer need hacks for converting Lst to array and vice versa. To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 othersrc/usr.bin/dholland-make2/array.c cvs rdiff -u -r1.5 -r1.6 othersrc/usr.bin/dholland-make2/array.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: othersrc/usr.bin/dholland-make2/array.c diff -u othersrc/usr.bin/dholland-make2/array.c:1.3 othersrc/usr.bin/dholland-make2/array.c:1.4 --- othersrc/usr.bin/dholland-make2/array.c:1.3 Mon Mar 4 08:47:08 2013 +++ othersrc/usr.bin/dholland-make2/array.c Tue Mar 5 04:32:56 2013 @@ -31,9 +31,6 @@ #include <string.h> #include "portable.h" -/* XXX this should go away */ -#include "lst.h" - #define ARRAYINLINE #include "array.h" @@ -162,36 +159,3 @@ array_removeval(struct array *a, void *v array_remove(a, ix); } } - -//////////////////////////////////////////////////////////// -// tools for interfacing with lst.lib - -static int -Lst_AddToArray(void *p, void *arrv) -{ - struct array *arr = arrv; - - array_add(arr, p, NULL); - return 0; -} - -void -Lst_IntoArray(Lst list, struct array *arr) -{ - Lst_ForEach(list, Lst_AddToArray, arr); -} - -Lst -LstFromArray(struct array *arr) -{ - Lst ret; - unsigned i; - void *p; - - ret = Lst_Init(FALSE); - for (i=0; i<array_num(arr); i++) { - p = array_get(arr, i); - Lst_AtEnd(ret, p); - } - return ret; -} Index: othersrc/usr.bin/dholland-make2/array.h diff -u othersrc/usr.bin/dholland-make2/array.h:1.5 othersrc/usr.bin/dholland-make2/array.h:1.6 --- othersrc/usr.bin/dholland-make2/array.h:1.5 Mon Mar 4 08:47:08 2013 +++ othersrc/usr.bin/dholland-make2/array.h Tue Mar 5 04:32:56 2013 @@ -290,12 +290,5 @@ array_add(struct array *a, void *val, un DECLARRAY_BYTYPE(stringarray, char, ARRAYINLINE); DEFARRAY_BYTYPE(stringarray, char, ARRAYINLINE); -//////////////////////////////////////////////////////////// -// tools for interacting with lst.lib -// (these are not typesafe and should go away) - -void Lst_IntoArray(Lst list, struct array *arr); -Lst LstFromArray(struct array *arr); - #endif /* ARRAY_H */