]> granicus.if.org Git - graphviz/commitdiff
lib/sparse: replace header guards with more modern #pragma once
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Fri, 17 Sep 2021 00:52:22 +0000 (17:52 -0700)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Mon, 20 Sep 2021 00:24:30 +0000 (17:24 -0700)
12 files changed:
lib/sparse/BinaryHeap.h
lib/sparse/DotIO.h
lib/sparse/IntStack.h
lib/sparse/LinkedList.h
lib/sparse/QuadTree.h
lib/sparse/SparseMatrix.h
lib/sparse/clustering.h
lib/sparse/color_palette.h
lib/sparse/colorutil.h
lib/sparse/general.h
lib/sparse/mq.h
lib/sparse/vector.h

index 95f4503cca7083b6743a87ad1b89c676990adb9e..462043f45c1badfc17177398502c95da253f5f0b 100644 (file)
@@ -8,8 +8,7 @@
  * Contributors: Details at https://graphviz.org
  *************************************************************************/
 
-#ifndef BinaryHeap_H
-#define  BinaryHeap_H
+#pragma once
 
 #include <sparse/general.h>
 #include <sparse/IntStack.h>
@@ -71,5 +70,3 @@ size_t BinaryHeap_reset(BinaryHeap h, int id, void *item);/* reset value of an i
 void BinaryHeap_print(BinaryHeap h, void (*pnt)(void*));
 
 void BinaryHeap_sanity_check(BinaryHeap h);
-
-#endif
index d4442000c0836a0eb8f82262ddb56d68446766c1..aa9a4dca27402abfccda5f83278d0e9dde9bdc43 100644 (file)
@@ -8,8 +8,7 @@
  * Contributors: Details at https://graphviz.org
  *************************************************************************/
 
-#ifndef DOTIO_H
-#define DOTIO_H
+#pragma once
 
 #include <cgraph.h>
 #include <sparse/SparseMatrix.h>
@@ -32,4 +31,3 @@ void Dot_SetClusterColor(Agraph_t* g, float *rgb_r,  float *rgb_g,  float *rgb_b
 void attached_clustering(Agraph_t* g, int maxcluster, int clustering_scheme);
 
 int Import_dot_splines(Agraph_t* g, int *ne, char ***xsplines);
-#endif
index baba5f47273269019ce5d067c832175983195bbc..03e1de2f741b20d740614fb352ee11ed1510f3a7 100644 (file)
@@ -8,8 +8,7 @@
  * Contributors: Details at https://graphviz.org
  *************************************************************************/
 
-#ifndef IntStack_H
-#define IntStack_H
+#pragma once
 
 #include <stddef.h>
 
@@ -34,5 +33,3 @@ size_t IntStack_push(IntStack s, int i); // add an item and return the pos
 int IntStack_pop(IntStack s, int *flag);/* remove the last item. If none exist, flag = -1, and return -1. */
 
 void IntStack_print(IntStack s);
-
-#endif
index 5608d9afe4f94b88978e621de48f516af8df5569..488dff5a7554653dee17f9526a5cac67a351bbc1 100644 (file)
@@ -8,8 +8,7 @@
  * Contributors: Details at https://graphviz.org
  *************************************************************************/
 
-#ifndef LINKED_LIST_H
-#define LINKED_LIST_H
+#pragma once
 
 typedef struct SingleLinkedList_struct* SingleLinkedList;
 
@@ -48,4 +47,3 @@ void* DoubleLinkedList_get_data(DoubleLinkedList l);
 DoubleLinkedList DoubleLinkedList_get_next(DoubleLinkedList l);
 
 void DoubleLinkedList_delete_element(DoubleLinkedList l,  void (*linklist_deallocator)(void*), DoubleLinkedList *head);
-#endif
index 2c5678c6e26b18539eb1f6861e9b372cae5e2b95..3f9f0c9a85369b036b44d8a5a4b0979f6e2fbcc4 100644 (file)
@@ -8,8 +8,7 @@
  * Contributors: Details at https://graphviz.org
  *************************************************************************/
 
-#ifndef QUAD_TREE_H
-#define QUAD_TREE_H
+#pragma once
 
 #include <sparse/LinkedList.h>
 #include <stdio.h>
@@ -56,5 +55,3 @@ void QuadTree_get_repulsive_force(QuadTree qt, real *force, real *x, real bh, re
 void QuadTree_get_nearest(QuadTree qt, real *x, real *ymin, int *imin, real *min, int *flag);
 
 QuadTree QuadTree_new_in_quadrant(int dim, real *center, real width, int max_level, int i);
-
-#endif
index 2874f1baa5532136910db91de6f2d774acdd3374..ea5a435058640602a5854f448b7b753171c031f0 100644 (file)
@@ -7,8 +7,8 @@
  *
  * Contributors: Details at https://graphviz.org
  *************************************************************************/
-#ifndef SPARSEMATRIX_H
-#define  SPARSEMATRIX_H
+
+#pragma once
 
 #include <sparse/general.h>
 #include <stdio.h>
@@ -113,5 +113,3 @@ SparseMatrix SparseMatrix_from_dense(int m, int n, real *x);
 #define SparseMatrix_known_undirected(A) test_flag((A)->property, MATRIX_UNDIRECTED)
 #define SparseMatrix_known_symmetric(A) test_flag((A)->property, MATRIX_SYMMETRIC)
 #define SparseMatrix_known_strucural_symmetric(A) test_flag((A)->property, MATRIX_PATTERN_SYMMETRIC)
-
-#endif
index f934fc93c9855f300c4b97eeb3a91c73be90e956..79417913e85aeb816afb07e78d0b7783d18db7f9 100644 (file)
@@ -8,8 +8,7 @@
  * Contributors: Details at https://graphviz.org
  *************************************************************************/
 
-#ifndef CLUSTERING_H
-#define CLUSTERING_H
+#pragma once
 
 typedef struct Multilevel_Modularity_Clustering_struct *Multilevel_Modularity_Clustering;
 
@@ -50,5 +49,3 @@ enum {CLUSTERING_MODULARITY = 0, CLUSTERING_MQ};
 */
 void modularity_clustering(SparseMatrix A, int inplace, int maxcluster, int use_value,
                           int *nclusters, int **assignment, real *modularity, int *flag);
-
-#endif
index 53eaadda5539f7218aee08ae3c8e3998a0fcb961..f77a918b3110a506f72664d27e5027448dc91592 100644 (file)
@@ -8,8 +8,8 @@
  * Contributors: Details at https://graphviz.org
  *************************************************************************/
 
-#ifndef COLOR_PALLETE_H
-#define COLOR_PALLETE_H
+#pragma once
+
 #include "stdio.h"
 enum {MAX_COLOR = 1001};
 
@@ -31,7 +31,3 @@ extern float palette_sequential_singlehue_red[1001][3];
 extern float palette_sequential_singlehue_red_lighter[1001][3];
 extern float palette_adam_blend[1001][3];
 extern float palette_adam[11][3];
-
-#endif
-
-
index 18b96934eaa1dff25b4eacd8bd6a2a9e7bf1d1d1..a34205e46f40f55133d9e1335e67a5b2042ad1ad 100644 (file)
@@ -8,8 +8,7 @@
  * Contributors: Details at https://graphviz.org
  *************************************************************************/
 
-#ifndef COLORUTIL_H
-#define COLORUTIL_H
+#pragma once
 
 #include <color.h>
 
@@ -19,5 +18,3 @@ void rgb2hex(float r, float g, float b, char *cstring, const char* opacity);
   /* dimension of cstring must be >=7 */
 
 char* hue2rgb(real hue, char *color);
-
-#endif
index 0672d07c825b675312f0e8fb8817579e17cbf3e3..21ee5d55e00f04edd4409ae4038138bd1e1e70f3 100644 (file)
@@ -8,8 +8,7 @@
  * Contributors: Details at https://graphviz.org
  *************************************************************************/
 
-#ifndef GENERAL_H
-#define GENERAL_H
+#pragma once
 
 #include <stdlib.h>
 #include <stdio.h>
@@ -121,8 +120,3 @@ real point_distance(real *p1, real *p2, int dim);
 char *strip_dir(char *s);
 
 void scale_to_box(real xmin, real ymin, real xmax, real ymax, int n, int dim, real *x);
-
-#endif
-
-
-
index b04d75529356790447cf06a4e0f73545f7fc2826..d2b3795b92463b3f91e73c6f246c659d5b2a167e 100644 (file)
@@ -8,8 +8,7 @@
  * Contributors: Details at https://graphviz.org
  *************************************************************************/
 
-#ifndef MG_H
-#define MG_H
+#pragma once
 
 typedef struct Multilevel_MQ_Clustering_struct *Multilevel_MQ_Clustering;
 
@@ -56,5 +55,3 @@ struct Multilevel_MQ_Clustering_struct {
 */
 void mq_clustering(SparseMatrix A, int inplace, int maxcluster, int use_value,
                           int *nclusters, int **assignment, real *mq, int *flag);
-
-#endif
index 4ca1fa3b6531c4492a4d14fbfc173027c829f052..80248b1601e8db3f864c6146711c6abdbf2bea18 100644 (file)
@@ -8,8 +8,8 @@
  * Contributors: Details at https://graphviz.org
  *************************************************************************/
 
-#ifndef VECTOR_H
-#define VECTOR_H
+#pragma once
+
 #include <stdlib.h>
 struct vector_struct {
   int maxlen;
@@ -35,5 +35,3 @@ void* Vector_get(Vector v, int i);
 int Vector_get_length(Vector v);
 
 Vector Vector_reset(Vector v, void *stuff, int i);
-
-#endif