From 9850eb8c231b90df499dbc256259e6113586ad2b Mon Sep 17 00:00:00 2001
From: whh8b <whh8b@git.zephyr-software.com>
Date: Mon, 14 Dec 2015 05:19:35 +0000
Subject: [PATCH] Remove m_start from Dollop_t and add operator<<

---
 src/dollop.cpp | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)

diff --git a/src/dollop.cpp b/src/dollop.cpp
index bc24820..63cff18 100644
--- a/src/dollop.cpp
+++ b/src/dollop.cpp
@@ -7,7 +7,6 @@ namespace Zipr_SDK {
 	Dollop_t::Dollop_t(Instruction_t *start)
 	{
 		Instruction_t *loop = NULL;
-		m_start = start;
 		m_size = CalculateWorstCaseSize();
 
 		if (start == NULL)
@@ -22,7 +21,10 @@ namespace Zipr_SDK {
 	size_t Dollop_t::CalculateWorstCaseSize()
 	{
 		size_t dollop_size = 0;
-		Instruction_t *cur_insn = m_start;
+		Instruction_t *cur_insn = NULL;
+		if (front())
+			cur_insn = front()->Instruction();
+
 		while (cur_insn != NULL)
 		{
 			/*
@@ -124,7 +126,7 @@ namespace Zipr_SDK {
 		for (it = d.begin(), it_end = d.end();
 		     it != it_end;
 				 it++) {
-			out << std::hex << (*it)->Instruction() << ",";
+			out << std::hex << *(*it) << std::endl;
 		}
 		return out;
 	}
@@ -133,4 +135,9 @@ namespace Zipr_SDK {
 		out << std::hex << &p << ":" << std::hex << p.Target();
 		return out;
 	}
+	std::ostream &operator<<(std::ostream &out, const DollopEntry_t &p) {
+		out << "Instruction: " << std::hex << p.Instruction() << std::endl;
+		out << "Target Dollop: " << std::hex << p.TargetDollop() << std::endl;
+		return out;
+	}
 }
-- 
GitLab