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); }
static guint quark_code_pair_hash_func (const QuarkCodePair *pair) { gint val; val = pair->error_domain + pair->error_code; return g_int_hash (&val); }
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); }
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); }
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); }
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 ); }
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); }
/** * 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; }
static guint tuple_hash (gconstpointer v) { const pair *data = v; return (g_int_hash (&data->x) ^ g_int_hash (&data->y)); }
btuint bt_int_hash(btconstpointer v) { return g_int_hash(v); }
guint ide_source_location_hash (IdeSourceLocation *self) { return ide_file_hash (self->file) ^ g_int_hash (&self->line) ^ g_int_hash (&self->line_offset); }