Skip to content

Commit 26bf239

Browse files
authored
Resolve -Wincompatible-pointer-types warnings (phpGH-17456)
The phpdbg issue is a real issue, although it's unlikely that harm can be done due to stack alignment and little-endianess. The others seem to be more cosmetic.
1 parent f99d620 commit 26bf239

File tree

6 files changed

+11
-11
lines changed

6 files changed

+11
-11
lines changed

ext/com_dotnet/com_com.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,7 @@ PHP_FUNCTION(com_get_active_object)
306306
if (FAILED(res)) {
307307
php_com_throw_exception(res, NULL);
308308
} else {
309-
res = IUnknown_QueryInterface(unk, &IID_IDispatch, &obj);
309+
res = IUnknown_QueryInterface(unk, &IID_IDispatch, (void **) &obj);
310310

311311
if (FAILED(res)) {
312312
php_com_throw_exception(res, NULL);

ext/com_dotnet/com_dotnet.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,7 @@ PHP_METHOD(dotnet, __construct)
303303
IObjectHandle *handle = NULL;
304304

305305
where = "QI: IObjectHandle";
306-
hr = IUnknown_QueryInterface(unk, &IID_IObjectHandle, &handle);
306+
hr = IUnknown_QueryInterface(unk, &IID_IObjectHandle, (void**) &handle);
307307

308308
if (SUCCEEDED(hr)) {
309309
where = "IObjectHandle_Unwrap";
@@ -312,7 +312,7 @@ PHP_METHOD(dotnet, __construct)
312312

313313
if (V_VT(&unwrapped) == VT_UNKNOWN) {
314314
where = "Unwrapped, QI for IDispatch";
315-
hr = IUnknown_QueryInterface(V_UNKNOWN(&unwrapped), &IID_IDispatch, &V_DISPATCH(&obj->v));
315+
hr = IUnknown_QueryInterface(V_UNKNOWN(&unwrapped), &IID_IDispatch, (void **) &V_DISPATCH(&obj->v));
316316

317317
if (SUCCEEDED(hr)) {
318318
V_VT(&obj->v) = VT_DISPATCH;

ext/com_dotnet/com_persist.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -290,23 +290,23 @@ static zend_class_entry *helper_ce;
290290
static inline HRESULT get_persist_stream(php_com_persist_helper *helper)
291291
{
292292
if (!helper->ips && helper->unk) {
293-
return IUnknown_QueryInterface(helper->unk, &IID_IPersistStream, &helper->ips);
293+
return IUnknown_QueryInterface(helper->unk, &IID_IPersistStream, (void **) &helper->ips);
294294
}
295295
return helper->ips ? S_OK : E_NOTIMPL;
296296
}
297297

298298
static inline HRESULT get_persist_stream_init(php_com_persist_helper *helper)
299299
{
300300
if (!helper->ipsi && helper->unk) {
301-
return IUnknown_QueryInterface(helper->unk, &IID_IPersistStreamInit, &helper->ipsi);
301+
return IUnknown_QueryInterface(helper->unk, &IID_IPersistStreamInit, (void **) &helper->ipsi);
302302
}
303303
return helper->ipsi ? S_OK : E_NOTIMPL;
304304
}
305305

306306
static inline HRESULT get_persist_file(php_com_persist_helper *helper)
307307
{
308308
if (!helper->ipf && helper->unk) {
309-
return IUnknown_QueryInterface(helper->unk, &IID_IPersistFile, &helper->ipf);
309+
return IUnknown_QueryInterface(helper->unk, &IID_IPersistFile, (void **) &helper->ipf);
310310
}
311311
return helper->ipf ? S_OK : E_NOTIMPL;
312312
}
@@ -545,7 +545,7 @@ CPH_METHOD(LoadFromStream)
545545
IDispatch *disp = NULL;
546546

547547
/* we need to create an object and load using OleLoadFromStream */
548-
res = OleLoadFromStream(stm, &IID_IDispatch, &disp);
548+
res = OleLoadFromStream(stm, &IID_IDispatch, (void **) &disp);
549549

550550
if (SUCCEEDED(res)) {
551551
php_com_wrap_dispatch(return_value, disp, COMG(code_page));

ext/com_dotnet/com_variant.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ static void safe_array_from_zval(VARIANT *v, zval *z, int codepage)
6060
sa = SafeArrayCreate(VT_VARIANT, 1, &bound);
6161

6262
/* get a lock on the array itself */
63-
SafeArrayAccessData(sa, &va);
63+
SafeArrayAccessData(sa, (void **) &va);
6464
va = (VARIANT*)sa->pvData;
6565

6666
/* now fill it in */
@@ -247,7 +247,7 @@ PHP_COM_DOTNET_API zend_result php_com_zval_from_variant(zval *z, VARIANT *v, in
247247
if (V_UNKNOWN(v) != NULL) {
248248
IDispatch *disp;
249249

250-
if (SUCCEEDED(IUnknown_QueryInterface(V_UNKNOWN(v), &IID_IDispatch, &disp))) {
250+
if (SUCCEEDED(IUnknown_QueryInterface(V_UNKNOWN(v), &IID_IDispatch, (void **) &disp))) {
251251
php_com_wrap_dispatch(z, disp, codepage);
252252
IDispatch_Release(disp);
253253
} else {

ext/opcache/shared_alloc_win32.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ static void *mapping_base;
4747
static void zend_win_error_message(int type, char *msg, int err)
4848
{
4949
HANDLE h;
50-
char *ev_msgs[2];
50+
const char *ev_msgs[2];
5151
char *buf = php_win32_error_to_msg(err);
5252

5353
h = RegisterEventSource(NULL, TEXT(ACCEL_EVENT_SOURCE));

sapi/phpdbg/phpdbg_win.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
#include "phpdbg.h"
2121

2222
int mprotect(void *addr, size_t size, int protection) {
23-
int var;
23+
DWORD var;
2424
return (int)VirtualProtect(addr, size, protection == (PROT_READ | PROT_WRITE) ? PAGE_READWRITE : PAGE_READONLY, &var);
2525
}
2626

0 commit comments

Comments
 (0)