contrib/gdb-7/gdb/linespec.c
static void
filter_results (struct linespec_state *self,
		struct symtabs_and_lines *result,
		VEC (const_char_ptr) *filters)
{
  int i;
  const char *name;

  for (i = 0; VEC_iterate (const_char_ptr, filters, i, name); ++i)
    {
      struct linespec_sals lsal;
      int j;

      memset (&lsal, 0, sizeof (lsal));

      for (j = 0; j < result->nelts; ++j)
	{
	  if (strcmp (name, self->canonical_names[j]) == 0)
	    add_sal_to_sals_basic (&lsal.sals, &result->sals[j]);
	}

      if (lsal.sals.nelts > 0)
	{
	  lsal.canonical = xstrdup (name);
	  VEC_safe_push (linespec_sals, self->canonical->sals, &lsal);
	}
    }

  self->canonical->pre_expanded = 0;
}
/* Given FILTERS, a list of canonical names, filter the sals in RESULT
   and store the result in SELF->CANONICAL.  */
Given FILTERS, a list of canonical names, filter the sals in RESULT
and store the result in SELF->CANONICAL.
Given FILTERS a list of canonical names filter the sals in RESULT and store the result in SELF - > CANONICAL .
static void
filter_results (struct linespec_state *self,
		struct symtabs_and_lines *result,
		VEC (const_char_ptr) *filters)
{
  int i;
  const char *name;
  for (i = 0; VEC_iterate (const_char_ptr, filters, i, name); ++i)
    {
      struct linespec_sals lsal;
      int j;
      memset (&lsal, 0, sizeof (lsal));
      for (j = 0; j < result->nelts; ++j)
	{
	  if (strcmp (name, self->canonical_names[j]) == 0)
	    add_sal_to_sals_basic (&lsal.sals, &result->sals[j]);
	}
      if (lsal.sals.nelts > 0)
	{
	  lsal.canonical = xstrdup (name);
	  VEC_safe_push (linespec_sals, self->canonical->sals, &lsal);
	}
    }
  self->canonical->pre_expanded = 0;
}
static void filter_results ( struct linespec_state * self , struct symtabs_and_lines * result , VEC ( const_char_ptr ) * filters ) { int i ; const char * name ; for ( i = 0 ; VEC_iterate ( const_char_ptr , filters , i , name ) ; ++ i ) { struct linespec_sals lsal ; int j ; memset ( & lsal , 0 , sizeof ( lsal ) ) ; for ( j = 0 ; j < result -> nelts ; ++ j ) { if ( strcmp ( name , self -> canonical_names [ j ] ) == 0 ) add_sal_to_sals_basic ( & lsal . sals , & result -> sals [ j ] ) ; } if ( lsal . sals . nelts > 0 ) { lsal . canonical = xstrdup ( name ) ; VEC_safe_push ( linespec_sals , self -> canonical -> sals , & lsal ) ; } } self -> canonical -> pre_expanded = 0 ; }
Given FILTERS, a list of canonical names, filter the sals in RESULT
and store the result in SELF->CANONICAL.
Given FILTERS a list of canonical names filter the sals in RESULT and store the result in SELF - > CANONICAL .