diff options
author | Dmitry Stogov <dmitry@zend.com> | 2015-06-30 04:05:24 +0300 |
---|---|---|
committer | Dmitry Stogov <dmitry@zend.com> | 2015-06-30 04:05:24 +0300 |
commit | 4a2e40bb861bc3cf5fb6863e57486ed60316e97c (patch) | |
tree | 6579660b282fdd1bc50095e48d702913a0b6aa97 /ext/standard/metaphone.c | |
parent | 8cce5b2641fb91c3073018b59f6f044b843041a8 (diff) | |
download | php-git-4a2e40bb861bc3cf5fb6863e57486ed60316e97c.tar.gz |
Use ZSTR_ API to access zend_string elements (this is just renaming without semantick changes).
Diffstat (limited to 'ext/standard/metaphone.c')
-rw-r--r-- | ext/standard/metaphone.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/ext/standard/metaphone.c b/ext/standard/metaphone.c index de29415cdf..2aa5bc87a8 100644 --- a/ext/standard/metaphone.c +++ b/ext/standard/metaphone.c @@ -39,7 +39,7 @@ PHP_FUNCTION(metaphone) return; } - if (metaphone((unsigned char *)str->val, str->len, phones, &result, 1) == 0) { + if (metaphone((unsigned char *)ZSTR_VAL(str), ZSTR_LEN(str), phones, &result, 1) == 0) { RETVAL_STR(result); } else { if (result) { @@ -145,8 +145,8 @@ static char Lookahead(char *word, int how_far) *phoned_word = zend_string_extend(*phoned_word, 2 * sizeof(char) + max_buffer_len, 0); \ max_buffer_len += 2; \ } \ - (*phoned_word)->val[p_idx++] = c; \ - (*phoned_word)->len = p_idx; \ + ZSTR_VAL(*phoned_word)[p_idx++] = c; \ + ZSTR_LEN(*phoned_word) = p_idx; \ } /* Slap a null character on the end of the phoned word */ #define End_Phoned_Word { \ @@ -154,8 +154,8 @@ static char Lookahead(char *word, int how_far) *phoned_word = zend_string_extend(*phoned_word, 1 * sizeof(char) + max_buffer_len, 0); \ max_buffer_len += 1; \ } \ - (*phoned_word)->val[p_idx] = '\0'; \ - (*phoned_word)->len = p_idx; \ + ZSTR_VAL(*phoned_word)[p_idx] = '\0'; \ + ZSTR_LEN(*phoned_word) = p_idx; \ } /* How long is the phoned word? */ #define Phone_Len (p_idx) |