~james-page/ubuntu/saucy/openvswitch/1.12-snapshot

« back to all changes in this revision

Viewing changes to lib/jhash.c

  • Committer: James Page
  • Date: 2013-08-21 10:16:57 UTC
  • mfrom: (1.1.20)
  • Revision ID: james.page@canonical.com-20130821101657-3o0z0qeiv5zkwlzi
New upstream snapshot

Show diffs side-by-side

added added

removed removed

Lines of Context:
96
96
uint32_t
97
97
jhash_bytes(const void *p_, size_t n, uint32_t basis)
98
98
{
99
 
    const uint8_t *p = p_;
 
99
    const uint32_t *p = p_;
100
100
    uint32_t a, b, c;
101
101
 
102
102
    a = b = c = 0xdeadbeef + n + basis;
103
103
 
104
104
    while (n >= 12) {
105
 
        a += get_unaligned_u32((uint32_t *) p);
106
 
        b += get_unaligned_u32((uint32_t *) (p + 4));
107
 
        c += get_unaligned_u32((uint32_t *) (p + 8));
 
105
        a += get_unaligned_u32(p);
 
106
        b += get_unaligned_u32(p + 1);
 
107
        c += get_unaligned_u32(p + 2);
108
108
        jhash_mix(&a, &b, &c);
109
109
        n -= 12;
110
 
        p += 12;
 
110
        p += 3;
111
111
    }
112
112
 
113
113
    if (n) {