summaryrefslogtreecommitdiffstats
path: root/src/misc/vec/vecInt.h
diff options
context:
space:
mode:
authorAlan Mishchenko <alanmi@berkeley.edu>2005-08-18 08:01:00 -0700
committerAlan Mishchenko <alanmi@berkeley.edu>2005-08-18 08:01:00 -0700
commitdffcc93b8e8779f443762c71098796b01ea7d409 (patch)
tree44113f09a94914013816564bdad846b5939c220a /src/misc/vec/vecInt.h
parent6e496de7ff1a1f9b6f0babc8efb0a13379242505 (diff)
downloadabc-dffcc93b8e8779f443762c71098796b01ea7d409.tar.gz
abc-dffcc93b8e8779f443762c71098796b01ea7d409.tar.bz2
abc-dffcc93b8e8779f443762c71098796b01ea7d409.zip
Version abc50818
Diffstat (limited to 'src/misc/vec/vecInt.h')
-rw-r--r--src/misc/vec/vecInt.h38
1 files changed, 38 insertions, 0 deletions
diff --git a/src/misc/vec/vecInt.h b/src/misc/vec/vecInt.h
index 76fce02e..effebc68 100644
--- a/src/misc/vec/vecInt.h
+++ b/src/misc/vec/vecInt.h
@@ -514,6 +514,44 @@ static inline void Vec_IntSort( Vec_Int_t * p, int fReverse )
(int (*)(const void *, const void *)) Vec_IntSortCompare1 );
}
+
+/**Function*************************************************************
+
+ Synopsis [Comparison procedure for two integers.]
+
+ Description []
+
+ SideEffects []
+
+ SeeAlso []
+
+***********************************************************************/
+static inline int Vec_IntSortCompareUnsigned( unsigned * pp1, unsigned * pp2 )
+{
+ if ( *pp1 < *pp2 )
+ return -1;
+ if ( *pp1 > *pp2 )
+ return 1;
+ return 0;
+}
+
+/**Function*************************************************************
+
+ Synopsis [Sorting the entries by their integer value.]
+
+ Description []
+
+ SideEffects []
+
+ SeeAlso []
+
+***********************************************************************/
+static inline void Vec_IntSortUnsigned( Vec_Int_t * p )
+{
+ qsort( (void *)p->pArray, p->nSize, sizeof(int),
+ (int (*)(const void *, const void *)) Vec_IntSortCompareUnsigned );
+}
+
////////////////////////////////////////////////////////////////////////
/// END OF FILE ///
////////////////////////////////////////////////////////////////////////