예제 #1
0
파일: proof.hpp 프로젝트: HUST-PLT/cyclist
		size_t operator()(Quad const &key) const {
			int seed = 0;
			HASH_VAL(seed, Vertex, get< 0 >(key));
			HASH_VAL(seed, Vertex, get< 1 >(key));
			HASH_VAL(seed, Tag, get< 2 >(key));
			HASH_VAL(seed, Tag, get< 3 >(key));
			return seed;
		}
예제 #2
0
파일: stmt.c 프로젝트: unixaaa/LuxCC
LabelName *lookup_label_name(char *name)
{
    LabelName *np;

    for (np = label_names[HASH_VAL(name)]; np != NULL; np = np->next)
        if (equal(name, np->name))
            return np;
    return NULL; /* not found */
}
예제 #3
0
static NCURSES_INLINE unsigned long
hash(NCURSES_CH_T * text)
{
    int i;
    NCURSES_CH_T ch;
    unsigned long result = 0;
    for (i = TEXTWIDTH; i > 0; i--) {
	ch = *text++;
	result += (result << 5) + HASH_VAL(ch);
    }
    return result;
}
예제 #4
0
hash_t *obj_init_typemap(
  ualloc_t              *ua,
  err_t                 *out_err)
{
  err_t x = ERROR_NONE;
  hash_t *typemap = NULL;
  hash_t *namemap = NULL;
  hash_t *isamap = NULL;

  x = HASH_CREATE_SIMPLE(ua,HASH_F_INTKEY,&typemap);
  if (x)
    goto DONE;
  x = HASH_CREATE_SIMPLE(ua,HASH_F_COPYVAL,&namemap);
  if (x)
    goto DONE;
  x = HASH_CREATE_SIMPLE(ua,HASH_F_INTKEY,&isamap);
  if (x)
    goto DONE;
  x = hash_add(typemap, HASH_KEY(_INTERNAL_MN_KEY), HASH_VAL(namemap));
  if (x)
    goto DONE;
  x = hash_add(typemap, HASH_KEY(_INTERNAL_ISA_KEY), HASH_VAL(isamap));
 DEATH:
  if (x) {
    if (isamap)
      (void) hash_destroy(isamap);
    if (namemap)
      (void) hash_destroy(namemap);
    if (typemap)
      (void) hash_destroy(typemap);
    typemap = NULL;
  }
  if (out_err)
    *out_err = x;
  return typemap;
}
예제 #5
0
파일: stmt.c 프로젝트: unixaaa/LuxCC
int install_label_name(char *name)
{
    unsigned h;
    LabelName *np;

    h = HASH_VAL(name);
    for (np = label_names[h]; np != NULL; np = np->next)
        if (equal(name, np->name))
            break;

    if (np == NULL) {
        np = arena_alloc(label_names_arena, sizeof(LabelName));
        np->name = name;
        np->next = label_names[h];
        label_names[h] = np;
        return TRUE; /* success */
    } else {
        return FALSE; /* failure */
    }
}
예제 #6
0
//------------------------------------------------------------------
size_t TraceState::hash() const {
	int seed = 0;
	HASH_VAL(seed, Vertex, vertex);
	HASH_VAL(seed, Tag, tag);
	return seed;
}