: hsh_hash_bytes (v->s, MIN (MAX_SHORT_STRING, width)));
}
+
+int
+compare_ptr_values (const union value **v1, const union value **v2, int width)
+{
+ return compare_values (*v1, *v2, width);
+}
+
+unsigned
+hash_ptr_value (const union value **v, int width)
+{
+ return hash_value (*v, width);
+}
+
+
/* Copies SRC to DST, given that they both contain data of the
given WIDTH. */
void
union value *value_create (int width);
int compare_values (const union value *, const union value *, int width);
-unsigned hash_value (const union value *, int width);
+unsigned hash_value (const union value *, int width);
+
+int compare_ptr_values (const union value **, const union value **, int width);
+unsigned hash_ptr_value (const union value **, int width);
+
static inline size_t value_cnt_from_width (int width);
void value_copy (union value *, const union value *, int width);
struct hsh_iterator hi1;
struct factor_statistics *fs;
- struct hsh_table *idh0=0;
- struct hsh_table *idh1=0;
- union value *val0;
- union value *val1;
+ struct hsh_table *idh0 = NULL;
+ struct hsh_table *idh1 = NULL;
+ union value **val0;
+ union value **val1;
- idh0 = hsh_create (4, (hsh_compare_func *) compare_values,
- (hsh_hash_func *) hash_value,
+ idh0 = hsh_create (4, (hsh_compare_func *) compare_ptr_values,
+ (hsh_hash_func *) hash_ptr_value,
0,0);
- idh1 = hsh_create (4, (hsh_compare_func *) compare_values,
- (hsh_hash_func *) hash_value,
+ idh1 = hsh_create (4, (hsh_compare_func *) compare_ptr_values,
+ (hsh_hash_func *) hash_ptr_value,
0,0);
fs != 0 ;
fs = hsh_next (fctr->fstats, &hi))
{
- hsh_insert (idh0, (void *) &fs->id[0]);
- hsh_insert (idh1, (void *) &fs->id[1]);
+ hsh_insert (idh0, &fs->id[0]);
+ hsh_insert (idh1, &fs->id[1]);
}
/* Ensure that the factors combination is complete */
val1 = hsh_next (idh1, &hi1))
{
struct factor_statistics **ffs;
- union value key[2];
+ union value *key[2];
key[0] = *val0;
key[1] = *val1;
ffs = (struct factor_statistics **)
- hsh_probe (fctr->fstats, (void *) &key );
+ hsh_probe (fctr->fstats, &key );
if ( !*ffs ) {
size_t i;
(*ffs) = create_factor_statistics (n_dependent_vars,
- &key[0], &key[1]);
+ key[0], key[1]);
for ( i = 0 ; i < n_dependent_vars ; ++i )
metrics_precalc ( & (*ffs)->m[i]);
}