projects
/
pspp
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Makefiles: Make a couple of targets build more quietly.
[pspp]
/
src
/
libpspp
/
hmapx.c
diff --git
a/src/libpspp/hmapx.c
b/src/libpspp/hmapx.c
index 25dabf6eda54184085509a9be4f807eb2714a87e..aab7629d74c1df188fc9f4fd2db0c265762a4ffd 100644
(file)
--- a/
src/libpspp/hmapx.c
+++ b/
src/libpspp/hmapx.c
@@
-1,5
+1,5
@@
/* PSPP - a program for statistical analysis.
/* 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
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
@@
-28,9
+28,9
@@
items should be freed, then it should be done by iterating
through MAP's contents before destroying MAP. */
void
items should be freed, then it should be done by iterating
through MAP's contents before destroying MAP. */
void
-hmapx_destroy (struct hmapx *map)
+hmapx_destroy (struct hmapx *map)
{
{
- if (map != NULL)
+ if (map != NULL)
{
if (!(hmapx_is_empty (map)))
{
{
if (!(hmapx_is_empty (map)))
{
@@
-38,7
+38,7
@@
hmapx_destroy (struct hmapx *map)
for (node = hmapx_first (map); node != NULL; node = next)
{
next = hmapx_next (map, node);
for (node = hmapx_first (map); node != NULL; node = next)
{
next = hmapx_next (map, node);
- free (node);
+ free (node);
}
}
hmap_destroy (&map->hmap);
}
}
hmap_destroy (&map->hmap);
@@
-51,16
+51,18
@@
void
hmapx_clear (struct hmapx *map)
{
struct hmapx_node *node, *next;
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
item. */
static struct hmapx_node *
}
/* Allocates and returns a new hmapx_node with DATA as its data
item. */
static struct hmapx_node *
-make_hmapx_node (void *data)
+make_hmapx_node (void *data)
{
struct hmapx_node *node = xmalloc (sizeof *node);
node->data = data;
{
struct hmapx_node *node = xmalloc (sizeof *node);
node->data = data;
@@
-82,7
+84,7
@@
make_hmapx_node (void *data)
then the client must check for duplicates itself before
inserting the new item. */
struct hmapx_node *
then the client must check for duplicates itself before
inserting the new item. */
struct hmapx_node *
-hmapx_insert (struct hmapx *map, void *data, size_t hash)
+hmapx_insert (struct hmapx *map, void *data, size_t hash)
{
struct hmapx_node *node = make_hmapx_node (data);
hmap_insert (&map->hmap, &node->hmap_node, hash);
{
struct hmapx_node *node = make_hmapx_node (data);
hmap_insert (&map->hmap, &node->hmap_node, hash);
@@
-103,7
+105,7
@@
hmapx_insert (struct hmapx *map, void *data, size_t hash)
then the client must check for duplicates itself before
inserting the new node. */
struct hmapx_node *
then the client must check for duplicates itself before
inserting the new node. */
struct hmapx_node *
-hmapx_insert_fast (struct hmapx *map, void *data, size_t hash)
+hmapx_insert_fast (struct hmapx *map, void *data, size_t hash)
{
struct hmapx_node *node = make_hmapx_node (data);
hmap_insert_fast (&map->hmap, &node->hmap_node, hash);
{
struct hmapx_node *node = make_hmapx_node (data);
hmap_insert_fast (&map->hmap, &node->hmap_node, hash);