stage3/datatype_functions.cc
changeset 603 a45a62dd6df9
parent 556 af3e378e98f9
child 606 d2122a32ec86
equal deleted inserted replaced
602:456add88d64c 603:a45a62dd6df9
   407 			return i;
   407 			return i;
   408 	/* Not found ! */
   408 	/* Not found ! */
   409 	return -1;
   409 	return -1;
   410 }
   410 }
   411 
   411 
   412 
   412 /* Remove a datatype inside a candidate_datatypes list.
   413 
   413  * Returns: If successful it returns true, false otherwise.
   414 
   414  */
       
   415 bool remove_from_candidate_datatype_list(symbol_c *datatype, std::vector <symbol_c *> &candidate_datatypes) {
       
   416 	unsigned int ofs;
       
   417 	if (NULL == datatype)
       
   418 		return false;
       
   419 	for(ofs = 0; ofs < candidate_datatypes.size(); ofs++)
       
   420 		if (is_type_equal(datatype, candidate_datatypes[ofs]))
       
   421 			break;
       
   422 	if (ofs <  candidate_datatypes.size()) {
       
   423 		candidate_datatypes.erase(candidate_datatypes.begin() + ofs);
       
   424 		return true;
       
   425 	}
       
   426 	return false;
       
   427 }
   415 
   428 
   416 
   429 
   417 
   430 
   418 /* Intersect two candidate_datatype_lists.
   431 /* Intersect two candidate_datatype_lists.
   419  * Remove from list1 (origin, dest.) all elements that are not found in list2 (with).
   432  * Remove from list1 (origin, dest.) all elements that are not found in list2 (with).