summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authorMarcus Boerger <helly@php.net>2006-02-26 10:57:00 +0000
committerMarcus Boerger <helly@php.net>2006-02-26 10:57:00 +0000
commit5a69b290824828833e3587cb04478316cae5e39c (patch)
treef1fc508b2375533384853944679d23a42a9c806c /ext
parent84fc80064bf2630f622c24ae5c43ac05d5628608 (diff)
downloadphp-git-5a69b290824828833e3587cb04478316cae5e39c.tar.gz
- Warning fixes by Steph
Diffstat (limited to 'ext')
-rw-r--r--ext/ereg/ereg.c2
-rw-r--r--ext/standard/array.c16
-rw-r--r--ext/standard/dir.c2
-rw-r--r--ext/standard/exec.c4
-rw-r--r--ext/standard/pack.c2
-rw-r--r--ext/standard/reg.c2
-rw-r--r--ext/standard/string.c10
-rw-r--r--ext/standard/user_filters.c2
8 files changed, 20 insertions, 20 deletions
diff --git a/ext/ereg/ereg.c b/ext/ereg/ereg.c
index a9ebaaee88..3e48d39ab3 100644
--- a/ext/ereg/ereg.c
+++ b/ext/ereg/ereg.c
@@ -355,7 +355,7 @@ PHPAPI char *php_reg_replace(const char *pattern, const char *replace, const cha
new_l = strlen(buf) + subs[0].rm_so; /* part before the match */
walk = replace;
while (*walk) {
- if ('\\' == *walk && isdigit((unsigned char)walk[1]) && ((unsigned char)walk[1]) - '0' <= re.re_nsub) {
+ if ('\\' == *walk && isdigit((unsigned char)walk[1]) && ((unsigned char)walk[1]) - '0' <= (int)re.re_nsub) {
if (subs[walk[1] - '0'].rm_so > -1 && subs[walk[1] - '0'].rm_eo > -1) {
new_l += subs[walk[1] - '0'].rm_eo - subs[walk[1] - '0'].rm_so;
}
diff --git a/ext/standard/array.c b/ext/standard/array.c
index 2e9b025cf2..dc2f4d88ab 100644
--- a/ext/standard/array.c
+++ b/ext/standard/array.c
@@ -1810,14 +1810,14 @@ HashTable* php_splice(HashTable *in_hash, int offset, int length,
/* Clamp the offset.. */
if (offset > num_in)
offset = num_in;
- else if (offset < 0 && (offset=num_in+offset) < 0)
+ else if (offset < 0 && (offset = (num_in + offset)) < 0)
offset = 0;
/* ..and the length */
if (length < 0) {
- length = num_in-offset+length;
- } else if (((unsigned) offset + (unsigned) length) > num_in) {
- length = num_in-offset;
+ length = num_in - offset + length;
+ } else if (((unsigned)offset + (unsigned)length) > (unsigned)num_in) {
+ length = num_in - offset;
}
/* Create and initialize output hash */
@@ -2204,14 +2204,14 @@ PHP_FUNCTION(array_slice)
/* Clamp the offset.. */
if (offset_val > num_in)
return;
- else if (offset_val < 0 && (offset_val=num_in+offset_val) < 0)
+ else if (offset_val < 0 && (offset_val = (num_in + offset_val)) < 0)
offset_val = 0;
/* ..and the length */
if (length_val < 0) {
- length_val = num_in-offset_val+length_val;
- } else if (((unsigned) offset_val + (unsigned) length_val) > num_in) {
- length_val = num_in-offset_val;
+ length_val = num_in - offset_val + length_val;
+ } else if (((unsigned)offset_val + (unsigned)length_val) > (unsigned)num_in) {
+ length_val = num_in - offset_val;
}
if (length_val == 0)
diff --git a/ext/standard/dir.c b/ext/standard/dir.c
index c13102b89e..baa9a79c32 100644
--- a/ext/standard/dir.c
+++ b/ext/standard/dir.c
@@ -370,7 +370,7 @@ PHP_FUNCTION(glob)
int pattern_len;
long flags = 0;
glob_t globbuf;
- unsigned int n;
+ int n;
int ret;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|l", &pattern, &pattern_len, &flags) == FAILURE)
diff --git a/ext/standard/exec.c b/ext/standard/exec.c
index bf2e3dbe8d..be07e3813d 100644
--- a/ext/standard/exec.c
+++ b/ext/standard/exec.c
@@ -135,7 +135,7 @@ int php_exec(int type, char *cmd, zval *array, zval *return_value TSRMLS_DC)
/* strip trailing whitespaces */
l = bufl;
while (l-- && isspace(((unsigned char *)buf)[l]));
- if (l != (bufl - 1)) {
+ if (l != (int)(bufl - 1)) {
bufl = l + 1;
buf[bufl] = '\0';
}
@@ -148,7 +148,7 @@ int php_exec(int type, char *cmd, zval *array, zval *return_value TSRMLS_DC)
if (type != 2) {
l = bufl;
while (l-- && isspace(((unsigned char *)buf)[l]));
- if (l != (bufl - 1)) {
+ if (l != (int)(bufl - 1)) {
bufl = l + 1;
buf[bufl] = '\0';
}
diff --git a/ext/standard/pack.c b/ext/standard/pack.c
index f088890a59..85b2acda74 100644
--- a/ext/standard/pack.c
+++ b/ext/standard/pack.c
@@ -55,7 +55,7 @@
#endif
#define INC_OUTPUTPOS(a,b) \
- if ((a) < 0 || ((INT_MAX - outputpos)/(b)) < (a)) { \
+ if ((a) < 0 || ((INT_MAX - outputpos)/((int)b)) < (a)) { \
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Type %c: integer overflow in format string", code); \
RETURN_FALSE; \
} \
diff --git a/ext/standard/reg.c b/ext/standard/reg.c
index a9ebaaee88..3e48d39ab3 100644
--- a/ext/standard/reg.c
+++ b/ext/standard/reg.c
@@ -355,7 +355,7 @@ PHPAPI char *php_reg_replace(const char *pattern, const char *replace, const cha
new_l = strlen(buf) + subs[0].rm_so; /* part before the match */
walk = replace;
while (*walk) {
- if ('\\' == *walk && isdigit((unsigned char)walk[1]) && ((unsigned char)walk[1]) - '0' <= re.re_nsub) {
+ if ('\\' == *walk && isdigit((unsigned char)walk[1]) && ((unsigned char)walk[1]) - '0' <= (int)re.re_nsub) {
if (subs[walk[1] - '0'].rm_so > -1 && subs[walk[1] - '0'].rm_eo > -1) {
new_l += subs[walk[1] - '0'].rm_eo - subs[walk[1] - '0'].rm_so;
}
diff --git a/ext/standard/string.c b/ext/standard/string.c
index 545ceeebab..5ae92eeec7 100644
--- a/ext/standard/string.c
+++ b/ext/standard/string.c
@@ -237,7 +237,7 @@ static void php_spn_common_handler(INTERNAL_FUNCTION_PARAMETERS, int behavior)
}
}
- if (((unsigned) start + (unsigned) len) > len1) {
+ if ((start + len) > len1) {
len = len1 - start;
}
@@ -1166,7 +1166,7 @@ quit_loop:
if (state == 1) {
cend = c;
}
- if (suffix != NULL && sufflen < (cend - comp) &&
+ if (suffix != NULL && sufflen < (uint)(cend - comp) &&
memcmp(cend - sufflen, suffix, sufflen) == 0) {
cend -= sufflen;
}
@@ -1983,7 +1983,7 @@ PHP_FUNCTION(substr)
RETURN_FALSE;
}
- if (((unsigned) f + (unsigned) l) > Z_STRLEN_PP(str)) {
+ if ((f + l) > Z_STRLEN_PP(str)) {
l = Z_STRLEN_PP(str) - f;
}
@@ -2080,7 +2080,7 @@ PHP_FUNCTION(substr_replace)
}
}
- if (((unsigned) f + (unsigned) l) > Z_STRLEN_PP(str)) {
+ if ((f + l) > Z_STRLEN_PP(str)) {
l = Z_STRLEN_PP(str) - f;
}
if (Z_TYPE_PP(repl) == IS_ARRAY) {
@@ -2176,7 +2176,7 @@ PHP_FUNCTION(substr_replace)
}
}
- if (((unsigned) f + (unsigned) l) > Z_STRLEN_PP(tmp_str)) {
+ if ((f + l) > Z_STRLEN_PP(tmp_str)) {
l = Z_STRLEN_PP(tmp_str) - f;
}
diff --git a/ext/standard/user_filters.c b/ext/standard/user_filters.c
index ece984f7a6..971a5b91ab 100644
--- a/ext/standard/user_filters.c
+++ b/ext/standard/user_filters.c
@@ -406,7 +406,7 @@ static void php_stream_bucket_attach(int append, INTERNAL_FUNCTION_PARAMETERS)
if (!bucket->own_buf) {
bucket = php_stream_bucket_make_writeable(bucket TSRMLS_CC);
}
- if (bucket->buflen != Z_STRLEN_PP(pzdata)) {
+ if ((int)bucket->buflen != Z_STRLEN_PP(pzdata)) {
bucket->buf = perealloc(bucket->buf, Z_STRLEN_PP(pzdata), bucket->is_persistent);
bucket->buflen = Z_STRLEN_PP(pzdata);
}