From: Kalle Sommer Nielsen Date: Tue, 19 May 2009 17:38:29 +0000 (+0000) Subject: MFH: Fix compiler warnings X-Git-Tag: php-5.3.0RC3~203 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ff88b45ffca806c0d8d9c5c432535c57da930fa6;p=php MFH: Fix compiler warnings --- diff --git a/ext/com_dotnet/com_handlers.c b/ext/com_dotnet/com_handlers.c index 2bea36ca28..e85d3d1fc1 100644 --- a/ext/com_dotnet/com_handlers.c +++ b/ext/com_dotnet/com_handlers.c @@ -434,7 +434,7 @@ static union _zend_function *com_constructor_get(zval *object TSRMLS_DC) } } -static zend_class_entry *com_class_entry_get(zval *object TSRMLS_DC) +static zend_class_entry *com_class_entry_get(const zval *object TSRMLS_DC) { php_com_dotnet_object *obj; obj = CDNO_FETCH(object); @@ -442,7 +442,7 @@ static zend_class_entry *com_class_entry_get(zval *object TSRMLS_DC) return obj->ce; } -static int com_class_name_get(zval *object, char **class_name, zend_uint *class_name_len, int parent TSRMLS_DC) +static int com_class_name_get(const zval *object, char **class_name, zend_uint *class_name_len, int parent TSRMLS_DC) { php_com_dotnet_object *obj; obj = CDNO_FETCH(object); diff --git a/ext/com_dotnet/com_iterator.c b/ext/com_dotnet/com_iterator.c index 529dd291fc..83a99026de 100644 --- a/ext/com_dotnet/com_iterator.c +++ b/ext/com_dotnet/com_iterator.c @@ -111,7 +111,7 @@ static int com_iter_move_forwards(zend_object_iterator *iter TSRMLS_DC) } } else { /* safe array */ - if (I->key >= I->sa_max) { + if (I->key >= (ULONG) I->sa_max) { I->key = (ulong)-1; return FAILURE; } diff --git a/ext/com_dotnet/com_persist.c b/ext/com_dotnet/com_persist.c index f95aedc66e..9f8eed407e 100755 --- a/ext/com_dotnet/com_persist.c +++ b/ext/com_dotnet/com_persist.c @@ -157,7 +157,7 @@ static HRESULT STDMETHODCALLTYPE stm_seek(IStream *This, LARGE_INTEGER dlibMove, return STG_E_INVALIDFUNCTION; } - offset = dlibMove.QuadPart; + offset = (off_t) dlibMove.QuadPart; ret = php_stream_seek(stm->stream, offset, whence); diff --git a/ext/com_dotnet/com_saproxy.c b/ext/com_dotnet/com_saproxy.c index e7310c4498..25a2f77c8d 100644 --- a/ext/com_dotnet/com_saproxy.c +++ b/ext/com_dotnet/com_saproxy.c @@ -92,10 +92,9 @@ static zval *saproxy_read_dimension(zval *object, zval *offset, int type TSRMLS_ { php_com_saproxy *proxy = SA_FETCH(object); zval *return_value; - UINT dims; + UINT dims, i; SAFEARRAY *sa; LONG ubound, lbound; - int i; HRESULT res; MAKE_STD_ZVAL(return_value); @@ -110,7 +109,7 @@ static zval *saproxy_read_dimension(zval *object, zval *offset, int type TSRMLS_ args = safe_emalloc(proxy->dimensions + 1, sizeof(zval *), 0); - for (i = 1; i < proxy->dimensions; i++) { + for (i = 1; i < (UINT) proxy->dimensions; i++) { args[i-1] = proxy->indices[i]; } args[i-1] = offset; @@ -145,7 +144,7 @@ static zval *saproxy_read_dimension(zval *object, zval *offset, int type TSRMLS_ sa = V_ARRAY(&proxy->obj->v); dims = SafeArrayGetDim(sa); - if (proxy->dimensions >= dims) { + if ((UINT) proxy->dimensions >= dims) { /* too many dimensions */ php_com_throw_exception(E_INVALIDARG, "too many dimensions!" TSRMLS_CC); return return_value; @@ -212,8 +211,7 @@ static zval *saproxy_read_dimension(zval *object, zval *offset, int type TSRMLS_ static void saproxy_write_dimension(zval *object, zval *offset, zval *value TSRMLS_DC) { php_com_saproxy *proxy = SA_FETCH(object); - UINT dims; - int i; + UINT dims, i; HRESULT res; VARIANT v; @@ -223,7 +221,7 @@ static void saproxy_write_dimension(zval *object, zval *offset, zval *value TSRM * the final value */ zval **args = safe_emalloc(proxy->dimensions + 2, sizeof(zval *), 0); - for (i = 1; i < proxy->dimensions; i++) { + for (i = 1; i < (UINT) proxy->dimensions; i++) { args[i-1] = proxy->indices[i]; } args[i-1] = offset; @@ -340,12 +338,12 @@ static union _zend_function *saproxy_constructor_get(zval *object TSRMLS_DC) return NULL; } -static zend_class_entry *saproxy_class_entry_get(zval *object TSRMLS_DC) +static zend_class_entry *saproxy_class_entry_get(const zval *object TSRMLS_DC) { return php_com_saproxy_class_entry; } -static int saproxy_class_name_get(zval *object, char **class_name, zend_uint *class_name_len, int parent TSRMLS_DC) +static int saproxy_class_name_get(const zval *object, char **class_name, zend_uint *class_name_len, int parent TSRMLS_DC) { *class_name = estrndup(php_com_saproxy_class_entry->name, php_com_saproxy_class_entry->name_length); *class_name_len = php_com_saproxy_class_entry->name_length;