Signed-off-by: Michael Stefaniuc mstefani@winehq.org --- dlls/winhttp/cookie.c | 2 +- dlls/winhttp/net.c | 8 ++++---- dlls/winhttp/request.c | 6 +++--- dlls/winhttp/url.c | 2 +- 4 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/dlls/winhttp/cookie.c b/dlls/winhttp/cookie.c index e8cc89f948..59d098f047 100644 --- a/dlls/winhttp/cookie.c +++ b/dlls/winhttp/cookie.c @@ -312,7 +312,7 @@ BOOL add_cookie_headers( request_t *request ) if (strstrW( request->path, cookie->path ) == request->path) { const WCHAR cookieW[] = {'C','o','o','k','i','e',':',' '}; - int len, len_cookie = sizeof(cookieW) / sizeof(cookieW[0]), len_name = strlenW( cookie->name ); + int len, len_cookie = ARRAY_SIZE( cookieW ), len_name = strlenW( cookie->name ); WCHAR *header;
len = len_cookie + len_name; diff --git a/dlls/winhttp/net.c b/dlls/winhttp/net.c index 020ec5b04b..8f66847db6 100644 --- a/dlls/winhttp/net.c +++ b/dlls/winhttp/net.c @@ -397,7 +397,7 @@ static BOOL send_ssl_chunk(netconn_t *conn, const void *msg, size_t size) {conn->ssl_sizes.cbTrailer, SECBUFFER_STREAM_TRAILER, conn->ssl_buf+conn->ssl_sizes.cbHeader+size}, {0, SECBUFFER_EMPTY, NULL} }; - SecBufferDesc buf_desc = {SECBUFFER_VERSION, sizeof(bufs)/sizeof(*bufs), bufs}; + SecBufferDesc buf_desc = {SECBUFFER_VERSION, ARRAY_SIZE(bufs), bufs}; SECURITY_STATUS res;
memcpy(bufs[1].pvBuffer, msg, size); @@ -443,7 +443,7 @@ static BOOL read_ssl_chunk(netconn_t *conn, void *buf, SIZE_T buf_size, SIZE_T * { const SIZE_T ssl_buf_size = conn->ssl_sizes.cbHeader+conn->ssl_sizes.cbMaximumMessage+conn->ssl_sizes.cbTrailer; SecBuffer bufs[4]; - SecBufferDesc buf_desc = {SECBUFFER_VERSION, sizeof(bufs)/sizeof(*bufs), bufs}; + SecBufferDesc buf_desc = {SECBUFFER_VERSION, ARRAY_SIZE(bufs), bufs}; SSIZE_T size, buf_len; unsigned int i; SECURITY_STATUS res; @@ -499,7 +499,7 @@ static BOOL read_ssl_chunk(netconn_t *conn, void *buf, SIZE_T buf_size, SIZE_T * } } while(res != SEC_E_OK);
- for(i=0; i < sizeof(bufs)/sizeof(*bufs); i++) { + for(i = 0; i < ARRAY_SIZE(bufs); i++) { if(bufs[i].BufferType == SECBUFFER_DATA) { size = min(buf_size, bufs[i].cbBuffer); memcpy(buf, bufs[i].pvBuffer, size); @@ -516,7 +516,7 @@ static BOOL read_ssl_chunk(netconn_t *conn, void *buf, SIZE_T buf_size, SIZE_T * } }
- for(i=0; i < sizeof(bufs)/sizeof(*bufs); i++) { + for(i = 0; i < ARRAY_SIZE(bufs); i++) { if(bufs[i].BufferType == SECBUFFER_EXTRA) { conn->extra_buf = heap_alloc(bufs[i].cbBuffer); if(!conn->extra_buf) diff --git a/dlls/winhttp/request.c b/dlls/winhttp/request.c index 24e4b555d9..a365cdba48 100644 --- a/dlls/winhttp/request.c +++ b/dlls/winhttp/request.c @@ -747,7 +747,7 @@ static BOOL query_headers( request_t *request, DWORD level, LPCWSTR name, LPVOID return ret;
default: - if (attr >= sizeof(attribute_table)/sizeof(attribute_table[0]) || !attribute_table[attr]) + if (attr >= ARRAY_SIZE(attribute_table) || !attribute_table[attr]) { FIXME("attribute %u not implemented\n", attr); return FALSE; @@ -3120,7 +3120,7 @@ void release_typelib(void) { unsigned i;
- for (i = 0; i < sizeof(winhttp_typeinfo)/sizeof(*winhttp_typeinfo); i++) + for (i = 0; i < ARRAY_SIZE(winhttp_typeinfo); i++) if (winhttp_typeinfo[i]) ITypeInfo_Release(winhttp_typeinfo[i]);
@@ -3446,7 +3446,7 @@ static HRESULT WINAPI winhttp_request_Open( goto error; }
- len = sizeof(httpsW) / sizeof(WCHAR); + len = ARRAY_SIZE( httpsW ); if (uc.dwSchemeLength == len && !memcmp( uc.lpszScheme, httpsW, len * sizeof(WCHAR) )) { flags |= WINHTTP_FLAG_SECURE; diff --git a/dlls/winhttp/url.c b/dlls/winhttp/url.c index 9e040bcbff..1e481d7dec 100644 --- a/dlls/winhttp/url.c +++ b/dlls/winhttp/url.c @@ -479,7 +479,7 @@ BOOL WINAPI WinHttpCreateUrl( LPURL_COMPONENTS uc, DWORD flags, LPWSTR url, LPDW if (uc->lpszHostName) { memcpy( url, twoslashW, sizeof(twoslashW) ); - url += sizeof(twoslashW) / sizeof(twoslashW[0]); + url += ARRAY_SIZE( twoslashW ); } if (uc->lpszUserName) {