diff options
author | Sergey Poznyakoff <gray@gnu.org> | 2021-01-09 11:58:49 +0200 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org> | 2021-01-09 12:37:40 +0200 |
commit | 0c38baeca4d8caeb2b16faaf42acd61f4e72bde7 (patch) | |
tree | 312bf472c59acb4cfc7540530db244dd7a07ec7c | |
parent | c42044e7eda48707809c4176a9bb5f6e479fdc92 (diff) | |
download | gdbm-0c38baeca4d8caeb2b16faaf42acd61f4e72bde7.tar.gz gdbm-0c38baeca4d8caeb2b16faaf42acd61f4e72bde7.tar.bz2 |
Minor changes
* src/hash.c (_gdbm_hash): Suppress address sanitizer errors.
* src/proto.h (gdbm_file_sync): Add missing return.
* src/lex.l (input_context_pop): Delete current buffer when tos
is reached.
-rw-r--r-- | src/hash.c | 6 | ||||
-rw-r--r-- | src/lex.l | 4 | ||||
-rw-r--r-- | src/proto.h | 1 |
3 files changed, 6 insertions, 5 deletions
@@ -33,11 +33,11 @@ _gdbm_hash (datum key) int index; /* Used to cycle through random values. */ /* Set the initial value from key. */ - value = 0x238F13AF * key.dsize; + value = 0x238F13AFu * key.dsize; for (index = 0; index < key.dsize; index++) - value = (value + (key.dptr[index] << (index*5 % 24))) & 0x7FFFFFFF; + value = (value + (key.dptr[index] << ((unsigned) index * 5 % 24))) & 0x7FFFFFFF; - value = (1103515243 * value + 12345) & 0x7FFFFFFF; + value = (1103515243u * value + 12345) & 0x7FFFFFFF; /* Return the value. */ return((int) value); @@ -136,11 +136,11 @@ input_context_pop (void) cp = context_tos->parent; free (context_tos); context_tos = cp; + yy_delete_buffer (YY_CURRENT_BUFFER); if (!cp) return 1; - + yylloc = cp->locus; - yy_delete_buffer (YY_CURRENT_BUFFER); yy_switch_to_buffer (cp->buf); return 0; diff --git a/src/proto.h b/src/proto.h index ab34d75..2171250 100644 --- a/src/proto.h +++ b/src/proto.h @@ -127,6 +127,7 @@ gdbm_file_sync (GDBM_FILE dbf) GDBM_SET_ERRNO (dbf, GDBM_FILE_SYNC_ERROR, TRUE); return 1; } + return 0; #else sync (); sync (); |