isl_test_cpp17-generic.cc: work around std::optional::value issue in older macOS
[isl.git] / isl_multi_hash.c
blob0c7ebdf7e56bfd74c6089561b253ea22b26eb0a4
1 /*
2 * Copyright 2016 Sven Verdoolaege
4 * Use of this software is governed by the MIT license
6 * Written by Sven Verdoolaege
7 */
9 #include <isl_multi_macro.h>
10 #include <isl/hash.h>
12 /* Return a hash value that digests "multi".
14 uint32_t FN(MULTI(BASE),get_hash)(__isl_keep MULTI(BASE) *multi)
16 int i;
17 uint32_t hash;
19 if (!multi)
20 return 0;
22 hash = isl_hash_init();
23 for (i = 0; i < multi->n; ++i) {
24 uint32_t el_hash;
25 el_hash = FN(EL,get_hash)(multi->u.p[i]);
26 isl_hash_hash(hash, el_hash);
29 return hash;