Skip to content

Commit

Permalink
kernel: fix header includes
Browse files Browse the repository at this point in the history
  • Loading branch information
james-d-mitchell committed Dec 14, 2018
1 parent 4de12fd commit a45a3c0
Show file tree
Hide file tree
Showing 9 changed files with 51 additions and 55 deletions.
7 changes: 4 additions & 3 deletions src/digraphs-debug.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,11 @@
#ifndef DIGRAPHS_SRC_DIGRAPHS_DEBUG_H_
#define DIGRAPHS_SRC_DIGRAPHS_DEBUG_H_

#include <assert.h>
#include <src/system.h>
// C headers
#include <assert.h> // for assert

#include "digraphs-config.h"
// Digraphs package headers
#include "digraphs-config.h" // for DIGRAPHS_KERNEL_DEBUG

// DIGRAPHS_ASSERT is a version of 'assert' which is enabled by the
// configure option --enable-debug
Expand Down
11 changes: 10 additions & 1 deletion src/digraphs.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,16 @@
**
*******************************************************************************/

#include "src/digraphs.h"
#include "digraphs.h"

#include <stdbool.h>
#include <stdlib.h>

#include "bliss-0.73/bliss_C.h"

#include "digraphs-debug.h"
#include "homos.h"
#include "planar.h"

#undef PACKAGE
#undef PACKAGE_BUGREPORT
Expand Down
10 changes: 2 additions & 8 deletions src/digraphs.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,8 @@
#ifndef DIGRAPHS_SRC_DIGRAPHS_H_
#define DIGRAPHS_SRC_DIGRAPHS_H_

#include <digraphs-debug.h>
#include <stdbool.h>
#include <stdlib.h>

#include "bliss-0.73/bliss_C.h"

#include "src/compiled.h" /* GAP headers */
#include "src/homos.h"
// GAP headers
#include "src/compiled.h" // for Obj, Int

Int DigraphNrVertices(Obj digraph);
Int DigraphNrEdges(Obj digraph);
Expand Down
43 changes: 12 additions & 31 deletions src/homos.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,17 @@
**
********************************************************************************/

#include "src/homos.h"
#include "src/digraphs-config.h"
#include "homos.h"

// C headers
#include <setjmp.h> // for setjmp

// Bliss headers
#include "bliss-0.73/bliss_C.h" // for BlissGraph, . . .

// Digraphs package headers
#include "digraphs-debug.h" // for DIGRAPHS_ASSERT
#include "schreier-sims.h" // for PermColl, . . .

////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
Expand Down Expand Up @@ -109,33 +118,6 @@ static void init_mask(void) {
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////

////////////////////////////////////////////////////////////////////////////////
// COUNT_TRUES_BLOCK: this is from gap/src/blister.h, it counts the number of
// bits in a block which are set to 1.
////////////////////////////////////////////////////////////////////////////////

static inline UInt COUNT_TRUES_BLOCK(UInt block) {
#if USE_POPCNT && defined(HAVE___BUILTIN_POPCOUNTL)
return __builtin_popcountl(block);
#else
#if SIZEOF_VOID_P == 8
block = (block & 0x5555555555555555L) + ((block >> 1) & 0x5555555555555555L);
block = (block & 0x3333333333333333L) + ((block >> 2) & 0x3333333333333333L);
block = (block + (block >> 4)) & 0x0f0f0f0f0f0f0f0fL;
block = (block + (block >> 8));
block = (block + (block >> 16));
block = (block + (block >> 32)) & 0x00000000000000ffL;
#else
block = (block & 0x55555555) + ((block >> 1) & 0x55555555);
block = (block & 0x33333333) + ((block >> 2) & 0x33333333);
block = (block + (block >> 4)) & 0x0f0f0f0f;
block = (block + (block >> 8));
block = (block + (block >> 16)) & 0x000000ff;
#endif
return block;
#endif
}

////////////////////////////////////////////////////////////////////////////////
// new_bit_array: get a pointer to a new BitArray with space for <nr_bits>
// bits, and with every bit set to false.
Expand Down Expand Up @@ -597,8 +579,7 @@ inline static bool is_adjacent_digraph(Digraph* digraph, Vertex i, Vertex j) {

////////////////////////////////////////////////////////////////////////////////
// new_bliss_digraphs_graph: get a new bliss (undirected, vertex coloured)
// digraph from
// the Digraph pointed to by <digraph>.
// digraph from the Digraph pointed to by <digraph>.
////////////////////////////////////////////////////////////////////////////////

static BlissGraph* new_bliss_digraphs_graph_from_digraph(Digraph* digraph,
Expand Down
8 changes: 4 additions & 4 deletions src/homos.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@
#ifndef DIGRAPHS_SRC_HOMOS_H_
#define DIGRAPHS_SRC_HOMOS_H_

#include <limits.h>
#include <setjmp.h>
// GAP headers
#include "src/compiled.h"

#include "bliss-0.73/bliss_C.h"
#include "src/schreier-sims.h"
// Digraphs package headers
#include "perms.h" // for UIntS

void homo_hook_print();
typedef UIntS Vertex;
Expand Down
10 changes: 9 additions & 1 deletion src/perms.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,15 @@
** This file is free software, see the digraphs/LICENSE.
**
*******************************************************************************/
#include "src/perms.h"

#include "perms.h"

// C headers
#include <stdlib.h> // for malloc, . . .
#include <string.h> // memcpy

// Digraphs package headers
#include "digraphs-debug.h" // for DIGRAPHS_ASSERT

// variables for debugging memory leaks
UIntL nr_ss_allocs;
Expand Down
6 changes: 1 addition & 5 deletions src/perms.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,7 @@
#ifndef DIGRAPHS_SRC_PERMS_H_
#define DIGRAPHS_SRC_PERMS_H_

#include <digraphs-debug.h>
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdbool.h> // for bool

#define MAXVERTS 512
#define UNDEFINED MAXVERTS + 1
Expand Down
9 changes: 8 additions & 1 deletion src/schreier-sims.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,14 @@
**
*******************************************************************************/

#include "src/schreier-sims.h"
#include "schreier-sims.h"

// C headers
#include "stdlib.h" // for NULL
#include "string.h" // for memset

// Digraphs package headers
#include "digraphs-debug.h" // for DIGRAPHS_ASSERT

// Schreier-Sims set up

Expand Down
2 changes: 1 addition & 1 deletion src/schreier-sims.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#ifndef DIGRAPHS_SRC_SCHREIER_SIMS_H_
#define DIGRAPHS_SRC_SCHREIER_SIMS_H_

#include "src/perms.h"
#include "perms.h" // for PermColl and UIntS

extern bool point_stabilizer(PermColl* gens, UIntS const pt, PermColl** out);

Expand Down

0 comments on commit a45a3c0

Please sign in to comment.