コード例 #1
0
ファイル: MachODebugMapParser.cpp プロジェクト: JaredCJR/llvm
static bool shouldLinkArch(SmallVectorImpl<StringRef> &Archs, StringRef Arch) {
  if (Archs.empty() || is_contained(Archs, "all") || is_contained(Archs, "*"))
    return true;

  if (Arch.startswith("arm") && Arch != "arm64" && is_contained(Archs, "arm"))
    return true;

  SmallString<16> ArchName = Arch;
  if (Arch.startswith("thumb"))
    ArchName = ("arm" + Arch.substr(5)).str();

  return is_contained(Archs, ArchName);
}
コード例 #2
0
ファイル: fancy_set.C プロジェクト: SALAM2016/orbiter
void fancy_set::delete_element(INT elt)
{
	if (is_contained(elt)) {
		swap(k - 1, elt);
		k--;
		}
}
コード例 #3
0
ファイル: fancy_set.C プロジェクト: SALAM2016/orbiter
void fancy_set::add_element(INT elt)
{
	if (!is_contained(elt)) {
		swap(k, elt);
		k++;
		}
}
コード例 #4
0
ファイル: grid_2d.hpp プロジェクト: brandon-kohn/geometrix
        data_type& get_cell(const Point& point)
        {
			BOOST_CONCEPT_ASSERT(( Point2DConcept<Point> ));
			GEOMETRIX_ASSERT( is_contained( point ) );
            boost::uint32_t i = m_gridTraits.get_x_index(get<0>(point));
            boost::uint32_t j = m_gridTraits.get_y_index(get<1>(point));
            return get_cell(i,j);
        }
コード例 #5
0
ファイル: fancy_set.C プロジェクト: SALAM2016/orbiter
void fancy_set::delete_elements(INT *elts, INT nb)
{
	INT i;
	
	for (i = 0; i < nb; i++) {
		if (is_contained(elts[i])) {
			swap(k - 1, elts[i]);
			k--;
			}
		}
}
コード例 #6
0
ファイル: fancy_set.C プロジェクト: SALAM2016/orbiter
void fancy_set::intersect_with(INT *elts, INT nb)
{
	INT i, l;
	
	l = 0;
	for (i = 0; i < nb; i++) {
		if (is_contained(elts[i])) {
			swap(l, elts[i]);
			l++;
			}
		}
	k = l;
}
コード例 #7
0
ファイル: fancy_set.C プロジェクト: SALAM2016/orbiter
void fancy_set::select_subset(INT *elts, INT nb)
{
	INT i;
	
	for (i = 0; i < nb; i++) {
		if (!is_contained(elts[i])) {
			cout << "fancy_set::select_subset  element is not contained" << endl;
			exit(1);
			}
		swap(i, elts[i]);
		}
	k = nb;
}
コード例 #8
0
ファイル: button.cpp プロジェクト: sundoom/sunstudio
// -----------------------------------------------------------------------
// find window from screen coordinates
// -----------------------------------------------------------------------
t_window* t_button::get_child( t_screen_point point, bool ignore_visibility ) // find window from client coordinates
{
	if (!is_visible() && !ignore_visibility)
		return 0;
	if (!is_contained( point ))
		return 0;

	t_window_list::const_reverse_iterator it;
	t_window*      result;
	t_screen_point screen_point = to_screen( point );

	// Since we passed the "is_contained" test, we're pretty sure we'll find
	// something.  That being the case, we're willing to spend the time to check
	// for a visible hit first, then fallback to a hit on an invisible child.
	// If we needed to speed things up we could just do the "ignore" test right
	// off and put up with possibility of getting an invisible child when a visible
	// one was available.
	for (it = get_children_rbegin(); it != get_children_rend(); it++)
	{
		result = (*it)->get_child( (*it)->to_client( screen_point ), false );
		if (result != 0)
			return result;
	}
	// Now look for an invisible hit
	for (it = get_children_rbegin(); it != get_children_rend(); it++)
	{
		result = (*it)->get_child( (*it)->to_client( screen_point ), true );
		if (result != 0)
			return result;
	}

	// I'm not sure we'll ever get here given the way is_contained is implemented
	// and the fact that we checked that first off, but just in case...
	if (m_has_transparency == k_completely_transparent)
		return 0;
	return this;
}
コード例 #9
0
ファイル: fancy_set.C プロジェクト: SALAM2016/orbiter
void fancy_set::subtract_set(fancy_set *set_to_subtract)
{
	INT i, a;
	
	if (k < set_to_subtract->k) {
		for (i = 0; i < k; i++) {
			a = set[i];
			if (set_to_subtract->is_contained(a)) {
				swap(k - 1, a);
				k--;
				i--; // do the current position one more time
				}
			}
		}
	else {
		for (i = 0; i < set_to_subtract->k; i++) {
			a = set_to_subtract->set[i];
			if (is_contained(a)) {
				swap(k - 1, a);
				k--;
				}
			}
		}
}