" Normalized: %4s\n"
" Sorts: %7s\n"
" Rating: %4i\n"
- " Hash: 0x%08"PRIx32"\n"
+ " Hash: 0x%"PRIx64"\n"
"\n",
comparators_num,
(normalized ? "yes" : "no"),
return (0);
} /* int sn_comparator_compare */
-uint32_t sn_comparator_get_hashval (const sn_comparator_t *c) /* {{{ */
+uint64_t sn_comparator_get_hashval (const sn_comparator_t *c) /* {{{ */
{
if (c == NULL)
return (0);
/* 100937 and 103319 are some random prime numbers */
- return ((((uint32_t) c->min) * 100937)
- + (((uint32_t) c->max) * 103319));
+ return ((((uint64_t) c->min) * 100937)
+ + (((uint64_t) c->max) * 103319));
} /* }}} uint32_t sn_comparator_get_hashval */
/* vim: set shiftwidth=2 softtabstop=2 : */
int sn_comparator_compare (const sn_comparator_t *c0,
const sn_comparator_t *c1);
-uint32_t sn_comparator_get_hashval (const sn_comparator_t *c);
+uint64_t sn_comparator_get_hashval (const sn_comparator_t *c);
#endif /* SN_COMPARATOR_H */
if ((ht == NULL) || (n == NULL))
return (EINVAL);
- hash = sn_network_get_hashval (n);
+ hash = (uint32_t) sn_network_get_hashval (n);
h0 = (uint8_t) (hash >> 24);
h1 = (uint8_t) (hash >> 16);
return (n);
} /* }}} sn_network_t *sn_network_unserialize */
-uint32_t sn_network_get_hashval (const sn_network_t *n) /* {{{ */
+uint64_t sn_network_get_hashval (const sn_network_t *n) /* {{{ */
{
- uint32_t hash;
+ uint64_t hash;
int i;
if (n == NULL)
return (0);
- hash = (uint32_t) n->inputs_num;
+ hash = (uint64_t) n->inputs_num;
for (i = 0; i < n->stages_num; i++)
hash = (hash * 104207) + sn_stage_get_hashval (n->stages[i]);
return (hash);
-} /* }}} uint32_t sn_network_get_hashval */
+} /* }}} uint64_t sn_network_get_hashval */
/* vim: set sw=2 sts=2 et fdm=marker : */
*/
sn_network_t *sn_network_unserialize (char *buffer, size_t buffer_size);
-uint32_t sn_network_get_hashval (const sn_network_t *n);
+uint64_t sn_network_get_hashval (const sn_network_t *n);
#endif /* SN_NETWORK_H */
return (s);
} /* sn_stage_t *sn_stage_unserialize */
-uint32_t sn_stage_get_hashval (const sn_stage_t *s) /* {{{ */
+uint64_t sn_stage_get_hashval (const sn_stage_t *s) /* {{{ */
{
- uint32_t hash;
+ uint64_t hash;
int i;
if (s == NULL)
return (0);
- hash = (uint32_t) s->depth;
+ hash = (uint64_t) s->depth;
for (i = 0; i < s->comparators_num; i++)
hash = (hash * 99991) + sn_comparator_get_hashval (s->comparators + i);
return (hash);
-} /* }}} uint32_t sn_stage_get_hashval */
+} /* }}} uint64_t sn_stage_get_hashval */
/* vim: set shiftwidth=2 softtabstop=2 expandtab fdm=marker : */
*/
sn_stage_t *sn_stage_unserialize (char **buffer, size_t *buffer_size);
-uint32_t sn_stage_get_hashval (const sn_stage_t *s);
+uint64_t sn_stage_get_hashval (const sn_stage_t *s);
#endif /* SN_STAGE_H */