contrib/gdb-7/gdb/linespec.c
static int
compare_symbols (const void *a, const void *b)
{
  struct symbol * const *sa = a;
  struct symbol * const *sb = b;
  uintptr_t uia, uib;

  uia = (uintptr_t) SYMTAB_PSPACE (SYMBOL_SYMTAB (*sa));
  uib = (uintptr_t) SYMTAB_PSPACE (SYMBOL_SYMTAB (*sb));

  if (uia < uib)
    return -1;
  if (uia > uib)
    return 1;

  uia = (uintptr_t) *sa;
  uib = (uintptr_t) *sb;

  if (uia < uib)
    return -1;
  if (uia > uib)
    return 1;

  return 0;
}
/* A qsort comparison function for symbols.  The resulting order does
   not actually matter; we just need to be able to sort them so that
   symbols with the same program space end up next to each other.  */
A qsort comparison function for symbols.  The resulting order does
not actually matter; we just need to be able to sort them so that
symbols with the same program space end up next to each other.
A qsort comparison function for symbols . The resulting order does not actually matter ; we just need to be able to sort them so that symbols with the same program space end up next to each other .
static int
compare_symbols (const void *a, const void *b)
{
  struct symbol * const *sa = a;
  struct symbol * const *sb = b;
  uintptr_t uia, uib;
  uia = (uintptr_t) SYMTAB_PSPACE (SYMBOL_SYMTAB (*sa));
  uib = (uintptr_t) SYMTAB_PSPACE (SYMBOL_SYMTAB (*sb));
  if (uia < uib)
    return -1;
  if (uia > uib)
    return 1;
  uia = (uintptr_t) *sa;
  uib = (uintptr_t) *sb;
  if (uia < uib)
    return -1;
  if (uia > uib)
    return 1;
  return 0;
}
static int compare_symbols ( const void * a , const void * b ) { struct symbol * const * sa = a ; struct symbol * const * sb = b ; uintptr_t uia , uib ; uia = ( uintptr_t ) SYMTAB_PSPACE ( SYMBOL_SYMTAB ( * sa ) ) ; uib = ( uintptr_t ) SYMTAB_PSPACE ( SYMBOL_SYMTAB ( * sb ) ) ; if ( uia < uib ) return -1 ; if ( uia > uib ) return 1 ; uia = ( uintptr_t ) * sa ; uib = ( uintptr_t ) * sb ; if ( uia < uib ) return -1 ; if ( uia > uib ) return 1 ; return 0 ; }
A qsort comparison function for symbols.
A qsort comparison function for symbols .