From 7ea305fe956c408933532ba14b84831d18fe1198 Mon Sep 17 00:00:00 2001 From: Daniel Collins Date: Tue, 12 Sep 2017 17:44:07 +0100 Subject: [PATCH] Clean up warnings about comparisons of distinct pointer types. --- src/winsock.c | 4 ++-- tests/ethernet.c | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/winsock.c b/src/winsock.c index 50e8796..e4a6b9d 100644 --- a/src/winsock.c +++ b/src/winsock.c @@ -184,7 +184,7 @@ static int do_EnumProtocols(LPINT protocols, LPVOID buf, LPDWORD bsptr, bool uni for(int i = 0; i < rval; ++i) { - if(pinfo[i].lpProtocol >= buf && pinfo[i].lpProtocol < (char*)(buf) + bufsize) + if(pinfo[i].lpProtocol >= (char*)(buf) && pinfo[i].lpProtocol < (char*)(buf) + bufsize) { name_buf_size += strsize(pinfo[i].lpProtocol, unicode); } @@ -199,7 +199,7 @@ static int do_EnumProtocols(LPINT protocols, LPVOID buf, LPDWORD bsptr, bool uni for(int i = 0, off = 0; i < rval; ++i) { - if(pinfo[i].lpProtocol >= buf && pinfo[i].lpProtocol < (char*)(buf) + bufsize) + if(pinfo[i].lpProtocol >= (char*)(buf) && pinfo[i].lpProtocol < (char*)(buf) + bufsize) { int len = strsize(pinfo[i].lpProtocol, unicode); diff --git a/tests/ethernet.c b/tests/ethernet.c index 6190abd..cb43fc0 100644 --- a/tests/ethernet.c +++ b/tests/ethernet.c @@ -33,9 +33,9 @@ const novell_ipx_packet *ipx; \ size_t ipx_len; \ \ - ok(func(&ipx, &ipx_len, FRAME, frame_len), #func "(<" desc ">) succeeds"); \ - ok((ipx == (FRAME + expect_ipx_off)), #func "(<" desc ">) returns the correct payload address"); \ - is_int(expect_ipx_len, ipx_len, #func "(<" desc ">) returns the correct payload length"); \ + ok(func(&ipx, &ipx_len, FRAME, frame_len), #func "(<" desc ">) succeeds"); \ + ok((ipx == (novell_ipx_packet*)(FRAME + expect_ipx_off)), #func "(<" desc ">) returns the correct payload address"); \ + is_int(expect_ipx_len, ipx_len, #func "(<" desc ">) returns the correct payload length"); \ } #define UNPACK_BAD_FRAME(func, desc, frame_len, ...) \