From ebb07714e0942b5d46b5cdac1ffe910d1ae5e853 Mon Sep 17 00:00:00 2001
From: Nehal J Wani <nehaljw.kkd1@gmail.com>
Date: Mon, 15 Feb 2021 01:28:25 -0500
Subject: [PATCH 1/7] Rename vpsc/block.h -> vpsc/v_block.h

On case insensitive file systems, block.h conflicts with
/path/to/SDK/usr/include/Block.h
---
 lib/vpsc/Makefile.am    |  2 +-
 lib/vpsc/block.cpp      |  2 +-
 lib/vpsc/block.h        | 71 -----------------------------------------
 lib/vpsc/blocks.cpp     |  2 +-
 lib/vpsc/constraint.h   |  2 +-
 lib/vpsc/solve_VPSC.cpp |  2 +-
 lib/vpsc/v_block.h      | 71 +++++++++++++++++++++++++++++++++++++++++
 lib/vpsc/variable.h     |  2 +-
 8 files changed, 77 insertions(+), 77 deletions(-)
 delete mode 100644 lib/vpsc/block.h
 create mode 100644 lib/vpsc/v_block.h

diff --git a/lib/vpsc/Makefile.am b/lib/vpsc/Makefile.am
index f00b70604..760bbb145 100644
--- a/lib/vpsc/Makefile.am
+++ b/lib/vpsc/Makefile.am
@@ -7,7 +7,7 @@ noinst_LTLIBRARIES = libvpsc_C.la
 endif
 
 noinst_HEADERS = \
-	block.h blocks.h variable.h constraint.h \
+	v_block.h blocks.h variable.h constraint.h \
 	generate-constraints.h \
 	solve_VPSC.h csolve_VPSC.h pairingheap/PairingHeap.h \
 	pairingheap/dsexceptions.h
diff --git a/lib/vpsc/block.cpp b/lib/vpsc/block.cpp
index aabc252db..715ba0019 100644
--- a/lib/vpsc/block.cpp
+++ b/lib/vpsc/block.cpp
@@ -20,7 +20,7 @@
 #include <memory>
 #include <vpsc/pairingheap/PairingHeap.h>
 #include <vpsc/constraint.h>
-#include <vpsc/block.h>
+#include <vpsc/v_block.h>
 #include <vpsc/blocks.h>
 #include <fstream>
 using std::ios;
diff --git a/lib/vpsc/block.h b/lib/vpsc/block.h
deleted file mode 100644
index e15a87758..000000000
--- a/lib/vpsc/block.h
+++ /dev/null
@@ -1,71 +0,0 @@
-/**
- * \brief A block is a group of variables that must be moved together to improve
- * the goal function without violating already active constraints.
- * The variables in a block are spanned by a tree of active constraints.
- *
- * Authors:
- *   Tim Dwyer <tgdwyer@gmail.com>
- *
- * Copyright (C) 2005 Authors
- *
- * This version is released under the CPL (Common Public License) with
- * the Graphviz distribution.
- * A version is also available under the LGPL as part of the Adaptagrams
- * project: https://github.com/mjwybrow/adaptagrams.  
- * If you make improvements or bug fixes to this code it would be much
- * appreciated if you could also contribute those changes back to the
- * Adaptagrams repository.
- */
-
-#pragma once
-
-#include <memory>
-#include <vector>
-#include <iostream>
-#include <vpsc/pairingheap/PairingHeap.h>
-struct Variable;
-struct Constraint;
-
-class Block
-{
-	friend std::ostream& operator <<(std::ostream &os,const Block &b);
-public:
-	std::vector<Variable*> vars;
-	double posn;
-	double weight;
-	double wposn;
-	Block(Variable *v=nullptr);
-	Block(const Block &) = delete;
-	Constraint* findMinLM();
-	Constraint* findMinLMBetween(Variable* lv, Variable* rv);
-	Constraint* findMinInConstraint();
-	Constraint* findMinOutConstraint();
-	void deleteMinInConstraint();
-	void deleteMinOutConstraint();
-	double desiredWeightedPosition();
-	void merge(Block *b, Constraint *c, double dist);
-	void merge(Block *b, Constraint *c);
-	void mergeIn(Block *b);
-	void mergeOut(Block *b);
-	void split(Block *&l, Block *&r, Constraint *c);
-	Constraint* splitBetween(Variable* vl, Variable* vr, Block* &lb, Block* &rb);
-	void setUpInConstraints();
-	void setUpOutConstraints();
-	double cost();
-	bool deleted;
-	long timeStamp;
-	std::unique_ptr<PairingHeap<Constraint*>> in;
-	std::unique_ptr<PairingHeap<Constraint*>> out;
-private:
-	typedef enum {NONE, LEFT, RIGHT} Direction;
-	typedef std::pair<double, Constraint*> Pair;
-	void reset_active_lm(Variable *v, Variable *u);
-	double compute_dfdv(Variable *v, Variable *u, Constraint *&min_lm);
-	Pair compute_dfdv_between(
-			Variable*, Variable*, Variable*, Direction, bool);
-	bool canFollowLeft(Constraint *c, Variable *last);
-	bool canFollowRight(Constraint *c, Variable *last);
-	void populateSplitBlock(Block *b, Variable *v, Variable *u);
-	void addVariable(Variable *v);
-	void setUpConstraintHeap(std::unique_ptr<PairingHeap<Constraint*>> &h,bool in);
-};
diff --git a/lib/vpsc/blocks.cpp b/lib/vpsc/blocks.cpp
index 9ac995620..c9b93de8f 100644
--- a/lib/vpsc/blocks.cpp
+++ b/lib/vpsc/blocks.cpp
@@ -20,7 +20,7 @@
  */
 
 #include <vpsc/blocks.h>
-#include <vpsc/block.h>
+#include <vpsc/v_block.h>
 #include <vpsc/constraint.h>
 #include <fstream>
 using std::ios;
diff --git a/lib/vpsc/constraint.h b/lib/vpsc/constraint.h
index 2d35d6d20..3e383280a 100644
--- a/lib/vpsc/constraint.h
+++ b/lib/vpsc/constraint.h
@@ -38,7 +38,7 @@ public:
 	bool equality;
 };
 #include <float.h>
-#include <vpsc/block.h>
+#include <vpsc/v_block.h>
 static inline bool compareConstraints(Constraint *const &l, Constraint *const &r) {
 	double const sl = 
 		l->left->block->timeStamp > l->timeStamp
diff --git a/lib/vpsc/solve_VPSC.cpp b/lib/vpsc/solve_VPSC.cpp
index c1ea8c3ea..7f204a102 100644
--- a/lib/vpsc/solve_VPSC.cpp
+++ b/lib/vpsc/solve_VPSC.cpp
@@ -18,7 +18,7 @@
 
 #include <cassert>
 #include <vpsc/constraint.h>
-#include <vpsc/block.h>
+#include <vpsc/v_block.h>
 #include <vpsc/blocks.h>
 #include <vpsc/solve_VPSC.h>
 #include <math.h>
diff --git a/lib/vpsc/v_block.h b/lib/vpsc/v_block.h
new file mode 100644
index 000000000..e15a87758
--- /dev/null
+++ b/lib/vpsc/v_block.h
@@ -0,0 +1,71 @@
+/**
+ * \brief A block is a group of variables that must be moved together to improve
+ * the goal function without violating already active constraints.
+ * The variables in a block are spanned by a tree of active constraints.
+ *
+ * Authors:
+ *   Tim Dwyer <tgdwyer@gmail.com>
+ *
+ * Copyright (C) 2005 Authors
+ *
+ * This version is released under the CPL (Common Public License) with
+ * the Graphviz distribution.
+ * A version is also available under the LGPL as part of the Adaptagrams
+ * project: https://github.com/mjwybrow/adaptagrams.  
+ * If you make improvements or bug fixes to this code it would be much
+ * appreciated if you could also contribute those changes back to the
+ * Adaptagrams repository.
+ */
+
+#pragma once
+
+#include <memory>
+#include <vector>
+#include <iostream>
+#include <vpsc/pairingheap/PairingHeap.h>
+struct Variable;
+struct Constraint;
+
+class Block
+{
+	friend std::ostream& operator <<(std::ostream &os,const Block &b);
+public:
+	std::vector<Variable*> vars;
+	double posn;
+	double weight;
+	double wposn;
+	Block(Variable *v=nullptr);
+	Block(const Block &) = delete;
+	Constraint* findMinLM();
+	Constraint* findMinLMBetween(Variable* lv, Variable* rv);
+	Constraint* findMinInConstraint();
+	Constraint* findMinOutConstraint();
+	void deleteMinInConstraint();
+	void deleteMinOutConstraint();
+	double desiredWeightedPosition();
+	void merge(Block *b, Constraint *c, double dist);
+	void merge(Block *b, Constraint *c);
+	void mergeIn(Block *b);
+	void mergeOut(Block *b);
+	void split(Block *&l, Block *&r, Constraint *c);
+	Constraint* splitBetween(Variable* vl, Variable* vr, Block* &lb, Block* &rb);
+	void setUpInConstraints();
+	void setUpOutConstraints();
+	double cost();
+	bool deleted;
+	long timeStamp;
+	std::unique_ptr<PairingHeap<Constraint*>> in;
+	std::unique_ptr<PairingHeap<Constraint*>> out;
+private:
+	typedef enum {NONE, LEFT, RIGHT} Direction;
+	typedef std::pair<double, Constraint*> Pair;
+	void reset_active_lm(Variable *v, Variable *u);
+	double compute_dfdv(Variable *v, Variable *u, Constraint *&min_lm);
+	Pair compute_dfdv_between(
+			Variable*, Variable*, Variable*, Direction, bool);
+	bool canFollowLeft(Constraint *c, Variable *last);
+	bool canFollowRight(Constraint *c, Variable *last);
+	void populateSplitBlock(Block *b, Variable *v, Variable *u);
+	void addVariable(Variable *v);
+	void setUpConstraintHeap(std::unique_ptr<PairingHeap<Constraint*>> &h,bool in);
+};
diff --git a/lib/vpsc/variable.h b/lib/vpsc/variable.h
index bf79de4a9..9a53bc8c1 100644
--- a/lib/vpsc/variable.h
+++ b/lib/vpsc/variable.h
@@ -19,7 +19,7 @@
 #include <iostream>
 class Block;
 struct Constraint;
-#include <vpsc/block.h>
+#include <vpsc/v_block.h>
 
 typedef std::vector<Constraint*> Constraints;
 struct Variable
-- 
2.31.1

