]> granicus.if.org Git - graphviz/commitdiff
use #pragma once guards in VPSC
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Sat, 21 Nov 2020 01:09:52 +0000 (17:09 -0800)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Sat, 23 Jan 2021 18:29:33 +0000 (10:29 -0800)
These are supported by all recent compilers and are less error prone than old
style header guards.

lib/vpsc/block.h
lib/vpsc/blocks.h
lib/vpsc/constraint.h
lib/vpsc/csolve_VPSC.h
lib/vpsc/generate-constraints.h
lib/vpsc/pairingheap/dsexceptions.h
lib/vpsc/remove_rectangle_overlap.h
lib/vpsc/solve_VPSC.h
lib/vpsc/variable.h

index 79bfeae41f812f6e9dec597345c1d70ff38914e4..b0ab83260ba5a2c3c5242f599aba21edf5912218 100644 (file)
@@ -19,8 +19,7 @@
  * Adaptagrams repository.
  */
 
-#ifndef SEEN_REMOVEOVERLAP_BLOCK_H
-#define SEEN_REMOVEOVERLAP_BLOCK_H
+#pragma once
 
 #include <vector>
 #include <iostream>
@@ -71,5 +70,3 @@ private:
        void addVariable(Variable *v);
        void setUpConstraintHeap(PairingHeap<Constraint*>* &h,bool in);
 };
-
-#endif // SEEN_REMOVEOVERLAP_BLOCK_H
index abb681f0e85bac7221a8656f09797b621b84df02..92864fa9fcaf46a66b04298178149f0687d3ad11 100644 (file)
@@ -21,8 +21,7 @@
  * Adaptagrams repository.
  */
 
-#ifndef SEEN_REMOVEOVERLAP_BLOCKS_H
-#define SEEN_REMOVEOVERLAP_BLOCKS_H
+#pragma once
 
 #define LOGFILE "cRectangleOverlap.log"
 
@@ -56,4 +55,3 @@ private:
 };
 
 extern long blockTimeCtr;
-#endif // SEEN_REMOVEOVERLAP_BLOCKS_H
index 20288259df6c9cf123ac480244aa40c907a25f29..416160076e59f6b7963c528021b1c2a8c74bd078 100644 (file)
@@ -18,8 +18,7 @@
  * Adaptagrams repository.
  */
 
-#ifndef SEEN_REMOVEOVERLAP_CONSTRAINT_H
-#define SEEN_REMOVEOVERLAP_CONSTRAINT_H
+#pragma once
 
 #include <iostream>
 #include <vpsc/variable.h>
@@ -62,5 +61,3 @@ static inline bool compareConstraints(Constraint *const &l, Constraint *const &r
        }
        return sl < sr;
 }
-
-#endif // SEEN_REMOVEOVERLAP_CONSTRAINT_H
index 366ac938fa246289ee0f4b8cbfac9732a015152e..b8e6ab8496c115ef68a15114b73ddf0e2651138f 100644 (file)
@@ -16,8 +16,7 @@
  * appreciated if you could also contribute those changes back to the
  * Adaptagrams repository.
  */
-#ifndef _CSOLVE_VPSC_H_
-#define _CSOLVE_VPSC_H_
+#pragma once
 #ifdef __cplusplus
 extern "C" {
 #endif
@@ -75,4 +74,3 @@ int getSplitCnt(IncVPSC *vpsc);
 #ifdef __cplusplus
 }
 #endif
-#endif /* _CSOLVE_VPSC_H_ */
index 30b95c4ee67a7baaf032ac73570f759bb29b8d85..c0750d22f4cd1ec72d24f01d6fe93cf8320ef2ac 100644 (file)
@@ -17,8 +17,7 @@
  * appreciated if you could also contribute those changes back to the
  * Adaptagrams repository.
  */
-#ifndef SEEN_REMOVEOVERLAP_GENERATE_CONSTRAINTS_H
-#define SEEN_REMOVEOVERLAP_GENERATE_CONSTRAINTS_H
+#pragma once
 #include <iostream>
 
 class Rectangle {      
@@ -81,6 +80,3 @@ class Constraint;
 // returns number of constraints generated
 int generateXConstraints(const int n, Rectangle** rs, Variable** vars, Constraint** &cs, const bool useNeighbourLists);
 int generateYConstraints(const int n, Rectangle** rs, Variable** vars, Constraint** &cs);
-
-
-#endif // SEEN_REMOVEOVERLAP_GENERATE_CONSTRAINTS_H
index 9119f0c3b0ce6102c1da54055f134309fbfbfa20..17ea73fb5831c425ae60d06f22b1444c5a563680 100644 (file)
@@ -1,8 +1,5 @@
 /* vim:set shiftwidth=4 ts=8: */
 
-#ifndef DSEXCEPTIONS_H_
-#define DSEXCEPTIONS_H_
+#pragma once
 
 class Underflow { };
-
-#endif
index 4ffc233300ba598f4769b57169b529e7aae1c8d8..2990b1017dcb3feebbbed35ec2b2fc0984b46953 100644 (file)
  * appreciated if you could also contribute those changes back to the
  * Adaptagrams repository.
  */
-#ifndef REMOVE_RECTANGLE_OVERLAP_H_SEEN
-#define REMOVE_RECTANGLE_OVERLAP_H_SEEN
+#pragma once
 
 class Rectangle;
 
 void removeRectangleOverlap(Rectangle *rs[], int n, double xBorder, double yBorder);
-
-
-#endif /* !REMOVE_RECTANGLE_OVERLAP_H_SEEN */
index 0344e8d681b2e8a69b8dc0f3a25427cc988ee25d..13d909697abd4559778bdbd1cc2a60c995b6565f 100644 (file)
@@ -17,8 +17,7 @@
  * appreciated if you could also contribute those changes back to the
  * Adaptagrams repository.
  */
-#ifndef SEEN_REMOVEOVERLAP_SOLVE_VPSC_H
-#define SEEN_REMOVEOVERLAP_SOLVE_VPSC_H
+#pragma once
 
 #include <vector>
 class Variable;
@@ -59,4 +58,3 @@ private:
        ConstraintList inactive;
        double mostViolated(ConstraintList &l,Constraint* &v);
 };
-#endif // SEEN_REMOVEOVERLAP_SOLVE_VPSC_H
index 7bd44d2b398e5e27972f6acb50e595f5bcc11944..675d87326658decf7a6ad6bf0cf643f5acb8ec76 100644 (file)
@@ -15,8 +15,7 @@
  * appreciated if you could also contribute those changes back to the
  * Adaptagrams repository.
  */
-#ifndef SEEN_REMOVEOVERLAP_VARIABLE_H
-#define SEEN_REMOVEOVERLAP_VARIABLE_H
+#pragma once
 
 #include <vector>
 #include <iostream>
@@ -50,4 +49,3 @@ public:
                return block->posn+offset;
        }
 };
-#endif // SEEN_REMOVEOVERLAP_VARIABLE_H