X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;ds=sidebyside;f=src%2Flibpspp%2Fhmapx.c;h=ca5900c2829c85e10b2647d552141c0a1b69e809;hb=8d1e072157ee3c8273e328c491be3c8bf57452da;hp=25dabf6eda54184085509a9be4f807eb2714a87e;hpb=38980bbfac573dcefe25021e0d9ff8a6894372ca;p=pspp diff --git a/src/libpspp/hmapx.c b/src/libpspp/hmapx.c index 25dabf6eda..ca5900c282 100644 --- a/src/libpspp/hmapx.c +++ b/src/libpspp/hmapx.c @@ -1,5 +1,5 @@ /* PSPP - a program for statistical analysis. - Copyright (C) 2008, 2009, 2010 Free Software Foundation, Inc. + Copyright (C) 2008, 2009, 2010, 2012 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -51,10 +51,12 @@ void hmapx_clear (struct hmapx *map) { struct hmapx_node *node, *next; - void *data; - HMAPX_FOR_EACH_SAFE (data, node, next, map) - hmapx_delete (map, node); + for (node = hmapx_first (map); node; node = next) + { + next = hmapx_next (map, node); + hmapx_delete (map, node); + } } /* Allocates and returns a new hmapx_node with DATA as its data