summaryrefslogtreecommitdiff
path: root/ext/intl/grapheme
diff options
context:
space:
mode:
authorDmitry Stogov <dmitry@zend.com>2016-06-22 00:40:50 +0300
committerDmitry Stogov <dmitry@zend.com>2016-06-22 00:40:50 +0300
commit323b2733f6b42d00dd86e77ac524d64f6ddc4e22 (patch)
tree49c72ac7d1e6077369f1de6a5d7a6d7847e51bf9 /ext/intl/grapheme
parent4ccbe03e445800d26aba5424a84e64e235f08ece (diff)
downloadphp-git-323b2733f6b42d00dd86e77ac524d64f6ddc4e22.tar.gz
Fixed compilation warnings
Diffstat (limited to 'ext/intl/grapheme')
-rw-r--r--ext/intl/grapheme/grapheme_string.c6
-rw-r--r--ext/intl/grapheme/grapheme_util.c2
-rw-r--r--ext/intl/grapheme/grapheme_util.h2
3 files changed, 4 insertions, 6 deletions
diff --git a/ext/intl/grapheme/grapheme_string.c b/ext/intl/grapheme/grapheme_string.c
index 0735a7e822..5ff0a43bfd 100644
--- a/ext/intl/grapheme/grapheme_string.c
+++ b/ext/intl/grapheme/grapheme_string.c
@@ -126,7 +126,7 @@ PHP_FUNCTION(grapheme_strpos)
/* we checked that it will fit: */
offset = (int32_t) loffset;
- noffset = offset >= 0 ? offset : haystack_len + offset;
+ noffset = offset >= 0 ? offset : (int32_t)haystack_len + offset;
/* the offset is 'grapheme count offset' so it still might be invalid - we'll check it later */
@@ -200,7 +200,7 @@ PHP_FUNCTION(grapheme_stripos)
is_ascii = ( grapheme_ascii_check((unsigned char*)haystack, haystack_len) >= 0 );
if ( is_ascii ) {
- int32_t noffset = offset >= 0 ? offset : haystack_len + offset;
+ int32_t noffset = offset >= 0 ? offset : (int32_t)haystack_len + offset;
needle_dup = estrndup(needle, needle_len);
php_strtolower(needle_dup, needle_len);
haystack_dup = estrndup(haystack, haystack_len);
@@ -828,7 +828,7 @@ PHP_FUNCTION(grapheme_extract)
RETURN_FALSE;
}
- if ( lstart > INT32_MAX || lstart < 0 || lstart >= str_len ) {
+ if ( lstart > INT32_MAX || lstart < 0 || (size_t)lstart >= str_len ) {
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, "grapheme_extract: start not contained in string", 0 );
RETURN_FALSE;
}
diff --git a/ext/intl/grapheme/grapheme_util.c b/ext/intl/grapheme/grapheme_util.c
index b590631c72..042092ea59 100644
--- a/ext/intl/grapheme/grapheme_util.c
+++ b/ext/intl/grapheme/grapheme_util.c
@@ -345,7 +345,7 @@ grapheme_strrpos_ascii(char *haystack, size_t haystack_len, char *needle, size_t
e = haystack + haystack_len - needle_len;
} else {
p = haystack;
- if (needle_len > -offset) {
+ if (needle_len > (size_t)-offset) {
e = haystack + haystack_len - needle_len;
} else {
e = haystack + haystack_len + offset;
diff --git a/ext/intl/grapheme/grapheme_util.h b/ext/intl/grapheme/grapheme_util.h
index 492b19bb7f..5b942d030e 100644
--- a/ext/intl/grapheme/grapheme_util.h
+++ b/ext/intl/grapheme/grapheme_util.h
@@ -34,8 +34,6 @@ int32_t grapheme_split_string(const UChar *text, int32_t text_length, int bounda
int32_t grapheme_count_graphemes(UBreakIterator *bi, UChar *string, int32_t string_len);
-inline void *grapheme_memrchr_grapheme(const void *s, int c, int32_t n);
-
int32_t grapheme_get_haystack_offset(UBreakIterator* bi, int32_t offset);
UBreakIterator* grapheme_get_break_iterator(void *stack_buffer, UErrorCode *status );