Added check for Unix specific headers and harmonize with Win32 build.
[pazpar2-moved-to-github.git] / src / relevance.c
index 1a9f4d7..86ba9ec 100644 (file)
@@ -17,14 +17,14 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 
 */
 
+#if HAVE_CONFIG_H
+#include <config.h>
+#endif
+
 #include <ctype.h>
 #include <math.h>
 #include <stdlib.h>
 
-#if HAVE_CONFIG_H
-#include <cconfig.h>
-#endif
-
 #include "relevance.h"
 #include "pazpar2.h"
 
@@ -284,31 +284,6 @@ void relevance_donerecord(struct relevance *r, struct record_cluster *cluster)
     r->doc_frequency_vec[0]++;
 }
 
-#ifdef GAGA
-#ifdef FLOAT_REL
-static int comp(const void *p1, const void *p2)
-{
-    float res;
-    struct record **r1 = (struct record **) p1;
-    struct record **r2 = (struct record **) p2;
-    res = (*r2)->relevance - (*r1)->relevance;
-    if (res > 0)
-        return 1;
-    else if (res < 0)
-        return -1;
-    else
-        return 0;
-}
-#else
-static int comp(const void *p1, const void *p2)
-{
-    struct record_cluster **r1 = (struct record_cluster **) p1;
-    struct record_cluster **r2 = (struct record_cluster **) p2;
-    return (*r2)->relevance - (*r1)->relevance;
-}
-#endif
-#endif
-
 // Prepare for a relevance-sorted read
 void relevance_prepare_read(struct relevance *rel, struct reclist *reclist)
 {
@@ -350,9 +325,6 @@ void relevance_prepare_read(struct relevance *rel, struct reclist *reclist)
         }
         rec->relevance = (int) (relevance * 100000);
     }
-#ifdef GAGA
-    qsort(reclist->flatlist, reclist->num_records, sizeof(struct record*), comp);
-#endif
     reclist->pointer = 0;
     xfree(idfvec);
 }