From ca0c62265eb8cdd5fb0d8a8b34ee77baf3de987e Mon Sep 17 00:00:00 2001 From: blazy Date: Fri, 20 Oct 2006 12:37:13 +0000 Subject: Ajout du banc de tests de CCured (Olden benchmark suite, cf. CCured: type-safe retrofitting of legacy code, G.Necula et al.) rapportCompcert_all.txt liste les erreurs produites par ccomp. git-svn-id: https://yquem.inria.fr/compcert/svn/compcert/trunk@121 fca1b0fc-160b-0410-b1d3-a4f43f01ea2e --- test/ccured_olden/health/list.c | 55 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 test/ccured_olden/health/list.c (limited to 'test/ccured_olden/health/list.c') diff --git a/test/ccured_olden/health/list.c b/test/ccured_olden/health/list.c new file mode 100644 index 00000000..dcd268cc --- /dev/null +++ b/test/ccured_olden/health/list.c @@ -0,0 +1,55 @@ +/* For copyright information, see olden_v1.0/COPYRIGHT */ + +/******************************************************************** + * List.c: Handles lists. * + * To be used with health.c * + ******************************************************************* */ + +#include +#include +#include "health.h" + +#ifdef SS_PLAIN +#include "ssplain.h" +#endif SS_PLAIN + +void addList(struct List *list, struct Patient *patient) { + struct List *b; + + while (list != NULL) + { + b = list; + list = list->forward; + } + + list = (struct List *)mymalloc(sizeof(struct List)); + list->patient = patient; + list->forward = NULL; + list->back = b; + b->forward = list; +} + + +void removeList(struct List *list, struct Patient *patient) +{ + struct List *l1,*l2; + struct Patient *p; + + p = list->patient; + while(p != patient) + { + list = list->forward; + p = list->patient; + } + + l1 = list->back; + l2 = list->forward; + l1->forward = l2; + if (list->forward != NULL) + { + l1 = list->forward; + l2 = list->back; + l1->back = l2; + } +} + -- cgit