diff options
| author | Anatol Belski <ab@php.net> | 2014-08-18 16:50:54 +0200 |
|---|---|---|
| committer | Anatol Belski <ab@php.net> | 2014-08-18 16:50:54 +0200 |
| commit | b8324e6d635450562ecb253af38f22105e19e460 (patch) | |
| tree | eadecc2f5c251a20013c600212104b0ba4cce8bc /ext/standard/metaphone.c | |
| parent | 97e9d058f09c12161863e5c3832552eb5da3f3c6 (diff) | |
| download | php-git-b8324e6d635450562ecb253af38f22105e19e460.tar.gz | |
further fixes to ext/standard
Diffstat (limited to 'ext/standard/metaphone.c')
| -rw-r--r-- | ext/standard/metaphone.c | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/ext/standard/metaphone.c b/ext/standard/metaphone.c index 9d22868b8c..880f6c5103 100644 --- a/ext/standard/metaphone.c +++ b/ext/standard/metaphone.c @@ -25,23 +25,21 @@ #include "php.h" #include "php_metaphone.h" -static int metaphone(unsigned char *word, int word_len, long max_phonemes, zend_string **phoned_word, int traditional); +static int metaphone(unsigned char *word, php_size_t word_len, php_int_t max_phonemes, zend_string **phoned_word, int traditional); /* {{{ proto string metaphone(string text[, int phones]) Break english phrases down into their phonemes */ PHP_FUNCTION(metaphone) { - char *str; + zend_string *str; zend_string *result = NULL; - int str_len; - long phones = 0; + php_int_t phones = 0; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|l", &str, &str_len, - &phones) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "S|i", &str, &phones) == FAILURE) { return; } - if (metaphone((unsigned char *)str, str_len, phones, &result, 1) == 0) { + if (metaphone((unsigned char *)str->val, str->len, phones, &result, 1) == 0) { RETVAL_STR(result); } else { if (result) { @@ -167,11 +165,11 @@ static char Lookahead(char *word, int how_far) /* {{{ metaphone */ -static int metaphone(unsigned char *word, int word_len, long max_phonemes, zend_string **phoned_word, int traditional) +static int metaphone(unsigned char *word, php_size_t word_len, php_int_t max_phonemes, zend_string **phoned_word, int traditional) { int w_idx = 0; /* point in the phonization we're at. */ int p_idx = 0; /* end of the phoned phrase */ - int max_buffer_len = 0; /* maximum length of the destination buffer */ + php_size_t max_buffer_len = 0; /* maximum length of the destination buffer */ /*-- Parameter checks --*/ /* Negative phoneme length is meaningless */ |
