summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authorDmitry Stogov <dmitry@zend.com>2014-04-22 17:46:34 +0400
committerDmitry Stogov <dmitry@zend.com>2014-04-22 17:46:34 +0400
commit5864ce8a447b718d0912cb073afe87eddc47b2e8 (patch)
tree81d7b40143c084383637c253bd61c3c795ca428f /ext
parentc0b49a701a74f9be1f99f79c4334d4aecdf1f1c6 (diff)
downloadphp-git-5864ce8a447b718d0912cb073afe87eddc47b2e8.tar.gz
Fixed compilation warnings
Diffstat (limited to 'ext')
-rw-r--r--ext/date/php_date.c4
-rw-r--r--ext/libxml/libxml.c2
-rw-r--r--ext/opcache/Optimizer/compact_literals.c2
-rw-r--r--ext/pcre/php_pcre.c2
-rw-r--r--ext/reflection/php_reflection.c13
-rw-r--r--ext/spl/spl_dllist.c4
-rw-r--r--ext/spl/spl_observer.c5
-rw-r--r--ext/standard/array.c7
-rw-r--r--ext/standard/crc32.c4
9 files changed, 21 insertions, 22 deletions
diff --git a/ext/date/php_date.c b/ext/date/php_date.c
index 06c131014e..35c018e324 100644
--- a/ext/date/php_date.c
+++ b/ext/date/php_date.c
@@ -2503,7 +2503,7 @@ PHPAPI int php_date_initialize(php_date_obj *dateobj, /*const*/ char *time_str,
timelib_error_container *err = NULL;
int type = TIMELIB_ZONETYPE_ID, new_dst = 0;
char *new_abbr = NULL;
- timelib_sll new_offset;
+ timelib_sll new_offset = 0;
if (dateobj->time) {
timelib_time_dtor(dateobj->time);
@@ -4016,7 +4016,7 @@ zval *date_interval_read_property(zval *object, zval *member, int type, zend_uin
void date_interval_write_property(zval *object, zval *member, zval *value, zend_uint cache_slot TSRMLS_DC)
{
php_interval_obj *obj;
- zval tmp_member, tmp_value;
+ zval tmp_member;
if (Z_TYPE_P(member) != IS_STRING) {
tmp_member = *member;
diff --git a/ext/libxml/libxml.c b/ext/libxml/libxml.c
index cfa339fe24..8b6af6a52b 100644
--- a/ext/libxml/libxml.c
+++ b/ext/libxml/libxml.c
@@ -478,7 +478,7 @@ static void _php_list_set_error_structure(xmlErrorPtr error, const char *msg)
error_copy.int1 = 0;
error_copy.int2 = 0;
error_copy.ctxt = NULL;
- error_copy.message = xmlStrdup(msg);
+ error_copy.message = (char*)xmlStrdup((xmlChar*)msg);
error_copy.file = NULL;
error_copy.str1 = NULL;
error_copy.str2 = NULL;
diff --git a/ext/opcache/Optimizer/compact_literals.c b/ext/opcache/Optimizer/compact_literals.c
index 59628243f6..04183292d6 100644
--- a/ext/opcache/Optimizer/compact_literals.c
+++ b/ext/opcache/Optimizer/compact_literals.c
@@ -96,7 +96,7 @@ static void optimizer_compact_literals(zend_op_array *op_array TSRMLS_DC)
int l_false = -1;
int l_true = -1;
HashTable hash;
- zend_string *key;
+ zend_string *key = NULL;
if (op_array->last_literal) {
info = (literal_info*)ecalloc(op_array->last_literal, sizeof(literal_info));
diff --git a/ext/pcre/php_pcre.c b/ext/pcre/php_pcre.c
index 724b667bde..60769f1314 100644
--- a/ext/pcre/php_pcre.c
+++ b/ext/pcre/php_pcre.c
@@ -1008,7 +1008,7 @@ PHPAPI zend_string *php_pcre_replace_impl(pcre_cache_entry *pce, char *subject,
*match, /* The current match */
*piece, /* The current piece of subject */
*replace_end=NULL, /* End of replacement string */
- *eval_result, /* Result of eval or custom function */
+ *eval_result=NULL, /* Result of eval or custom function */
walk_last; /* Last walked character */
int rc,
result_len; /* Length of result */
diff --git a/ext/reflection/php_reflection.c b/ext/reflection/php_reflection.c
index 4940457333..4af0b7383d 100644
--- a/ext/reflection/php_reflection.c
+++ b/ext/reflection/php_reflection.c
@@ -98,12 +98,15 @@ ZEND_DECLARE_MODULE_GLOBALS(reflection)
return; \
}
-#define GET_REFLECTION_OBJECT_PTR(target) \
- intern = Z_REFLECTION_P(getThis()); \
+#define GET_REFLECTION_OBJECT() \
+ intern = Z_REFLECTION_P(getThis()); \
if (intern == NULL || intern->ptr == NULL) { \
RETURN_ON_EXCEPTION \
php_error_docref(NULL TSRMLS_CC, E_ERROR, "Internal error: Failed to retrieve the reflection object"); \
} \
+
+#define GET_REFLECTION_OBJECT_PTR(target) \
+ GET_REFLECTION_OBJECT() \
target = intern->ptr; \
/* Class constants */
@@ -1679,13 +1682,12 @@ ZEND_METHOD(reflection_function, isClosure)
ZEND_METHOD(reflection_function, getClosureThis)
{
reflection_object *intern;
- zend_function *fptr;
zval* closure_this;
if (zend_parse_parameters_none() == FAILURE) {
return;
}
- GET_REFLECTION_OBJECT_PTR(fptr);
+ GET_REFLECTION_OBJECT();
if (!ZVAL_IS_UNDEF(&intern->obj)) {
closure_this = zend_get_closure_this_ptr(&intern->obj TSRMLS_CC);
if (!ZVAL_IS_UNDEF(closure_this)) {
@@ -1700,13 +1702,12 @@ ZEND_METHOD(reflection_function, getClosureThis)
ZEND_METHOD(reflection_function, getClosureScopeClass)
{
reflection_object *intern;
- zend_function *fptr;
const zend_function *closure_func;
if (zend_parse_parameters_none() == FAILURE) {
return;
}
- GET_REFLECTION_OBJECT_PTR(fptr);
+ GET_REFLECTION_OBJECT();
if (!ZVAL_IS_UNDEF(&intern->obj)) {
closure_func = zend_get_closure_method_def(&intern->obj TSRMLS_CC);
if (closure_func && closure_func->common.scope) {
diff --git a/ext/spl/spl_dllist.c b/ext/spl/spl_dllist.c
index dc10dde6e9..d2f17452ac 100644
--- a/ext/spl/spl_dllist.c
+++ b/ext/spl/spl_dllist.c
@@ -326,12 +326,12 @@ static void spl_ptr_llist_shift(spl_ptr_llist *llist, zval *ret TSRMLS_DC) /* {{
static void spl_ptr_llist_copy(spl_ptr_llist *from, spl_ptr_llist *to TSRMLS_DC) /* {{{ */
{
spl_ptr_llist_element *current = from->head, *next;
- spl_ptr_llist_ctor_func ctor = from->ctor;
+//??? spl_ptr_llist_ctor_func ctor = from->ctor;
while (current) {
next = current->next;
- /*!! FIXME
+ /*??? FIXME
if (ctor) {
ctor(current TSRMLS_CC);
}
diff --git a/ext/spl/spl_observer.c b/ext/spl/spl_observer.c
index 5abedecb7f..35c5353da1 100644
--- a/ext/spl/spl_observer.c
+++ b/ext/spl/spl_observer.c
@@ -200,7 +200,7 @@ spl_SplObjectStorageElement *spl_object_storage_attach(spl_SplObjectStorage *int
zend_string *hash = spl_object_storage_get_hash(intern, this, obj TSRMLS_CC);
if (!hash) {
- return;
+ return NULL;
}
pelement = spl_object_storage_get(intern, hash TSRMLS_CC);
@@ -419,7 +419,7 @@ static int spl_object_storage_compare_objects(zval *o1, zval *o2 TSRMLS_DC) /* {
return 1;
}
- return zend_hash_compare(&(Z_SPLOBJSTORAGE_P(o1))->storage, &(Z_SPLOBJSTORAGE_P(o2))->storage, spl_object_storage_compare_info, 0 TSRMLS_CC);
+ return zend_hash_compare(&(Z_SPLOBJSTORAGE_P(o1))->storage, &(Z_SPLOBJSTORAGE_P(o2))->storage, (compare_func_t)spl_object_storage_compare_info, 0 TSRMLS_CC);
}
/* }}} */
@@ -799,7 +799,6 @@ SPL_METHOD(SplObjectStorage, unserialize)
zval entry, pmembers, pcount, inf;
spl_SplObjectStorageElement *element;
long count;
- HashPosition pos;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &buf, &buf_len) == FAILURE) {
return;
diff --git a/ext/standard/array.c b/ext/standard/array.c
index 6dada188cf..918d5112e6 100644
--- a/ext/standard/array.c
+++ b/ext/standard/array.c
@@ -2633,6 +2633,8 @@ PHP_FUNCTION(array_column)
{
zval *zcolumn = NULL, *zkey = NULL, *data;
HashTable *arr_hash;
+ zval *zcolval = NULL, *zkeyval = NULL;
+ HashTable *ht;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "hz!|z!", &arr_hash, &zcolumn, &zkey) == FAILURE) {
return;
@@ -2645,9 +2647,6 @@ PHP_FUNCTION(array_column)
array_init(return_value);
ZEND_HASH_FOREACH_VAL(arr_hash, data) {
- zval *zcolval, *zkeyval = NULL;
- HashTable *ht;
-
if (Z_TYPE_P(data) != IS_ARRAY) {
/* Skip elemens which are not sub-arrays */
continue;
@@ -4506,7 +4505,7 @@ PHP_FUNCTION(array_key_exists)
Split array into chunks */
PHP_FUNCTION(array_chunk)
{
- int argc = ZEND_NUM_ARGS(), key_type, num_in;
+ int argc = ZEND_NUM_ARGS(), num_in;
long size, current = 0;
zend_string *str_key;
ulong num_key;
diff --git a/ext/standard/crc32.c b/ext/standard/crc32.c
index 3ce355a45f..e9176e84da 100644
--- a/ext/standard/crc32.c
+++ b/ext/standard/crc32.c
@@ -27,7 +27,7 @@
PHP_NAMED_FUNCTION(php_if_crc32)
{
char *p;
- int len, nr;
+ int nr;
php_uint32 crcinit = 0;
register php_uint32 crc;
@@ -36,7 +36,7 @@ PHP_NAMED_FUNCTION(php_if_crc32)
}
crc = crcinit^0xFFFFFFFF;
- for (len =+nr; nr--; ++p) {
+ for (; nr--; ++p) {
crc = ((crc >> 8) & 0x00FFFFFF) ^ crc32tab[(crc ^ (*p)) & 0xFF ];
}
RETVAL_LONG(crc^0xFFFFFFFF);