From: epetrich Date: Mon, 21 Mar 2005 13:56:44 +0000 (+0000) Subject: * src/SDCCcflow.c (dfNumCompare): committed the wrong version of this X-Git-Url: https://git.gag.com/?a=commitdiff_plain;h=da936d7cf54e4de5fd740cc31634cb9a10e778b9;p=fw%2Fsdcc * src/SDCCcflow.c (dfNumCompare): committed the wrong version of this last time. git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@3704 4a8a32a2-be11-0410-ad9d-d568d2c75423 --- diff --git a/ChangeLog b/ChangeLog index 2eefe5e9..a9c382d0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2005-03-21 Erik Petrich + + * src/SDCCcflow.c (dfNumCompare): committed the wrong version of this + last time. + 2005-03-20 Erik Petrich * src/port.h (struct PORT), diff --git a/src/SDCCcflow.c b/src/SDCCcflow.c index cb6bf7a6..505b2d72 100644 --- a/src/SDCCcflow.c +++ b/src/SDCCcflow.c @@ -357,6 +357,24 @@ markNoPath (ebbIndex * ebbi) ebbs[i]->noPath = 1; } +/*-----------------------------------------------------------------*/ +/* dfNumCompare - used by qsort to sort by dfNumber */ +/*-----------------------------------------------------------------*/ +int +dfNumCompare (const void *a, const void *b) +{ + const eBBlock *const *i = a; + const eBBlock *const *j = b; + + if ((*i)->dfnum > (*j)->dfnum) + return 1; + + if ((*i)->dfnum < (*j)->dfnum) + return -1; + + return 0; +} + /*-----------------------------------------------------------------*/ /* computeControlFlow - does the control flow computation */ /*-----------------------------------------------------------------*/