aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/hash.c6
-rw-r--r--src/lex.l4
-rw-r--r--src/proto.h1
3 files changed, 6 insertions, 5 deletions
diff --git a/src/hash.c b/src/hash.c
index 21d15dc..52fbc82 100644
--- a/src/hash.c
+++ b/src/hash.c
@@ -30,17 +30,17 @@ int
30_gdbm_hash (datum key) 30_gdbm_hash (datum key)
31{ 31{
32 unsigned int value; /* Used to compute the hash value. */ 32 unsigned int value; /* Used to compute the hash value. */
33 int index; /* Used to cycle through random values. */ 33 int index; /* Used to cycle through random values. */
34 34
35 /* Set the initial value from key. */ 35 /* Set the initial value from key. */
36 value = 0x238F13AF * key.dsize; 36 value = 0x238F13AFu * key.dsize;
37 for (index = 0; index < key.dsize; index++) 37 for (index = 0; index < key.dsize; index++)
38 value = (value + (key.dptr[index] << (index*5 % 24))) & 0x7FFFFFFF; 38 value = (value + (key.dptr[index] << ((unsigned) index * 5 % 24))) & 0x7FFFFFFF;
39 39
40 value = (1103515243 * value + 12345) & 0x7FFFFFFF; 40 value = (1103515243u * value + 12345) & 0x7FFFFFFF;
41 41
42 /* Return the value. */ 42 /* Return the value. */
43 return((int) value); 43 return((int) value);
44} 44}
45 45
46int 46int
diff --git a/src/lex.l b/src/lex.l
index 7840794..7faf046 100644
--- a/src/lex.l
+++ b/src/lex.l
@@ -133,17 +133,17 @@ input_context_pop (void)
133 instream_close (context_tos->input); 133 instream_close (context_tos->input);
134 free (context_tos->point.file); 134 free (context_tos->point.file);
135 memset (&yylloc, 0, sizeof (yylloc)); 135 memset (&yylloc, 0, sizeof (yylloc));
136 cp = context_tos->parent; 136 cp = context_tos->parent;
137 free (context_tos); 137 free (context_tos);
138 context_tos = cp; 138 context_tos = cp;
139 yy_delete_buffer (YY_CURRENT_BUFFER);
139 if (!cp) 140 if (!cp)
140 return 1; 141 return 1;
141 142
142 yylloc = cp->locus; 143 yylloc = cp->locus;
143 yy_delete_buffer (YY_CURRENT_BUFFER);
144 yy_switch_to_buffer (cp->buf); 144 yy_switch_to_buffer (cp->buf);
145 145
146 return 0; 146 return 0;
147} 147}
148 148
149static int 149static int
diff --git a/src/proto.h b/src/proto.h
index ab34d75..2171250 100644
--- a/src/proto.h
+++ b/src/proto.h
@@ -124,12 +124,13 @@ gdbm_file_sync (GDBM_FILE dbf)
124#elif HAVE_FSYNC 124#elif HAVE_FSYNC
125 if (fsync (dbf->desc)) 125 if (fsync (dbf->desc))
126 { 126 {
127 GDBM_SET_ERRNO (dbf, GDBM_FILE_SYNC_ERROR, TRUE); 127 GDBM_SET_ERRNO (dbf, GDBM_FILE_SYNC_ERROR, TRUE);
128 return 1; 128 return 1;
129 } 129 }
130 return 0;
130#else 131#else
131 sync (); 132 sync ();
132 sync (); 133 sync ();
133 return 0; 134 return 0;
134#endif 135#endif
135} 136}

Return to:

Send suggestions and report system problems to the System administrator.