summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBruce Momjian2006-07-10 18:40:16 +0000
committerBruce Momjian2006-07-10 18:40:16 +0000
commit367aa7144f54228725a4bd03b28a7d0adfa1249d (patch)
treecb14427689640b9ca965985cd46cb01fccd7911b
parent43613aad1507e9c531cc7db94c6fb31a613bc4c0 (diff)
Remove a few baby-C macros in fuzzystrmatch. Add a few missing includes.
-rw-r--r--contrib/btree_gist/btree_utils_num.h1
-rw-r--r--contrib/btree_gist/btree_utils_var.h2
-rw-r--r--contrib/dblink/dblink.h2
-rw-r--r--contrib/fuzzystrmatch/fuzzystrmatch.c6
-rw-r--r--contrib/fuzzystrmatch/fuzzystrmatch.h3
5 files changed, 8 insertions, 6 deletions
diff --git a/contrib/btree_gist/btree_utils_num.h b/contrib/btree_gist/btree_utils_num.h
index 322c5759e4..0f59342d96 100644
--- a/contrib/btree_gist/btree_utils_num.h
+++ b/contrib/btree_gist/btree_utils_num.h
@@ -1,3 +1,4 @@
+#include "btree_gist.h"
typedef char GBT_NUMKEY;
diff --git a/contrib/btree_gist/btree_utils_var.h b/contrib/btree_gist/btree_utils_var.h
index 9b7be0de0d..cddfadfab1 100644
--- a/contrib/btree_gist/btree_utils_var.h
+++ b/contrib/btree_gist/btree_utils_var.h
@@ -1,5 +1,7 @@
#include "mb/pg_wchar.h"
+#include "btree_gist.h"
+
/* Variable length key */
typedef bytea GBT_VARKEY;
diff --git a/contrib/dblink/dblink.h b/contrib/dblink/dblink.h
index 80f0c03786..08be777cd4 100644
--- a/contrib/dblink/dblink.h
+++ b/contrib/dblink/dblink.h
@@ -34,6 +34,8 @@
#ifndef DBLINK_H
#define DBLINK_H
+#include "fmgr.h"
+
/*
* External declarations
*/
diff --git a/contrib/fuzzystrmatch/fuzzystrmatch.c b/contrib/fuzzystrmatch/fuzzystrmatch.c
index 376c1107e1..dc3f409e35 100644
--- a/contrib/fuzzystrmatch/fuzzystrmatch.c
+++ b/contrib/fuzzystrmatch/fuzzystrmatch.c
@@ -142,7 +142,7 @@ levenshtein(PG_FUNCTION_ARGS)
* position in the source string, matches the character at the
* current row position in the target string; cost is 1 otherwise.
*/
- c = ((CHAREQ(str_s, str_t)) ? 0 : 1);
+ c = (*str_s != *str_t);
/*
* c1 is upper right cell plus 1
@@ -167,7 +167,7 @@ levenshtein(PG_FUNCTION_ARGS)
/*
* Increment the pointer to str_s
*/
- NextChar(str_s);
+ str_s++;
}
/*
@@ -181,7 +181,7 @@ levenshtein(PG_FUNCTION_ARGS)
/*
* Increment the pointer to str_t
*/
- NextChar(str_t);
+ str_t++;
/*
* Rewind the pointer to str_s
diff --git a/contrib/fuzzystrmatch/fuzzystrmatch.h b/contrib/fuzzystrmatch/fuzzystrmatch.h
index f5df2b5251..28faf4c364 100644
--- a/contrib/fuzzystrmatch/fuzzystrmatch.h
+++ b/contrib/fuzzystrmatch/fuzzystrmatch.h
@@ -81,9 +81,6 @@ static const char *soundex_table = "01230120022455012623010202";
/*
* Levenshtein
*/
-#define STRLEN(p) strlen(p)
-#define CHAREQ(p1, p2) (*(p1) == *(p2))
-#define NextChar(p) ((p)++)
#define MAX_LEVENSHTEIN_STRLEN 255