if_diff/src/idfReport.cxx
//============================================================================
// Report mismatches in attributes for the given symbols.
// Return true if any mismatches found.
//============================================================================
Report mismatches in attributes for the given symbols.
Return true if any mismatches found.
Report mismatches in attributes for the given symbols . Return true if any mismatches found .
static boolean report_attributes(idfAttributeDictionary *attr1,
      	      	      	      	 idfAttributeDictionary *attr2,
      	      	      	         const char *sym_id1, const char *sym_id2,
      	      	      	      	 boolean (*filter)(void *, const char *),
      	      	      	      	 void *filter_object)
{
  if (attr1 == NULL || attr2 == NULL) {
    if (attr1 != NULL) {
      idfIterator iter = attr1->first();
      if (!attr1->done(iter)) {
      	const char *attribute = attr1->index(iter);
      	if (!(filter != NULL && filter(filter_object, attribute))) {
	  genString s;
	  s.printf("%s has \"%s\" attribute, but correspondingly %s does not.",
		   sym_id1, attribute, sym_id2);
	  s.printf("%s and %s differ in whether they have attributes", sym_id1, sym_id2);
	  idf_report(s.str(), difference_note);
	  return true;
      	}
      }
    }
    if (attr2 != NULL) {
      idfIterator iter = attr2->first();
      if (!attr2->done(iter)) {
      	const char *attribute = attr2->index(iter);
      	if (!(filter != NULL && filter(filter_object, attribute))) {
	  genString s;
	  s.printf("%s has \"%s\" attribute, but correspondingly %s does not.",
		   sym_id2, attribute, sym_id1);
	  s.printf("%s and %s differ in whether they have attributes", sym_id1, sym_id2);
	  idf_report(s.str(), difference_note);
	  return true;
	}
      }
    }
  }
  else {
    return report_attributes(*attr1, *attr2, sym_id1, sym_id2, filter, filter_object);
  }
  return false;
}
static boolean report_attributes ( idfAttributeDictionary * attr1 , idfAttributeDictionary * attr2 , const char * sym_id1 , const char * sym_id2 , boolean ( * filter ) ( void * , const char * ) , void * filter_object ) { if ( attr1 == NULL || attr2 == NULL ) { if ( attr1 != NULL ) { idfIterator iter = attr1 -> first ( ) ; if ( ! attr1 -> done ( iter ) ) { const char * attribute = attr1 -> index ( iter ) ; if ( ! ( filter != NULL && filter ( filter_object , attribute ) ) ) { genString s ; s . printf ( " \" \" " , sym_id1 , attribute , sym_id2 ) ; s . printf ( " " , sym_id1 , sym_id2 ) ; idf_report ( s . str ( ) , difference_note ) ; return true ; } } } if ( attr2 != NULL ) { idfIterator iter = attr2 -> first ( ) ; if ( ! attr2 -> done ( iter ) ) { const char * attribute = attr2 -> index ( iter ) ; if ( ! ( filter != NULL && filter ( filter_object , attribute ) ) ) { genString s ; s . printf ( " \" \" " , sym_id2 , attribute , sym_id1 ) ; s . printf ( " " , sym_id1 , sym_id2 ) ; idf_report ( s . str ( ) , difference_note ) ; return true ; } } } } else { return report_attributes ( * attr1 , * attr2 , sym_id1 , sym_id2 , filter , filter_object ) ; } return false ; }
Report mismatches in attributes for the given symbols.
Report mismatches in attributes for the given symbols .