OpenCores
URL https://opencores.org/ocsvn/openrisc_me/openrisc_me/trunk

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [gdb-6.8/] [libiberty/] [hashtab.c] - Diff between revs 157 and 225

Show entire file | Details | Blame | View Log

Rev 157 Rev 225
Line 1... Line 1...
/* An expandable hash tables datatype.
/* An expandable hash tables datatype.
   Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004
   Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2009
   Free Software Foundation, Inc.
   Free Software Foundation, Inc.
   Contributed by Vladimir Makarov (vmakarov@cygnus.com).
   Contributed by Vladimir Makarov (vmakarov@cygnus.com).
 
 
This file is part of the libiberty library.
This file is part of the libiberty library.
Libiberty is free software; you can redistribute it and/or
Libiberty is free software; you can redistribute it and/or
Line 48... Line 48...
#include <malloc.h>
#include <malloc.h>
#endif
#endif
#ifdef HAVE_LIMITS_H
#ifdef HAVE_LIMITS_H
#include <limits.h>
#include <limits.h>
#endif
#endif
 
#ifdef HAVE_INTTYPES_H
 
#include <inttypes.h>
 
#endif
#ifdef HAVE_STDINT_H
#ifdef HAVE_STDINT_H
#include <stdint.h>
#include <stdint.h>
#endif
#endif
 
 
#include <stdio.h>
#include <stdio.h>
Line 194... Line 197...
/* Returns a hash code for P.  */
/* Returns a hash code for P.  */
 
 
static hashval_t
static hashval_t
hash_pointer (const PTR p)
hash_pointer (const PTR p)
{
{
  return (hashval_t) ((long)p >> 3);
  return (hashval_t) ((intptr_t)p >> 3);
}
}
 
 
/* Returns non-zero if P1 and P2 are equal.  */
/* Returns non-zero if P1 and P2 are equal.  */
 
 
static int
static int
Line 757... Line 760...
   too empty to improve effectivity of subsequent calls.  */
   too empty to improve effectivity of subsequent calls.  */
 
 
void
void
htab_traverse (htab_t htab, htab_trav callback, PTR info)
htab_traverse (htab_t htab, htab_trav callback, PTR info)
{
{
  if (htab_elements (htab) * 8 < htab_size (htab))
  size_t size = htab_size (htab);
 
  if (htab_elements (htab) * 8 < size && size > 32)
    htab_expand (htab);
    htab_expand (htab);
 
 
  htab_traverse_noresize (htab, callback, info);
  htab_traverse_noresize (htab, callback, info);
}
}
 
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.