Fix compiler warnings
[smlar.git] / smlar_gin.c
index f43c9a5..4164fa4 100644 (file)
@@ -5,7 +5,11 @@
 #include "fmgr.h"
 #include "access/gin.h"
 #include "access/skey.h"
 #include "fmgr.h"
 #include "access/gin.h"
 #include "access/skey.h"
+#if PG_VERSION_NUM < 130000
 #include "access/tuptoaster.h"
 #include "access/tuptoaster.h"
+#else
+#include "access/heaptoast.h"
+#endif
 
 PG_FUNCTION_INFO_V1(smlararrayextract);
 Datum smlararrayextract(PG_FUNCTION_ARGS);
 
 PG_FUNCTION_INFO_V1(smlararrayextract);
 Datum smlararrayextract(PG_FUNCTION_ARGS);
@@ -13,7 +17,7 @@ Datum
 smlararrayextract(PG_FUNCTION_ARGS)
 {
        ArrayType       *array;
 smlararrayextract(PG_FUNCTION_ARGS)
 {
        ArrayType       *array;
-       int32      *nentries = (int32 *) PG_GETARG_POINTER(1);
+       int32           *nentries = (int32 *) PG_GETARG_POINTER(1);
        SimpleArray     *sa;
 
        /*
        SimpleArray     *sa;
 
        /*
@@ -30,7 +34,7 @@ smlararrayextract(PG_FUNCTION_ARGS)
 
        if (sa->nelems == 0 && PG_NARGS() == 3)
        {
 
        if (sa->nelems == 0 && PG_NARGS() == 3)
        {
-               switch (PG_GETARG_UINT16(2))    /* StrategyNumber */
+               switch (PG_GETARG_UINT16(2))    /* StrategyNumber */
                {
                        case    SmlarOverlapStrategy:
                        case    SmlarSimilarityStrategy:
                {
                        case    SmlarOverlapStrategy:
                        case    SmlarSimilarityStrategy:
@@ -60,13 +64,13 @@ Datum smlararrayconsistent(PG_FUNCTION_ARGS);
 Datum
 smlararrayconsistent(PG_FUNCTION_ARGS)
 {
 Datum
 smlararrayconsistent(PG_FUNCTION_ARGS)
 {
-       bool                    *check = (bool *) PG_GETARG_POINTER(0);
-       StrategyNumber  strategy = PG_GETARG_UINT16(1);
+       bool                    *check = (bool *) PG_GETARG_POINTER(0);
+       StrategyNumber  strategy = PG_GETARG_UINT16(1);
        SimpleArray             *sa;
        bool                    res = false;
        int                             i,
                                        cnt = 0;
        SimpleArray             *sa;
        bool                    res = false;
        int                             i,
                                        cnt = 0;
-       bool                    *recheck = (bool *) PG_GETARG_POINTER(5);
+       bool                    *recheck = (bool *) PG_GETARG_POINTER(5);
 
        *recheck = true;
 
 
        *recheck = true;
 
@@ -93,9 +97,9 @@ smlararrayconsistent(PG_FUNCTION_ARGS)
 
                        switch(getSmlType())
                        {
 
                        switch(getSmlType())
                        {
-                               case    ST_TFIDF:
+                               case ST_TFIDF:
                                                {
                                                {
-                                                       double  weight = 0.0, /* exact weight of union */
+                                                       double  weight = 0.0, /* exact weight of union */
                                                                        saSum = 0.0,  /* exact length of query */
                                                                        siSum = 0.0;  /* lower limit of length of indexed value */ 
 
                                                                        saSum = 0.0,  /* exact length of query */
                                                                        siSum = 0.0;  /* lower limit of length of indexed value */ 
 
@@ -122,7 +126,7 @@ smlararrayconsistent(PG_FUNCTION_ARGS)
                                                                res = true;
                                                }
                                                break;
                                                                res = true;
                                                }
                                                break;
-                               case    ST_COSINE:
+                               case ST_COSINE:
                                                {
                                                        double                  power;
 
                                                {
                                                        double                  power;
 
@@ -132,7 +136,7 @@ smlararrayconsistent(PG_FUNCTION_ARGS)
                                                                res = true;
                                                }
                                                break;
                                                                res = true;
                                                }
                                                break;
-                               case    ST_OVERLAP:
+                               case ST_OVERLAP:
                                                if (cnt >= GetSmlarLimit())
                                                        res = true;
                                                break;
                                                if (cnt >= GetSmlarLimit())
                                                        res = true;
                                                break;