Index: ext/standard/levenshtein.c =================================================================== RCS file: /repository/php-src/ext/standard/levenshtein.c,v retrieving revision 1.36 diff -u -p -d -r1.36 levenshtein.c --- ext/standard/levenshtein.c 1 Jan 2006 13:09:55 -0000 1.36 +++ ext/standard/levenshtein.c 10 Jan 2006 10:46:42 -0000 @@ -27,9 +27,9 @@ /* {{{ reference_levdist * reference implementation, only optimized for memory usage, not speed */ -static int reference_levdist(void *s1, int32_t l1, void *s2, int32_t l2, zend_uchar str_type, int cost_ins, int cost_rep, int cost_del ) +static long reference_levdist(void *s1, int32_t l1, void *s2, int32_t l2, zend_uchar str_type, long cost_ins, long cost_rep, long cost_del ) { - int *p1, *p2, *tmp; + long *p1, *p2, *tmp; int32_t i1, i2, j1, j2, cp1, cp2; int32_t c0, c1, c2; UChar32 ch1, ch2; @@ -44,8 +44,8 @@ static int reference_levdist(void *s1, i return -1; } - p1 = safe_emalloc((cp2+1), sizeof(int), 0); - p2 = safe_emalloc((cp2+1), sizeof(int), 0); + p1 = safe_emalloc((cp2+1), sizeof(long), 0); + p2 = safe_emalloc((cp2+1), sizeof(long), 0); } else { if (l1 == 0) return l2*cost_ins; if (l2 == 0) return l1*cost_del; @@ -53,8 +53,8 @@ static int reference_levdist(void *s1, i return -1; } - p1 = safe_emalloc((l2+1), sizeof(int), 0); - p2 = safe_emalloc((l2+1), sizeof(int), 0); + p1 = safe_emalloc((l2+1), sizeof(long), 0); + p2 = safe_emalloc((l2+1), sizeof(long), 0); } for (i2 = 0 ; i2 <= l2 ; i2++) @@ -89,7 +89,7 @@ static int reference_levdist(void *s1, i /* {{{ custom_levdist */ -static int custom_levdist(void *str1, void *str2, char *callback_name TSRMLS_DC) +static long custom_levdist(void *str1, void *str2, char *callback_name TSRMLS_DC) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "The general Levenshtein support is not there yet"); /* not there yet */ @@ -106,9 +106,9 @@ PHP_FUNCTION(levenshtein) void *str1, *str2; int32_t str1_len, str2_len; zend_uchar str1_type, str2_type; - int cost_ins, cost_rep, cost_del; + long cost_ins, cost_rep, cost_del; char *callback_name; - int distance = -1; + long distance = -1; switch (argc) { case 2: /* just two string: use maximum performance version */