Ticket #11754: trac_11754-ifndef-rev.patch

File trac_11754-ifndef-rev.patch, 1.4 KB (added by dcoudert, 9 years ago)
  • sage/graphs/graph_decompositions/rankwidth/rw.c

    # HG changeset patch
    # User dcoudert <david.coudert@inria.fr>
    # Date 1330089870 -3600
    # Node ID 805a1438ce565d4caf03be0a9dd3e2c57dcd649c
    # Parent  343b4781c9dc5c80eb93588b789baacbc345d300
    additional corrections for patch 11754
    
    diff --git a/sage/graphs/graph_decompositions/rankwidth/rw.c b/sage/graphs/graph_decompositions/rankwidth/rw.c
    a b  
    222222int init_rw(uint_fast8_t n)
    223223{
    224224        // If sizeof(uint_fast8_t) * (1ul << n) overflows, it wraps around to 0, since size_t and unsigned long are unsigned integer types.
    225         if(n > MAX_VERTICES || n && !(sizeof(uint_fast8_t) * (1ul << n)))
     225        if(  (n > MAX_VERTICES) || ( (n>0) && !(sizeof(uint_fast8_t) * (1ul << n)) ) )
    226226                return(-1);
    227227
    228228        num_vertices = n;
  • sage/graphs/graph_decompositions/rankwidth/rw.h

    diff --git a/sage/graphs/graph_decompositions/rankwidth/rw.h b/sage/graphs/graph_decompositions/rankwidth/rw.h
    a b  
    2525
    2626// Use data type uint_leastN_t. N is an upper limit on the size of the graphs that can be handled. N=32 seems to be a good compromise for now (the code works well with other values of N).
    2727// uint_leastN_t is faster than uint_fastN_t here, since the bottleneck is cache misses.
    28 #ifndef subset_t
     28#ifndef __RANKWIDTH_H_SUBSET_T__
     29#define __RANKWIDTH_H_SUBSET_T__
    2930typedef uint_least32_t subset_t;
    3031#endif
    3132