diff options
author | in2 <in2@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2005-01-24 22:06:48 +0800 |
---|---|---|
committer | in2 <in2@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2005-01-24 22:06:48 +0800 |
commit | 9084d9602e8725a6fb832d4396c12ddd7bb2b7c7 (patch) | |
tree | 78d04dab42a50e73845c8e31eb877001fb8379cd /util/uhash_loader.c | |
parent | f6324fdcb56a70815842cc39cb1826ce6b82148c (diff) | |
download | pttbbs-9084d9602e8725a6fb832d4396c12ddd7bb2b7c7.tar pttbbs-9084d9602e8725a6fb832d4396c12ddd7bb2b7c7.tar.gz pttbbs-9084d9602e8725a6fb832d4396c12ddd7bb2b7c7.tar.bz2 pttbbs-9084d9602e8725a6fb832d4396c12ddd7bb2b7c7.tar.lz pttbbs-9084d9602e8725a6fb832d4396c12ddd7bb2b7c7.tar.xz pttbbs-9084d9602e8725a6fb832d4396c12ddd7bb2b7c7.tar.zst pttbbs-9084d9602e8725a6fb832d4396c12ddd7bb2b7c7.zip |
use time4_t(uint32_t) instead of time_t for x86-64 arch.
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@2426 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'util/uhash_loader.c')
-rw-r--r-- | util/uhash_loader.c | 29 |
1 files changed, 5 insertions, 24 deletions
diff --git a/util/uhash_loader.c b/util/uhash_loader.c index 86c47414..add528ba 100644 --- a/util/uhash_loader.c +++ b/util/uhash_loader.c @@ -1,28 +1,9 @@ /* $Id$ */ /* standalone uhash loader -- jochang */ -#include <stdio.h> -#include <stdlib.h> -#include <string.h> -#include <unistd.h> -#include <fcntl.h> -#include <ctype.h> -#include <sys/mman.h> -#include <sys/types.h> -#include <sys/stat.h> -#include <sys/types.h> -#include <sys/ipc.h> -#include <sys/shm.h> - -#ifdef __FreeBSD__ -#include <machine/param.h> -#endif - -#include "config.h" -#include "pttstruct.h" -#include "common.h" +#include "bbs.h" unsigned string_hash(unsigned char *s); -void add_to_uhash(int n, userec_t *id); +void userec_add_to_uhash(int n, userec_t *id); void fill_uhash(void); void load_uhash(void); @@ -93,7 +74,7 @@ void fill_uhash(void) for (mimage = fimage; usernumber < fd; mimage += sizeof(userec_t)) { - add_to_uhash(usernumber, (userec_t *)mimage); + userec_add_to_uhash(usernumber, (userec_t *)mimage); usernumber++; } munmap(fimage, stbuf.st_size); @@ -114,10 +95,10 @@ unsigned string_hash(unsigned char *s) v = (v << 8) | (v >> 24); v ^= toupper(*s++); /* note this is case insensitive */ } - return (v * 2654435769UL) >> (32 - HASH_BITS); + return (v * 2654435769U) >> (32 - HASH_BITS); } -void add_to_uhash(int n, userec_t *user) +void userec_add_to_uhash(int n, userec_t *user) { int *p, h = string_hash(user->userid); strcpy(SHM->userid[n], user->userid); |