Add gcov option.

This commit is contained in:
QC 2014-08-29 00:01:36 +02:00
parent 92f518cdf8
commit 5b017b017b
2 changed files with 11 additions and 2 deletions

View file

@ -24,6 +24,15 @@ AC_USE_SYSTEM_EXTENSIONS
AC_CHECK_HEADERS([i3/ipc.h],
[i3_header=yes; break;])
dnl ---------------------------------------------------------------------
dnl Enable source code coverage reporting for GCC
dnl ---------------------------------------------------------------------
AC_ARG_ENABLE(gcov,
[ --enable-gcov Enable source code coverage testing using gcov],
[CFLAGS="$CFLAGS -fprofile-arcs -ftest-coverage"])
##
# Check dependencies
##

View file

@ -113,7 +113,7 @@ static void delete_ssh ( const char *cmd )
history_remove ( path, cmd );
g_free ( path );
}
static int sort_func ( const void *a, const void *b )
static int ssh_sort_func ( const void *a, const void *b )
{
const char *astr = *( const char * const * ) a;
const char *bstr = *( const char * const * ) b;
@ -190,7 +190,7 @@ static char ** get_ssh ( unsigned int *length )
// TODO: check this is still fast enough. (takes 1ms on laptop.)
if ( ( *length ) > num_favorites ) {
qsort ( &retv[num_favorites], ( *length ) - num_favorites, sizeof ( char* ), sort_func );
qsort ( &retv[num_favorites], ( *length ) - num_favorites, sizeof ( char* ), ssh_sort_func );
}
g_free ( path );
#ifdef TIMING