summaryrefslogtreecommitdiffabout
path: root/src/gdbmstore.c
authorSergey Poznyakoff <gray@gnu.org.ua>2013-12-25 09:31:59 (GMT)
committer Sergey Poznyakoff <gray@gnu.org.ua>2013-12-25 09:31:59 (GMT)
commit46e182da4c8a338db22199e003fc2149ee3b1b81 (patch) (side-by-side diff)
treea7b382936a61ced77d284a6092d450c73e124e73 /src/gdbmstore.c
parent05fa76dfce5311161abbc64c12acbaf56f298e97 (diff)
downloadgdbm-46e182da4c8a338db22199e003fc2149ee3b1b81.tar.gz
gdbm-46e182da4c8a338db22199e003fc2149ee3b1b81.tar.bz2
Minor changes.
* src/gdbm_load.c: New options: --mmap, --cache-size and --block-size. * doc/gdbm.texinfo: Document new gdbm_load options. * doc/gdbm_load.1: Likewise. * src/gdbmdelete.c: Stylistic changes. * src/gdbmstore.c: Likewise.
Diffstat (limited to 'src/gdbmstore.c') (more/less context) (ignore whitespace changes)
-rw-r--r--src/gdbmstore.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/gdbmstore.c b/src/gdbmstore.c
index aedf375..15a2255 100644
--- a/src/gdbmstore.c
+++ b/src/gdbmstore.c
@@ -104,9 +104,7 @@ gdbm_store (GDBM_FILE dbf, datum key, datum content, int flags)
/* Get the file address for the new space.
(Current bucket's free space is first place to look.) */
if (file_adr == 0)
- {
- file_adr = _gdbm_alloc (dbf, new_size);
- }
+ file_adr = _gdbm_alloc (dbf, new_size);
/* If this is a new entry in the bucket, we need to do special things. */
if (elem_loc == -1)
@@ -120,10 +118,10 @@ gdbm_store (GDBM_FILE dbf, datum key, datum content, int flags)
/* Find space to insert into bucket and set elem_loc to that place. */
elem_loc = new_hash_val % dbf->header->bucket_elems;
while (dbf->bucket->h_table[elem_loc].hash_value != -1)
- { elem_loc = (elem_loc + 1) % dbf->header->bucket_elems; }
+ elem_loc = (elem_loc + 1) % dbf->header->bucket_elems;
/* We now have another element in the bucket. Add the new information.*/
- dbf->bucket->count += 1;
+ dbf->bucket->count++;
dbf->bucket->h_table[elem_loc].hash_value = new_hash_val;
memcpy (dbf->bucket->h_table[elem_loc].key_start, key.dptr,
(SMALL < key.dsize ? SMALL : key.dsize));
@@ -137,7 +135,8 @@ gdbm_store (GDBM_FILE dbf, datum key, datum content, int flags)
/* Write the data to the file. */
file_pos = __lseek (dbf, file_adr, SEEK_SET);
- if (file_pos != file_adr) _gdbm_fatal (dbf, _("lseek error"));
+ if (file_pos != file_adr)
+ _gdbm_fatal (dbf, _("lseek error"));
rc = _gdbm_full_write (dbf, key.dptr, key.dsize);
if (rc)
_gdbm_fatal (dbf, gdbm_strerror (rc));

Return to:

Send suggestions and report system problems to the System administrator.