Alexandre Julliard : Avoid sizeof in traces.
Alexandre Julliard
julliard at winehq.org
Thu Jan 24 07:21:22 CST 2008
Module: wine
Branch: master
Commit: e84daed48528063cdbc85e1f26edd8f90704978f
URL: http://source.winehq.org/git/wine.git/?a=commit;h=e84daed48528063cdbc85e1f26edd8f90704978f
Author: Alexandre Julliard <julliard at winehq.org>
Date: Thu Jan 24 14:03:10 2008 +0100
Avoid sizeof in traces.
---
dlls/advapi32/tests/service.c | 4 ++--
dlls/kernel32/tests/environ.c | 2 +-
dlls/wined3d/device.c | 16 ++++------------
3 files changed, 7 insertions(+), 15 deletions(-)
diff --git a/dlls/advapi32/tests/service.c b/dlls/advapi32/tests/service.c
index f0b7867..cf5b809 100644
--- a/dlls/advapi32/tests/service.c
+++ b/dlls/advapi32/tests/service.c
@@ -949,7 +949,7 @@ static void test_queryconfig2(void)
pConfig->lpDescription = (LPSTR)0xdeadbeef;
ret = pQueryServiceConfig2A(svc_handle, SERVICE_CONFIG_DESCRIPTION,buffer,sizeof(SERVICE_DESCRIPTIONA),&needed);
ok(ret, "expected QueryServiceConfig2A to succeed\n");
- ok(needed == sizeof(SERVICE_DESCRIPTIONA), "expected needed to be %d, got %d\n", sizeof(SERVICE_DESCRIPTIONA), needed);
+ ok(needed == sizeof(SERVICE_DESCRIPTIONA), "got %d\n", needed);
ok(!pConfig->lpDescription, "expected lpDescription to be NULL, got %p\n", pConfig->lpDescription);
SetLastError(0xdeadbeef);
@@ -957,7 +957,7 @@ static void test_queryconfig2(void)
ret = pQueryServiceConfig2A(svc_handle, SERVICE_CONFIG_DESCRIPTION,NULL,0,&needed);
ok(!ret, "expected QueryServiceConfig2A to fail\n");
ok(ERROR_INSUFFICIENT_BUFFER == GetLastError(), "expected error ERROR_INSUFFICIENT_BUFFER, got %d\n", GetLastError());
- ok(needed == sizeof(SERVICE_DESCRIPTIONA), "expected needed to be %d, got %d\n", sizeof(SERVICE_DESCRIPTIONA), needed);
+ ok(needed == sizeof(SERVICE_DESCRIPTIONA), "got %d\n", needed);
if(!pChangeServiceConfig2A)
{
diff --git a/dlls/kernel32/tests/environ.c b/dlls/kernel32/tests/environ.c
index 632e3bc..3088e92 100644
--- a/dlls/kernel32/tests/environ.c
+++ b/dlls/kernel32/tests/environ.c
@@ -284,7 +284,7 @@ static void test_ExpandEnvironmentStringsA(void)
strcpy(buf, "Indirect-%IndirectVar%-Indirect");
strcpy(buf2, "Indirect-Foo%EnvVar%Bar-Indirect");
ret_size = ExpandEnvironmentStringsA(buf, buf1, sizeof(buf1));
- ok(ret_size == strlen(buf2)+1, "ExpandEnvironmentStrings returned %d instead of %d\n", ret_size, strlen(buf2)+1);
+ ok(ret_size == strlen(buf2)+1, "ExpandEnvironmentStrings returned %d instead of %d\n", ret_size, lstrlen(buf2)+1);
ok(!strcmp(buf1, buf2), "ExpandEnvironmentStrings returned [%s]\n", buf1);
SetEnvironmentVariableA("IndirectVar", NULL);
diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
index d8e530b..742734c 100644
--- a/dlls/wined3d/device.c
+++ b/dlls/wined3d/device.c
@@ -3185,9 +3185,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_SetSamplerState(IWineD3DDevice *iface,
}
if (Sampler >= sizeof(This->stateBlock->samplerState)/sizeof(This->stateBlock->samplerState[0])) {
- ERR("Current Sampler overflows sampleState0 array (sampler %d vs size %d)\n", Sampler,
- sizeof(This->stateBlock->samplerState)/sizeof(This->stateBlock->samplerState[0])
- );
+ ERR("Current Sampler overflows sampleState0 array (sampler %d)\n", Sampler);
return WINED3D_OK; /* Windows accepts overflowing this array ... we do not. */
}
/**
@@ -3236,9 +3234,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_GetSamplerState(IWineD3DDevice *iface,
}
if (Sampler >= sizeof(This->stateBlock->samplerState)/sizeof(This->stateBlock->samplerState[0])) {
- ERR("Current Sampler overflows sampleState0 array (sampler %d vs size %d)\n", Sampler,
- sizeof(This->stateBlock->samplerState)/sizeof(This->stateBlock->samplerState[0])
- );
+ ERR("Current Sampler overflows sampleState0 array (sampler %d)\n", Sampler);
return WINED3D_OK; /* Windows accepts overflowing this array ... we do not. */
}
*Value = This->stateBlock->samplerState[Sampler][Type];
@@ -4417,9 +4413,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_SetTexture(IWineD3DDevice *iface, DWORD
}
if (Stage >= sizeof(This->stateBlock->textures)/sizeof(This->stateBlock->textures[0])) {
- ERR("Current stage overflows textures array (stage %d vs size %d)\n", Stage,
- sizeof(This->stateBlock->textures)/sizeof(This->stateBlock->textures[0])
- );
+ ERR("Current stage overflows textures array (stage %d)\n", Stage);
return WINED3D_OK; /* Windows accepts overflowing this array ... we do not. */
}
@@ -4516,9 +4510,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_GetTexture(IWineD3DDevice *iface, DWORD
}
if (Stage >= sizeof(This->stateBlock->textures)/sizeof(This->stateBlock->textures[0])) {
- ERR("Current stage overflows textures array (stage %d vs size %d)\n", Stage,
- sizeof(This->stateBlock->textures)/sizeof(This->stateBlock->textures[0])
- );
+ ERR("Current stage overflows textures array (stage %d)\n", Stage);
return WINED3D_OK; /* Windows accepts overflowing this array ... we do not. */
}
More information about the wine-cvs
mailing list