aboutsummaryrefslogtreecommitdiff
path: root/src/gdbmdelete.c
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2016-07-08 15:25:25 +0300
committerSergey Poznyakoff <gray@gnu.org.ua>2016-07-08 15:35:13 +0300
commit27b5d96eec6d43eed834c9f1492b1f3d38bf60ec (patch)
treeac20224e957ad7688ec31d03e6080c09ab9fc4c9 /src/gdbmdelete.c
parent4aef6b36f862e46723403bc6422ac47058a5ef19 (diff)
downloadgdbm-27b5d96eec6d43eed834c9f1492b1f3d38bf60ec.tar.gz
gdbm-27b5d96eec6d43eed834c9f1492b1f3d38bf60ec.tar.bz2
Improve _gdbm_findkey interface.
* doc/gdbm.texi: Document gdbm_exists in detail. * src/findkey.c (_gdbm_findkey): return parameters can be NULL. * src/gdbmexists.c (gdbm_exists): Remove unnecessary local variables. Reset gdbm_errno to 0 if the key was not found. * src/gdbmdelete.c (gdbm_delete): Remove unnecessary local variables. * src/gdbmfetch.c: Likewise. * src/gdbmseq.c: Likewise. * src/gdbmstore.c: Likewise.
Diffstat (limited to 'src/gdbmdelete.c')
-rw-r--r--src/gdbmdelete.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/gdbmdelete.c b/src/gdbmdelete.c
index b308c51..4396b14 100644
--- a/src/gdbmdelete.c
+++ b/src/gdbmdelete.c
@@ -33,9 +33,7 @@ gdbm_delete (GDBM_FILE dbf, datum key)
int last_loc; /* Last location emptied by the delete. */
int home; /* Home position of an item. */
bucket_element elem; /* The element to be deleted. */
- char *find_data; /* Return pointer from findkey. */
- int hash_val; /* Returned by findkey. */
- off_t free_adr; /* Temporary stroage for address and size. */
+ off_t free_adr; /* Temporary storage for address and size. */
int free_size;
/* First check to make sure this guy is a writer. */
@@ -49,7 +47,7 @@ gdbm_delete (GDBM_FILE dbf, datum key)
gdbm_errno = GDBM_NO_ERROR;
/* Find the item. */
- elem_loc = _gdbm_findkey (dbf, key, &find_data, &hash_val);
+ elem_loc = _gdbm_findkey (dbf, key, NULL, NULL);
if (elem_loc == -1)
return -1;

Return to:

Send suggestions and report system problems to the System administrator.