]> wimlib.net Git - wimlib/blobdiff - src/divsufsort.c
mount_image.c: add fallback definitions of RENAME_* constants
[wimlib] / src / divsufsort.c
index 6753695657b6ed09b36925279f3eb03a6f1b6ee5..81a13f976885b28ceb33b1442aa926136e2b1b1e 100644 (file)
@@ -56,9 +56,6 @@
 
 
 /*- Macros -*/
-#define SWAP swap
-#define MIN min
-#define MAX max
 
 #define STACK_PUSH(_a, _b, _c, _d)\
   do {\
@@ -111,7 +108,7 @@ static const int lg_table[256]= {
 
 #if (SS_BLOCKSIZE == 0) || (SS_INSERTIONSORT_THRESHOLD < SS_BLOCKSIZE)
 
-static inline
+static forceinline
 int
 ss_ilg(int n) {
 #if SS_BLOCKSIZE == 0
@@ -154,7 +151,7 @@ static const int sqq_table[256] = {
 247, 248, 248, 249, 249, 250, 250, 251, 251, 252, 252, 253, 253, 254, 254, 255
 };
 
-static inline
+static forceinline
 int
 ss_isqrt(int x) {
   int y, e;
@@ -187,7 +184,7 @@ ss_isqrt(int x) {
 /*---------------------------------------------------------------------------*/
 
 /* Compares two suffixes. */
-static inline
+static forceinline
 int
 ss_compare(const unsigned char *T,
            const int *p1, const int *p2,
@@ -238,7 +235,7 @@ ss_insertionsort(const unsigned char *T, const int *PA,
 
 #if (SS_BLOCKSIZE == 0) || (SS_INSERTIONSORT_THRESHOLD < SS_BLOCKSIZE)
 
-static inline
+static forceinline
 void
 ss_fixdown(const unsigned char *Td, const int *PA,
            int *SA, int i, int size) {
@@ -280,7 +277,7 @@ ss_heapsort(const unsigned char *Td, const int *PA, int *SA, int size) {
 /*---------------------------------------------------------------------------*/
 
 /* Returns the median of three elements. */
-static inline
+static forceinline
 int *
 ss_median3(const unsigned char *Td, const int *PA,
            int *v1, int *v2, int *v3) {
@@ -293,7 +290,7 @@ ss_median3(const unsigned char *Td, const int *PA,
 }
 
 /* Returns the median of five elements. */
-static inline
+static forceinline
 int *
 ss_median5(const unsigned char *Td, const int *PA,
            int *v1, int *v2, int *v3, int *v4, int *v5) {
@@ -307,7 +304,7 @@ ss_median5(const unsigned char *Td, const int *PA,
 }
 
 /* Returns the pivot element. */
-static inline
+static forceinline
 int *
 ss_pivot(const unsigned char *Td, const int *PA, int *first, int *last) {
   int *middle;
@@ -335,7 +332,7 @@ ss_pivot(const unsigned char *Td, const int *PA, int *first, int *last) {
 /*---------------------------------------------------------------------------*/
 
 /* Binary partition for substrings. */
-static inline
+static forceinline
 int *
 ss_partition(const int *PA,
                     int *first, int *last, int depth) {
@@ -496,7 +493,7 @@ ss_mintrosort(const unsigned char *T, const int *PA,
 
 #if SS_BLOCKSIZE != 0
 
-static inline
+static forceinline
 void
 ss_blockswap(int *a, int *b, int n) {
   int t;
@@ -505,7 +502,7 @@ ss_blockswap(int *a, int *b, int n) {
   }
 }
 
-static inline
+static forceinline
 void
 ss_rotate(int *first, int *middle, int *last) {
   int *a, *b, t;
@@ -865,7 +862,7 @@ sssort(const unsigned char *T, const int *PA,
 
 /*---------------------------------------------------------------------------*/
 
-static inline
+static forceinline
 int
 tr_ilg(int n) {
   return (n & 0xffff0000) ?
@@ -900,7 +897,7 @@ tr_insertionsort(const int *ISAd, int *first, int *last) {
 
 /*---------------------------------------------------------------------------*/
 
-static inline
+static forceinline
 void
 tr_fixdown(const int *ISAd, int *SA, int i, int size) {
   int j, k;
@@ -941,7 +938,7 @@ tr_heapsort(const int *ISAd, int *SA, int size) {
 /*---------------------------------------------------------------------------*/
 
 /* Returns the median of three elements. */
-static inline
+static forceinline
 int *
 tr_median3(const int *ISAd, int *v1, int *v2, int *v3) {
   if(ISAd[*v1] > ISAd[*v2]) { SWAP(v1, v2); }
@@ -953,7 +950,7 @@ tr_median3(const int *ISAd, int *v1, int *v2, int *v3) {
 }
 
 /* Returns the median of five elements. */
-static inline
+static forceinline
 int *
 tr_median5(const int *ISAd,
            int *v1, int *v2, int *v3, int *v4, int *v5) {
@@ -967,7 +964,7 @@ tr_median5(const int *ISAd,
 }
 
 /* Returns the pivot element. */
-static inline
+static forceinline
 int *
 tr_pivot(const int *ISAd, int *first, int *last) {
   int *middle;
@@ -1002,14 +999,14 @@ struct _trbudget_t {
   int count;
 };
 
-static inline
+static forceinline
 void
 trbudget_init(trbudget_t *budget, int chance, int incval) {
   budget->chance = chance;
   budget->remain = budget->incval = incval;
 }
 
-static inline
+static forceinline
 int
 trbudget_check(trbudget_t *budget, int size) {
   if(size <= budget->remain) { budget->remain -= size; return 1; }
@@ -1022,7 +1019,7 @@ trbudget_check(trbudget_t *budget, int size) {
 
 /*---------------------------------------------------------------------------*/
 
-static inline
+static forceinline
 void
 tr_partition(const int *ISAd,
              int *first, int *middle, int *last,