stage3/datatype_functions.cc
changeset 603 a45a62dd6df9
parent 556 af3e378e98f9
child 606 d2122a32ec86
--- a/stage3/datatype_functions.cc	Tue Jun 19 18:55:43 2012 +0100
+++ b/stage3/datatype_functions.cc	Sat Jul 14 11:09:26 2012 +0200
@@ -409,9 +409,22 @@
 	return -1;
 }
 
-
-
-
+/* Remove a datatype inside a candidate_datatypes list.
+ * Returns: If successful it returns true, false otherwise.
+ */
+bool remove_from_candidate_datatype_list(symbol_c *datatype, std::vector <symbol_c *> &candidate_datatypes) {
+	unsigned int ofs;
+	if (NULL == datatype)
+		return false;
+	for(ofs = 0; ofs < candidate_datatypes.size(); ofs++)
+		if (is_type_equal(datatype, candidate_datatypes[ofs]))
+			break;
+	if (ofs <  candidate_datatypes.size()) {
+		candidate_datatypes.erase(candidate_datatypes.begin() + ofs);
+		return true;
+	}
+	return false;
+}