Skip to content

Commit ff88b45

Browse files
committed
MFH: Fix compiler warnings
1 parent 70fb8c8 commit ff88b45

File tree

4 files changed

+11
-13
lines changed

4 files changed

+11
-13
lines changed

ext/com_dotnet/com_handlers.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -434,15 +434,15 @@ static union _zend_function *com_constructor_get(zval *object TSRMLS_DC)
434434
}
435435
}
436436

437-
static zend_class_entry *com_class_entry_get(zval *object TSRMLS_DC)
437+
static zend_class_entry *com_class_entry_get(const zval *object TSRMLS_DC)
438438
{
439439
php_com_dotnet_object *obj;
440440
obj = CDNO_FETCH(object);
441441

442442
return obj->ce;
443443
}
444444

445-
static int com_class_name_get(zval *object, char **class_name, zend_uint *class_name_len, int parent TSRMLS_DC)
445+
static int com_class_name_get(const zval *object, char **class_name, zend_uint *class_name_len, int parent TSRMLS_DC)
446446
{
447447
php_com_dotnet_object *obj;
448448
obj = CDNO_FETCH(object);

ext/com_dotnet/com_iterator.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ static int com_iter_move_forwards(zend_object_iterator *iter TSRMLS_DC)
111111
}
112112
} else {
113113
/* safe array */
114-
if (I->key >= I->sa_max) {
114+
if (I->key >= (ULONG) I->sa_max) {
115115
I->key = (ulong)-1;
116116
return FAILURE;
117117
}

ext/com_dotnet/com_persist.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ static HRESULT STDMETHODCALLTYPE stm_seek(IStream *This, LARGE_INTEGER dlibMove,
157157
return STG_E_INVALIDFUNCTION;
158158
}
159159

160-
offset = dlibMove.QuadPart;
160+
offset = (off_t) dlibMove.QuadPart;
161161

162162
ret = php_stream_seek(stm->stream, offset, whence);
163163

ext/com_dotnet/com_saproxy.c

+7-9
Original file line numberDiff line numberDiff line change
@@ -92,10 +92,9 @@ static zval *saproxy_read_dimension(zval *object, zval *offset, int type TSRMLS_
9292
{
9393
php_com_saproxy *proxy = SA_FETCH(object);
9494
zval *return_value;
95-
UINT dims;
95+
UINT dims, i;
9696
SAFEARRAY *sa;
9797
LONG ubound, lbound;
98-
int i;
9998
HRESULT res;
10099

101100
MAKE_STD_ZVAL(return_value);
@@ -110,7 +109,7 @@ static zval *saproxy_read_dimension(zval *object, zval *offset, int type TSRMLS_
110109

111110
args = safe_emalloc(proxy->dimensions + 1, sizeof(zval *), 0);
112111

113-
for (i = 1; i < proxy->dimensions; i++) {
112+
for (i = 1; i < (UINT) proxy->dimensions; i++) {
114113
args[i-1] = proxy->indices[i];
115114
}
116115
args[i-1] = offset;
@@ -145,7 +144,7 @@ static zval *saproxy_read_dimension(zval *object, zval *offset, int type TSRMLS_
145144
sa = V_ARRAY(&proxy->obj->v);
146145
dims = SafeArrayGetDim(sa);
147146

148-
if (proxy->dimensions >= dims) {
147+
if ((UINT) proxy->dimensions >= dims) {
149148
/* too many dimensions */
150149
php_com_throw_exception(E_INVALIDARG, "too many dimensions!" TSRMLS_CC);
151150
return return_value;
@@ -212,8 +211,7 @@ static zval *saproxy_read_dimension(zval *object, zval *offset, int type TSRMLS_
212211
static void saproxy_write_dimension(zval *object, zval *offset, zval *value TSRMLS_DC)
213212
{
214213
php_com_saproxy *proxy = SA_FETCH(object);
215-
UINT dims;
216-
int i;
214+
UINT dims, i;
217215
HRESULT res;
218216
VARIANT v;
219217

@@ -223,7 +221,7 @@ static void saproxy_write_dimension(zval *object, zval *offset, zval *value TSRM
223221
* the final value */
224222
zval **args = safe_emalloc(proxy->dimensions + 2, sizeof(zval *), 0);
225223

226-
for (i = 1; i < proxy->dimensions; i++) {
224+
for (i = 1; i < (UINT) proxy->dimensions; i++) {
227225
args[i-1] = proxy->indices[i];
228226
}
229227
args[i-1] = offset;
@@ -340,12 +338,12 @@ static union _zend_function *saproxy_constructor_get(zval *object TSRMLS_DC)
340338
return NULL;
341339
}
342340

343-
static zend_class_entry *saproxy_class_entry_get(zval *object TSRMLS_DC)
341+
static zend_class_entry *saproxy_class_entry_get(const zval *object TSRMLS_DC)
344342
{
345343
return php_com_saproxy_class_entry;
346344
}
347345

348-
static int saproxy_class_name_get(zval *object, char **class_name, zend_uint *class_name_len, int parent TSRMLS_DC)
346+
static int saproxy_class_name_get(const zval *object, char **class_name, zend_uint *class_name_len, int parent TSRMLS_DC)
349347
{
350348
*class_name = estrndup(php_com_saproxy_class_entry->name, php_com_saproxy_class_entry->name_length);
351349
*class_name_len = php_com_saproxy_class_entry->name_length;

0 commit comments

Comments
 (0)