LCOV - code coverage report
Current view: top level - metalib_isl - isl_gmp.c (source / functions) Hit Total Coverage
Test: 2018-10-31_cons_maint_greina.lcov Lines: 10 10 100.0 %
Date: 2018-11-01 11:19:43 Functions: 1 1 100.0 %

          Line data    Source code
       1             : /*
       2             :  * Copyright 2008-2009 Katholieke Universiteit Leuven
       3             :  *
       4             :  * Use of this software is governed by the MIT license
       5             :  *
       6             :  * Written by Sven Verdoolaege, K.U.Leuven, Departement
       7             :  * Computerwetenschappen, Celestijnenlaan 200A, B-3001 Leuven, Belgium
       8             :  */
       9             : 
      10             : #include <isl_int.h>
      11             : 
      12 >30751*10^7 : uint32_t isl_gmp_hash(mpz_t v, uint32_t hash)
      13             : {
      14 >30751*10^7 :         int sa = v[0]._mp_size;
      15 >30751*10^7 :         int abs_sa = sa < 0 ? -sa : sa;
      16 >30751*10^7 :         unsigned char *data = (unsigned char *)v[0]._mp_d;
      17 >30751*10^7 :         unsigned char *end = data + abs_sa * sizeof(v[0]._mp_d[0]);
      18             : 
      19 >30751*10^7 :         if (sa < 0)
      20 >15401*10^7 :                 isl_hash_byte(hash, 0xFF);
      21 >27676*10^8 :         for (; data < end; ++data)
      22 >24601*10^8 :                 isl_hash_byte(hash, *data);
      23 >30751*10^7 :         return hash;
      24             : }

Generated by: LCOV version 1.12