abc/src/phys/place/place_base.c
// --------------------------------------------------------------------
// cellSortByX...
//
/// \brief Sorts cells by either position coordinate.
//
/// These are for use with qsort().
///
/// Can tolerate pointers to NULL objects.
//
// --------------------------------------------------------------------
cellSortByX
\brief Sorts cells by either position coordinate.

These are for use with qsort().

Can tolerate pointers to NULL objects.
cellSortByX \ brief Sorts cells by either position coordinate . These are for use with qsort () . Can tolerate pointers to NULL objects .
int cellSortByX(const void *a, const void *b) {
  const ConcreteCell *pa = *(const ConcreteCell **)a;
  const ConcreteCell *pb = *(const ConcreteCell **)b;
  if (!pa && !pb) return 0;
  else if (!pa) return -1;
  else if (!pb) return 1;
  if (pa->m_x < pb->m_x) return -1;
  if (pa->m_x > pb->m_x) return 1;
  return 0;
}
int cellSortByX ( const void * a , const void * b ) { const ConcreteCell * pa = * ( const ConcreteCell * * ) a ; const ConcreteCell * pb = * ( const ConcreteCell * * ) b ; if ( ! pa && ! pb ) return 0 ; else if ( ! pa ) return -1 ; else if ( ! pb ) return 1 ; if ( pa -> m_x < pb -> m_x ) return -1 ; if ( pa -> m_x > pb -> m_x ) return 1 ; return 0 ; }
cellSortByX...
\brief Sorts cells by either position coordinate.
cellSortByX ... \ brief Sorts cells by either position coordinate .