if_diff/src/idfLocation.cxx
//============================================================================
// If l1 has a end_line == 0 and it can be compared in numeric position
// to l2 which has a non-zero end_line, then return true and set order
// to compare to 0 as the end of l1 compares to the end of l2.
//
// Note that l1.start_line must be nonzero, or else l1 is not line/col oriented.
// Note that l1.end_column must be > 0 to indicate that an end is present.
//============================================================================
If l1 has a end_line == 0 and it can be compared in numeric position
to l2 which has a non-zero end_line, then return true and set order
to compare to 0 as the end of l1 compares to the end of l2.

Note that l1.start_line must be nonzero, or else l1 is not line/col oriented.
Note that l1.end_column must be > 0 to indicate that an end is present.
If l1 has a end_line == 0 and it can be compared in numeric position to l2 which has a non - zero end_line then return true and set order to compare to 0 as the end of l1 compares to the end of l2 . Note that l1 . start_line must be nonzero or else l1 is not line / col oriented . Note that l1 . end_column must be > 0 to indicate that an end is present .
boolean idf_compare_zero_end_line(const locationStruct &l1, const locationStruct &l2, int &order)
{
  if (l1.end_line == 0 && l2.end_line != 0 && l1.start_line != 0 && l1.end_column > 0) {
    order = 0;
    if (l1.start_line != l2.end_line) {
      order = (l1.start_line < l2.end_line ? -1 : 1);
    }
    int end1_column = l1.start_column + l1.end_column - 1;
    if (end1_column != l2.end_column) {
      order = (end1_column < l2.end_column ? -1 : 1);
    }
    return true;
  }
  else {
    return false;
  }
}
boolean idf_compare_zero_end_line ( const locationStruct & l1 , const locationStruct & l2 , int & order ) { if ( l1 . end_line == 0 && l2 . end_line != 0 && l1 . start_line != 0 && l1 . end_column > 0 ) { order = 0 ; if ( l1 . start_line != l2 . end_line ) { order = ( l1 . start_line < l2 . end_line ? -1 : 1 ) ; } int end1_column = l1 . start_column + l1 . end_column - 1 ; if ( end1_column != l2 . end_column ) { order = ( end1_column < l2 . end_column ? -1 : 1 ) ; } return true ; } else { return false ; } }
If l1 has a end_line == 0 and it can be compared in numeric position
to l2 which has a non-zero end_line, then return true and set order
to compare to 0 as the end of l1 compares to the end of l2.
If l1 has a end_line == 0 and it can be compared in numeric position to l2 which has a non - zero end_line then return true and set order to compare to 0 as the end of l1 compares to the end of l2 .