Example #1
0
static guint
_relative_placement_key_hash (gconstpointer key)
{
    const RndfOverlayLane *olane = key;
    return g_int_hash (&olane->parent->segment->id) ^ 
        g_int_hash (&olane->lane->id);
}
Example #2
0
static guint
quark_code_pair_hash_func (const QuarkCodePair *pair)
{
  gint val;
  val = pair->error_domain + pair->error_code;
  return g_int_hash (&val);
}
Example #3
0
static guint
_sockaddr_in_hash (const void * key)
{
    struct sockaddr_in *addr = (struct sockaddr_in*) key;
    int v = addr->sin_port * addr->sin_addr.s_addr;
    return g_int_hash (&v);
}
Example #4
0
guint utility_int16Hash(gconstpointer value) {
	g_assert(value);
	/* make sure upper bits are zero */
	gint key = 0;
	key = (gint) *((gint16*)value);
	return g_int_hash(&key);
}
Example #5
0
static guint
hash_lane_id (gconstpointer key)
{
    const int32_t * id = key;
    gint val = ((id[0] & 0x3ff) << 22) | ((id[1] & 0xff) << 14);
    return g_int_hash (&val);
}
Example #6
0
guint
gnc_gdate_hash( gconstpointer gd )
{
    gint val = (g_date_get_year( (GDate*)gd ) * 10000)
               + (g_date_get_month( (GDate*)gd ) * 100)
               + g_date_get_day( (GDate*)gd );
    return g_int_hash( &val );
}
Example #7
0
guint
ostree_hash_object_name (gconstpointer a)
{
  GVariant *variant = (gpointer)a;
  const char *checksum;
  OstreeObjectType objtype;
  gint objtype_int;
  
  ostree_object_name_deserialize (variant, &checksum, &objtype);
  objtype_int = (gint) objtype;
  return g_str_hash (checksum) + g_int_hash (&objtype_int);
}
Example #8
0
/**
 * crank_permutation_hash:
 * @p: (type CrankPermutation) (nullable): A Permutation
 *
 * Constructs a hash value of permutation.
 *
 * Returns: Hash value of permutation
 */
guint
crank_permutation_hash (gconstpointer p)
{
  CrankPermutation *pp = (CrankPermutation*)p;
  guint sum = 0;
  guint i;

  if (pp == NULL)
    return 0;

  for (i = 0; i < pp->n; i++)
    {
      sum += g_int_hash (pp->data + i);
      sum *= 23;
    }

  return sum;
}
Example #9
0
static guint
tuple_hash (gconstpointer v)
{
  const pair *data = v;
  return (g_int_hash (&data->x) ^ g_int_hash (&data->y));
}
Example #10
0
btuint bt_int_hash(btconstpointer v) { return g_int_hash(v); }
Example #11
0
guint
ide_source_location_hash (IdeSourceLocation *self)
{
  return ide_file_hash (self->file) ^ g_int_hash (&self->line) ^ g_int_hash (&self->line_offset);
}