@@ -94,18 +94,6 @@ soundex_code(char letter)
9494****************************************************************************/
9595
9696
97- /**************************************************************************
98- my constants -- constants I like
99-
100- Probably redundant.
101-
102- ***************************************************************************/
103-
104- #define META_ERROR FALSE
105- #define META_SUCCESS TRUE
106- #define META_FAILURE FALSE
107-
108-
10997/* I add modifications to the traditional metaphone algorithm that you
11098 might find in books. Define this if you want metaphone to behave
11199 traditionally */
@@ -116,7 +104,7 @@ soundex_code(char letter)
116104#define TH '0'
117105
118106static char Lookahead (char * word , int how_far );
119- static int _metaphone (char * word , int max_phonemes , char * * phoned_word );
107+ static void _metaphone (char * word , int max_phonemes , char * * phoned_word );
120108
121109/* Metachar.h ... little bits about characters for metaphone */
122110
@@ -272,7 +260,6 @@ metaphone(PG_FUNCTION_ARGS)
272260 size_t str_i_len = strlen (str_i );
273261 int reqlen ;
274262 char * metaph ;
275- int retval ;
276263
277264 /* return an empty string if we receive one */
278265 if (!(str_i_len > 0 ))
@@ -296,17 +283,8 @@ metaphone(PG_FUNCTION_ARGS)
296283 (errcode (ERRCODE_ZERO_LENGTH_CHARACTER_STRING ),
297284 errmsg ("output cannot be empty string" )));
298285
299-
300- retval = _metaphone (str_i , reqlen , & metaph );
301- if (retval == META_SUCCESS )
302- PG_RETURN_TEXT_P (cstring_to_text (metaph ));
303- else
304- {
305- /* internal error */
306- elog (ERROR , "metaphone: failure" );
307- /* keep the compiler quiet */
308- PG_RETURN_NULL ();
309- }
286+ _metaphone (str_i , reqlen , & metaph );
287+ PG_RETURN_TEXT_P (cstring_to_text (metaph ));
310288}
311289
312290
@@ -362,7 +340,7 @@ Lookahead(char *word, int how_far)
362340#define Isbreak (c ) (!isalpha((unsigned char) (c)))
363341
364342
365- static int
343+ static void
366344_metaphone (char * word , /* IN */
367345 int max_phonemes ,
368346 char * * phoned_word ) /* OUT */
@@ -404,7 +382,7 @@ _metaphone(char *word, /* IN */
404382 if (Curr_Letter == '\0' )
405383 {
406384 End_Phoned_Word ;
407- return META_SUCCESS ; /* For testing */
385+ return ;
408386 }
409387 }
410388
@@ -721,7 +699,7 @@ _metaphone(char *word, /* IN */
721699
722700 End_Phoned_Word ;
723701
724- return ( META_SUCCESS ) ;
702+ return ;
725703} /* END metaphone */
726704
727705
0 commit comments