Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'newlib/libc/search')
-rw-r--r--newlib/libc/search/hash.c16
-rw-r--r--newlib/libc/search/hash_bigkey.c3
-rw-r--r--newlib/libc/search/hash_page.c2
-rw-r--r--newlib/libc/search/hcreate_r.c3
4 files changed, 9 insertions, 15 deletions
diff --git a/newlib/libc/search/hash.c b/newlib/libc/search/hash.c
index 997acb3f6..0301fc03f 100644
--- a/newlib/libc/search/hash.c
+++ b/newlib/libc/search/hash.c
@@ -141,9 +141,9 @@ _DEFUN(__hash_open, (file, flags, mode, info, dflags),
new_table = 0;
if (!file || (flags & O_TRUNC) ||
#ifdef __USE_INTERNAL_STAT64
- (_stat64(file, &statbuf) && (errno == ENOENT))) {
+ (stat64(file, &statbuf) && (errno == ENOENT))) {
#else
- (_stat(file, &statbuf) && (errno == ENOENT))) {
+ (stat(file, &statbuf) && (errno == ENOENT))) {
#endif
if (errno == ENOENT)
errno = 0; /* Just in case someone looks at errno */
@@ -157,9 +157,9 @@ _DEFUN(__hash_open, (file, flags, mode, info, dflags),
a new .db file, then reinitialize the database */
if ((flags & O_CREAT) &&
#ifdef __USE_INTERNAL_STAT64
- _fstat64(hashp->fp, &statbuf) == 0 && statbuf.st_size == 0)
+ fstat64(hashp->fp, &statbuf) == 0 && statbuf.st_size == 0)
#else
- _fstat(hashp->fp, &statbuf) == 0 && statbuf.st_size == 0)
+ fstat(hashp->fp, &statbuf) == 0 && statbuf.st_size == 0)
#endif
new_table = 1;
@@ -316,11 +316,7 @@ init_hash(hashp, file, info)
const char *file;
const HASHINFO *info;
{
-#ifdef __USE_INTERNAL_STAT64
- struct stat64 statbuf;
-#else
struct stat statbuf;
-#endif
int nelem;
nelem = 1;
@@ -339,9 +335,9 @@ init_hash(hashp, file, info)
/* Fix bucket size to be optimal for file system */
if (file != NULL) {
#ifdef __USE_INTERNAL_STAT64
- if (_stat64(file, &statbuf))
+ if (stat64(file, &statbuf))
#else
- if (_stat(file, &statbuf))
+ if (stat(file, &statbuf))
#endif
return (NULL);
hashp->BSIZE = statbuf.st_blksize;
diff --git a/newlib/libc/search/hash_bigkey.c b/newlib/libc/search/hash_bigkey.c
index 8ff52b383..449b6bed6 100644
--- a/newlib/libc/search/hash_bigkey.c
+++ b/newlib/libc/search/hash_bigkey.c
@@ -123,7 +123,7 @@ __big_insert(hashp, bufp, key, val)
if (!bufp)
return (-1);
n = p[0];
- if (!key_size) {
+ if (!key_size)
if (FREESPACE(p)) {
move_bytes = MIN(FREESPACE(p), val_size);
off = OFFSET(p) - move_bytes;
@@ -136,7 +136,6 @@ __big_insert(hashp, bufp, key, val)
OFFSET(p) = off;
} else
p[n - 2] = FULL_KEY;
- }
p = (__uint16_t *)bufp->page;
cp = bufp->page;
bufp->flags |= BUF_MOD;
diff --git a/newlib/libc/search/hash_page.c b/newlib/libc/search/hash_page.c
index 7ca304d38..68ab9db17 100644
--- a/newlib/libc/search/hash_page.c
+++ b/newlib/libc/search/hash_page.c
@@ -667,7 +667,7 @@ static __uint16_t
overflow_page(hashp)
HTAB *hashp;
{
- __uint32_t *freep = NULL;
+ __uint32_t *freep;
int max_free, offset, splitnum;
__uint16_t addr;
int bit, first_page, free_bit, free_page, i, in_use_bits, j;
diff --git a/newlib/libc/search/hcreate_r.c b/newlib/libc/search/hcreate_r.c
index 8aba524ec..4ff758fdb 100644
--- a/newlib/libc/search/hcreate_r.c
+++ b/newlib/libc/search/hcreate_r.c
@@ -123,10 +123,9 @@ hcreate_r(size_t nel, struct hsearch_data *htab)
void
hdestroy_r(struct hsearch_data *htab)
{
-#if 0
struct internal_entry *ie;
size_t idx;
-#endif
+
if (htab->htable == NULL)
return;