diff options
Diffstat (limited to 'mbbsd/stuff.c')
-rw-r--r-- | mbbsd/stuff.c | 41 |
1 files changed, 0 insertions, 41 deletions
diff --git a/mbbsd/stuff.c b/mbbsd/stuff.c index 1b3aace1..3b79de9a 100644 --- a/mbbsd/stuff.c +++ b/mbbsd/stuff.c @@ -531,47 +531,6 @@ DBCS_StringHash(const char *s) return fnv1a_32_dbcs_strcase(s, FNV1_32_INIT); } -inline int *intbsearch(int key, const int *base0, int nmemb) -{ - /* 改自 /usr/src/lib/libc/stdlib/bsearch.c , - 專給搜 int array 用的, 不透過 compar function 故較快些 */ - const char *base = (const char *)base0; - size_t lim; - int *p; - - for (lim = nmemb; lim != 0; lim >>= 1) { - p = (int *)(base + (lim >> 1) * 4); - if( key == *p ) - return p; - if( key > *p ){/* key > p: move right */ - base = (char *)p + 4; - lim--; - } /* else move left */ - } - return (NULL); -} - -inline unsigned int * -uintbsearch(const unsigned int key, const unsigned int *base0, const int nmemb) -{ - /* 改自 /usr/src/lib/libc/stdlib/bsearch.c , - 專給搜 int array 用的, 不透過 compar function 故較快些 */ - const char *base = (const char *)base0; - size_t lim; - unsigned int *p; - - for (lim = nmemb; lim != 0; lim >>= 1) { - p = (unsigned int *)(base + (lim >> 1) * 4); - if( key == *p ) - return p; - if( key > *p ){/* key > p: move right */ - base = (char *)p + 4; - lim--; - } /* else move left */ - } - return (NULL); -} - /* AIDS */ aidu_t fn2aidu(char *fn) { |