From 3c6f886d5a8bfd36c796b963d6e3178ad9577742 Mon Sep 17 00:00:00 2001 From: manuel Date: Wed, 13 May 2009 16:55:17 +0200 Subject: * added documentation (no more TODOs) * added testsuite + testcase * used copyctor instead of assign operator more often --- ue3/mycpu/cprogram.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'ue3/mycpu/cprogram.cpp') diff --git a/ue3/mycpu/cprogram.cpp b/ue3/mycpu/cprogram.cpp index f904bce..1a450f5 100644 --- a/ue3/mycpu/cprogram.cpp +++ b/ue3/mycpu/cprogram.cpp @@ -1,7 +1,7 @@ /** * @module cprogram * @author Guenther Neuwirth (0626638), Manuel Mausz (0728348) - * @brief TODO + * @brief CProgram extends std::vector and adds a method for parsing programfile * @date 12.05.2009 */ @@ -75,7 +75,7 @@ void CProgram::compile(std::istream& in) /* get instruction name */ size_t pos = line.find_first_of(' '); - string instrname = line.substr(0, pos); + string instrname(line.substr(0, pos)); /* search and create instruction */ CInstruction *instrptr = NULL; @@ -112,7 +112,7 @@ void CProgram::compile(std::istream& in) { if (instrparams.size() != 1) throw runtime_error("Invalid paramater count - must be 1"); - string label = instrparams.front(); + string label(instrparams.front()); if (label.length() < 2 || label[ label.length() - 1] != ':') throw runtime_error("Label has invalid syntax"); m_labels[ label.substr(0, label.length() - 1) ] = size(); -- cgit v1.2.3