Home | History | Annotate | Download | only in useful

Lines Matching defs:gb

36   GuestBytes* gb = malloc(sizeof(GuestBytes));
37 assert(gb);
42 r= fscanf(f, "GuestBytes %llx %d ", &gb->ga, &gb->nbytes);
46 assert(gb->ga != 0);
47 assert(gb->nbytes > 0);
48 assert(gb->nbytes < 5000); // let's say
50 Int nToAlloc = gb->nbytes + (gb->ga & 3);
52 gb->bytes = malloc( gb->nbytes + nToAlloc);
53 gb->actual = gb->bytes + (gb->ga & 3);
54 assert(gb->bytes);
57 for (i = 0; i < gb->nbytes; i++) {
61 gb->actual[i] = b;
70 return gb;
80 GuestBytes* gb = read_one(f);
81 if (0) printf("got %llu %d\n", gb->ga, gb->nbytes);
82 fn( gb, opaque );
83 free(gb->bytes);
84 free(gb);
90 UInt hash_const_zero ( GuestBytes* gb ) {
94 UInt hash_sum ( GuestBytes* gb ) {
96 for (i = 0; i < gb->nbytes; i++)
97 sum += (UInt)gb->actual[i];
101 UInt hash_rol ( GuestBytes* gb ) {
103 for (i = 0; i < gb->nbytes; i++) {
104 sum ^= (UInt)gb->actual[i];
110 static UInt cand0 ( GuestBytes* gb )
112 UWord addr = (UWord)gb->actual;
113 UWord len = gb->nbytes;
149 static UInt cand1 ( GuestBytes* gb )
151 UWord addr = (UWord)gb->actual;
152 UWord len = gb->nbytes;
193 static UInt adler32 ( GuestBytes* gb )
195 UWord addr = (UWord)gb->actual;
196 UWord len = gb->nbytes;
258 void try_onebit_changes( GuestBytes* gb, void* opaque )
265 UInt nHashes = 8 * gb->nbytes;
272 hInit = theFn( gb );
273 for (byteIx = 0; byteIx < gb->nbytes; byteIx++) {
276 invertBit(gb->actual, byteIx, bitIx);
277 //invertBit(gb->actual, byteIx, bitIx ^ 4);
279 hRunning = theFn( gb );
287 invertBit(gb->actual, byteIx, bitIx);
288 //invertBit(gb->actual, byteIx, bitIx ^ 4);
294 hFinal = theFn( gb );