3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-15 05:18:44 +00:00

Merge branch 'unstable' of https://github.com/Z3Prover/z3 into unstable

This commit is contained in:
Christoph M. Wintersteiger 2015-05-23 13:25:00 +01:00
commit f1cc1842e1
2 changed files with 13 additions and 4 deletions

View file

@ -24,7 +24,8 @@ Notes:
#include"polynomial_factorization.h"
#endif
using namespace std;
using std::cout;
using std::endl;
// some prime numbers
unsigned primes[] = {

View file

@ -19,6 +19,13 @@ Revision History:
#include"debug.h"
#include"hash.h"
#include <string.h>
static unsigned read_unsigned(const char *s) {
unsigned n;
memcpy(&n, s, sizeof(unsigned));
return n;
}
// I'm using Bob Jenkin's hash function.
// http://burtleburtle.net/bob/hash/doobs.html
@ -31,10 +38,11 @@ unsigned string_hash(const char * str, unsigned length, unsigned init_value) {
c = init_value; /* the previous hash value */
/*---------------------------------------- handle most of the key */
SASSERT(sizeof(unsigned) == 4);
while (len >= 12) {
a += reinterpret_cast<const unsigned *>(str)[0];
b += reinterpret_cast<const unsigned *>(str)[1];
c += reinterpret_cast<const unsigned *>(str)[2];
a += read_unsigned(str);
b += read_unsigned(str+4);
c += read_unsigned(str+8);
mix(a,b,c);
str += 12; len -= 12;
}