Loading...
--- Libc/Libc-320/db/hash/hash_func.c
+++ Libc/Libc-262.3.2/db/hash/hash_func.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003 Apple Computer, Inc. All rights reserved.
+ * Copyright (c) 1999 Apple Computer, Inc. All rights reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
@@ -22,7 +22,7 @@
*
* @APPLE_LICENSE_HEADER_END@
*/
-/*-
+/*
* Copyright (c) 1990, 1993
* The Regents of the University of California. All rights reserved.
*
@@ -58,10 +58,6 @@
* SUCH DAMAGE.
*/
-#if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)hash_func.c 8.2 (Berkeley) 2/21/94";
-#endif /* LIBC_SCCS and not lint */
-#include <sys/cdefs.h>
#include <sys/types.h>
@@ -70,13 +66,13 @@
#include "page.h"
#include "extern.h"
-static u_int32_t hash1(const void *, size_t) ;
-static u_int32_t hash2(const void *, size_t) ;
-static u_int32_t hash3(const void *, size_t) ;
-static u_int32_t hash4(const void *, size_t);
+static u_int32_t hash1 __P((const void *, size_t));
+static u_int32_t hash2 __P((const void *, size_t));
+static u_int32_t hash3 __P((const void *, size_t));
+static u_int32_t hash4 __P((const void *, size_t));
/* Global default hash function */
-u_int32_t (*__default_hash)(const void *, size_t) = hash4;
+u_int32_t (*__default_hash) __P((const void *, size_t)) = hash4;
/*
* HASH FUNCTIONS
@@ -93,10 +89,10 @@
static u_int32_t
hash1(keyarg, len)
const void *keyarg;
- size_t len;
-{
- const u_char *key;
- u_int32_t h;
+ register size_t len;
+{
+ register const u_char *key;
+ register u_int32_t h;
/* Convert string to integer */
for (key = keyarg, h = 0; len--;)
@@ -115,9 +111,9 @@
const void *keyarg;
size_t len;
{
- const u_char *e, *key;
- u_int32_t h;
- u_char c;
+ register const u_char *e, *key;
+ register u_int32_t h;
+ register u_char c;
key = keyarg;
e = key + len;
@@ -142,11 +138,11 @@
static u_int32_t
hash3(keyarg, len)
const void *keyarg;
- size_t len;
-{
- const u_char *key;
- size_t loop;
- u_int32_t h;
+ register size_t len;
+{
+ register const u_char *key;
+ register size_t loop;
+ register u_int32_t h;
#define HASHC h = *key++ + 65599 * h
@@ -190,11 +186,11 @@
static u_int32_t
hash4(keyarg, len)
const void *keyarg;
- size_t len;
-{
- const u_char *key;
- size_t loop;
- u_int32_t h;
+ register size_t len;
+{
+ register const u_char *key;
+ register size_t loop;
+ register u_int32_t h;
#define HASH4a h = (h << 5) - h + *key++;
#define HASH4b h = (h << 5) + h + *key++;