LCOV - code coverage report
Current view: top level - ccache - murmurhashneutral2.c (source / functions) Hit Total Coverage
Test: ccache.lcov.info Lines: 0 26 0.0 %
Date: 2015-06-29 Functions: 0 1 0.0 %
Branches: 0 6 0.0 %

           Branch data     Line data    Source code
       1                 :            : /*
       2                 :            :  * MurmurHashNeutral2, by Austin Appleby. Released to the public domain. See
       3                 :            :  * <http://murmurhash.googlepages.com>.
       4                 :            :  */
       5                 :            : 
       6                 :            : #include "murmurhashneutral2.h"
       7                 :            : 
       8                 :            : unsigned int
       9                 :          0 : murmurhashneutral2(const void *key, int len, unsigned int seed)
      10                 :            : {
      11                 :          0 :         const unsigned int m = 0x5bd1e995;
      12                 :          0 :         const int r = 24;
      13                 :            : 
      14                 :          0 :         unsigned int h = seed ^ len;
      15                 :            : 
      16                 :          0 :         const unsigned char *data = (const unsigned char *)key;
      17                 :            : 
      18         [ #  # ]:          0 :         while (len >= 4) {
      19                 :            :                 unsigned int k;
      20                 :            : 
      21                 :          0 :                 k  = data[0];
      22                 :          0 :                 k |= data[1] << 8;
      23                 :          0 :                 k |= data[2] << 16;
      24                 :          0 :                 k |= data[3] << 24;
      25                 :            : 
      26                 :          0 :                 k *= m;
      27                 :          0 :                 k ^= k >> r;
      28                 :          0 :                 k *= m;
      29                 :            : 
      30                 :          0 :                 h *= m;
      31                 :          0 :                 h ^= k;
      32                 :            : 
      33                 :          0 :                 data += 4;
      34                 :          0 :                 len -= 4;
      35                 :            :         }
      36                 :            : 
      37   [ #  #  #  # ]:          0 :         switch (len)
      38                 :            :         {
      39                 :          0 :         case 3: h ^= data[2] << 16;
      40                 :          0 :         case 2: h ^= data[1] << 8;
      41                 :          0 :         case 1: h ^= data[0];
      42                 :          0 :                 h *= m;
      43                 :            :         };
      44                 :            : 
      45                 :          0 :         h ^= h >> 13;
      46                 :          0 :         h *= m;
      47                 :          0 :         h ^= h >> 15;
      48                 :            : 
      49                 :          0 :         return h;
      50                 :            : }

Generated by: LCOV version 1.9