• use Jenkins’ one-at-a-time hash for mksh keytabs, as it has

much better avalanche and no known funnels
• improve comments
• fix some types (uint32_t for hash, size_t for sizes)
• optimise ktsort()

no functional change, I think
This commit is contained in:
tg
2009-08-28 18:54:01 +00:00
parent 8f937ec71b
commit ca1f967a45
7 changed files with 63 additions and 55 deletions

6
exec.c
View File

@ -22,7 +22,7 @@
#include "sh.h"
__RCSID("$MirOS: src/bin/mksh/exec.c,v 1.60 2009/08/08 13:08:49 tg Exp $");
__RCSID("$MirOS: src/bin/mksh/exec.c,v 1.61 2009/08/28 18:53:57 tg Exp $");
static int comexec(struct op *, struct tbl *volatile, const char **,
int volatile, volatile int *);
@ -800,7 +800,7 @@ shcomexec(const char **wp)
* is created if none is found.
*/
struct tbl *
findfunc(const char *name, unsigned int h, int create)
findfunc(const char *name, uint32_t h, int create)
{
struct block *l;
struct tbl *tp = NULL;
@ -899,7 +899,7 @@ struct tbl *
findcom(const char *name, int flags)
{
static struct tbl temp;
unsigned int h = hash(name);
uint32_t h = hash(name);
struct tbl *tp = NULL, *tbi;
unsigned char insert = Flag(FTRACKALL); /* insert if not found */
char *fpath; /* for function autoloading */