Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit b538215

Browse files
committed
Remove a few baby-C macros in fuzzystrmatch. Add a few missing includes.
1 parent d399f1b commit b538215

File tree

5 files changed

+11
-9
lines changed

5 files changed

+11
-9
lines changed

contrib/btree_gist/btree_utils_num.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#include "btree_gist.h"
12

23
typedef char GBT_NUMKEY;
34

contrib/btree_gist/btree_utils_var.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
#include "mb/pg_wchar.h"
22

3+
#include "btree_gist.h"
4+
35
/* Variable length key */
46
typedef bytea GBT_VARKEY;
57

contrib/dblink/dblink.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
* Darko Prenosil <Darko.Prenosil@finteh.hr>
99
* Shridhar Daithankar <shridhar_daithankar@persistent.co.in>
1010
*
11-
* $PostgreSQL: pgsql/contrib/dblink/dblink.h,v 1.15 2006/03/11 04:38:29 momjian Exp $
11+
* $PostgreSQL: pgsql/contrib/dblink/dblink.h,v 1.16 2006/07/10 18:40:16 momjian Exp $
1212
* Copyright (c) 2001-2006, PostgreSQL Global Development Group
1313
* ALL RIGHTS RESERVED;
1414
*
@@ -34,6 +34,8 @@
3434
#ifndef DBLINK_H
3535
#define DBLINK_H
3636

37+
#include "fmgr.h"
38+
3739
/*
3840
* External declarations
3941
*/

contrib/fuzzystrmatch/fuzzystrmatch.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
*
66
* Joe Conway <mail@joeconway.com>
77
*
8-
* $PostgreSQL: pgsql/contrib/fuzzystrmatch/fuzzystrmatch.c,v 1.21 2006/05/30 22:12:13 tgl Exp $
8+
* $PostgreSQL: pgsql/contrib/fuzzystrmatch/fuzzystrmatch.c,v 1.22 2006/07/10 18:40:16 momjian Exp $
99
* Copyright (c) 2001-2006, PostgreSQL Global Development Group
1010
* ALL RIGHTS RESERVED;
1111
*
@@ -142,7 +142,7 @@ levenshtein(PG_FUNCTION_ARGS)
142142
* position in the source string, matches the character at the
143143
* current row position in the target string; cost is 1 otherwise.
144144
*/
145-
c = ((CHAREQ(str_s, str_t)) ? 0 : 1);
145+
c = (*str_s != *str_t);
146146

147147
/*
148148
* c1 is upper right cell plus 1
@@ -167,7 +167,7 @@ levenshtein(PG_FUNCTION_ARGS)
167167
/*
168168
* Increment the pointer to str_s
169169
*/
170-
NextChar(str_s);
170+
str_s++;
171171
}
172172

173173
/*
@@ -181,7 +181,7 @@ levenshtein(PG_FUNCTION_ARGS)
181181
/*
182182
* Increment the pointer to str_t
183183
*/
184-
NextChar(str_t);
184+
str_t++;
185185

186186
/*
187187
* Rewind the pointer to str_s

contrib/fuzzystrmatch/fuzzystrmatch.h

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
*
66
* Joe Conway <mail@joeconway.com>
77
*
8-
* $PostgreSQL: pgsql/contrib/fuzzystrmatch/fuzzystrmatch.h,v 1.13 2006/03/11 04:38:29 momjian Exp $
8+
* $PostgreSQL: pgsql/contrib/fuzzystrmatch/fuzzystrmatch.h,v 1.14 2006/07/10 18:40:16 momjian Exp $
99
* Copyright (c) 2001-2006, PostgreSQL Global Development Group
1010
* ALL RIGHTS RESERVED;
1111
*
@@ -81,9 +81,6 @@ static const char *soundex_table = "01230120022455012623010202";
8181
/*
8282
* Levenshtein
8383
*/
84-
#define STRLEN(p) strlen(p)
85-
#define CHAREQ(p1, p2) (*(p1) == *(p2))
86-
#define NextChar(p) ((p)++)
8784
#define MAX_LEVENSHTEIN_STRLEN 255
8885

8986

0 commit comments

Comments
 (0)