Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
e84daed4
Commit
e84daed4
authored
Jan 24, 2008
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Avoid sizeof in traces.
parent
7645f321
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
15 deletions
+7
-15
service.c
dlls/advapi32/tests/service.c
+2
-2
environ.c
dlls/kernel32/tests/environ.c
+1
-1
device.c
dlls/wined3d/device.c
+4
-12
No files found.
dlls/advapi32/tests/service.c
View file @
e84daed4
...
@@ -949,7 +949,7 @@ static void test_queryconfig2(void)
...
@@ -949,7 +949,7 @@ static void test_queryconfig2(void)
pConfig
->
lpDescription
=
(
LPSTR
)
0xdeadbeef
;
pConfig
->
lpDescription
=
(
LPSTR
)
0xdeadbeef
;
ret
=
pQueryServiceConfig2A
(
svc_handle
,
SERVICE_CONFIG_DESCRIPTION
,
buffer
,
sizeof
(
SERVICE_DESCRIPTIONA
),
&
needed
);
ret
=
pQueryServiceConfig2A
(
svc_handle
,
SERVICE_CONFIG_DESCRIPTION
,
buffer
,
sizeof
(
SERVICE_DESCRIPTIONA
),
&
needed
);
ok
(
ret
,
"expected QueryServiceConfig2A to succeed
\n
"
);
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
);
ok
(
!
pConfig
->
lpDescription
,
"expected lpDescription to be NULL, got %p
\n
"
,
pConfig
->
lpDescription
);
SetLastError
(
0xdeadbeef
);
SetLastError
(
0xdeadbeef
);
...
@@ -957,7 +957,7 @@ static void test_queryconfig2(void)
...
@@ -957,7 +957,7 @@ static void test_queryconfig2(void)
ret
=
pQueryServiceConfig2A
(
svc_handle
,
SERVICE_CONFIG_DESCRIPTION
,
NULL
,
0
,
&
needed
);
ret
=
pQueryServiceConfig2A
(
svc_handle
,
SERVICE_CONFIG_DESCRIPTION
,
NULL
,
0
,
&
needed
);
ok
(
!
ret
,
"expected QueryServiceConfig2A to fail
\n
"
);
ok
(
!
ret
,
"expected QueryServiceConfig2A to fail
\n
"
);
ok
(
ERROR_INSUFFICIENT_BUFFER
==
GetLastError
(),
"expected error ERROR_INSUFFICIENT_BUFFER, got %d
\n
"
,
GetLastError
());
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
)
if
(
!
pChangeServiceConfig2A
)
{
{
...
...
dlls/kernel32/tests/environ.c
View file @
e84daed4
...
@@ -284,7 +284,7 @@ static void test_ExpandEnvironmentStringsA(void)
...
@@ -284,7 +284,7 @@ static void test_ExpandEnvironmentStringsA(void)
strcpy
(
buf
,
"Indirect-%IndirectVar%-Indirect"
);
strcpy
(
buf
,
"Indirect-%IndirectVar%-Indirect"
);
strcpy
(
buf2
,
"Indirect-Foo%EnvVar%Bar-Indirect"
);
strcpy
(
buf2
,
"Indirect-Foo%EnvVar%Bar-Indirect"
);
ret_size
=
ExpandEnvironmentStringsA
(
buf
,
buf1
,
sizeof
(
buf1
));
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
,
l
strlen
(
buf2
)
+
1
);
ok
(
!
strcmp
(
buf1
,
buf2
),
"ExpandEnvironmentStrings returned [%s]
\n
"
,
buf1
);
ok
(
!
strcmp
(
buf1
,
buf2
),
"ExpandEnvironmentStrings returned [%s]
\n
"
,
buf1
);
SetEnvironmentVariableA
(
"IndirectVar"
,
NULL
);
SetEnvironmentVariableA
(
"IndirectVar"
,
NULL
);
...
...
dlls/wined3d/device.c
View file @
e84daed4
...
@@ -3185,9 +3185,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_SetSamplerState(IWineD3DDevice *iface,
...
@@ -3185,9 +3185,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_SetSamplerState(IWineD3DDevice *iface,
}
}
if
(
Sampler
>=
sizeof
(
This
->
stateBlock
->
samplerState
)
/
sizeof
(
This
->
stateBlock
->
samplerState
[
0
]))
{
if
(
Sampler
>=
sizeof
(
This
->
stateBlock
->
samplerState
)
/
sizeof
(
This
->
stateBlock
->
samplerState
[
0
]))
{
ERR
(
"Current Sampler overflows sampleState0 array (sampler %d vs size %d)
\n
"
,
Sampler
,
ERR
(
"Current Sampler overflows sampleState0 array (sampler %d)
\n
"
,
Sampler
);
sizeof
(
This
->
stateBlock
->
samplerState
)
/
sizeof
(
This
->
stateBlock
->
samplerState
[
0
])
);
return
WINED3D_OK
;
/* Windows accepts overflowing this array ... we do not. */
return
WINED3D_OK
;
/* Windows accepts overflowing this array ... we do not. */
}
}
/**
/**
...
@@ -3236,9 +3234,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_GetSamplerState(IWineD3DDevice *iface,
...
@@ -3236,9 +3234,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_GetSamplerState(IWineD3DDevice *iface,
}
}
if
(
Sampler
>=
sizeof
(
This
->
stateBlock
->
samplerState
)
/
sizeof
(
This
->
stateBlock
->
samplerState
[
0
]))
{
if
(
Sampler
>=
sizeof
(
This
->
stateBlock
->
samplerState
)
/
sizeof
(
This
->
stateBlock
->
samplerState
[
0
]))
{
ERR
(
"Current Sampler overflows sampleState0 array (sampler %d vs size %d)
\n
"
,
Sampler
,
ERR
(
"Current Sampler overflows sampleState0 array (sampler %d)
\n
"
,
Sampler
);
sizeof
(
This
->
stateBlock
->
samplerState
)
/
sizeof
(
This
->
stateBlock
->
samplerState
[
0
])
);
return
WINED3D_OK
;
/* Windows accepts overflowing this array ... we do not. */
return
WINED3D_OK
;
/* Windows accepts overflowing this array ... we do not. */
}
}
*
Value
=
This
->
stateBlock
->
samplerState
[
Sampler
][
Type
];
*
Value
=
This
->
stateBlock
->
samplerState
[
Sampler
][
Type
];
...
@@ -4417,9 +4413,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_SetTexture(IWineD3DDevice *iface, DWORD
...
@@ -4417,9 +4413,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_SetTexture(IWineD3DDevice *iface, DWORD
}
}
if
(
Stage
>=
sizeof
(
This
->
stateBlock
->
textures
)
/
sizeof
(
This
->
stateBlock
->
textures
[
0
]))
{
if
(
Stage
>=
sizeof
(
This
->
stateBlock
->
textures
)
/
sizeof
(
This
->
stateBlock
->
textures
[
0
]))
{
ERR
(
"Current stage overflows textures array (stage %d vs size %d)
\n
"
,
Stage
,
ERR
(
"Current stage overflows textures array (stage %d)
\n
"
,
Stage
);
sizeof
(
This
->
stateBlock
->
textures
)
/
sizeof
(
This
->
stateBlock
->
textures
[
0
])
);
return
WINED3D_OK
;
/* Windows accepts overflowing this array ... we do not. */
return
WINED3D_OK
;
/* Windows accepts overflowing this array ... we do not. */
}
}
...
@@ -4516,9 +4510,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_GetTexture(IWineD3DDevice *iface, DWORD
...
@@ -4516,9 +4510,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_GetTexture(IWineD3DDevice *iface, DWORD
}
}
if
(
Stage
>=
sizeof
(
This
->
stateBlock
->
textures
)
/
sizeof
(
This
->
stateBlock
->
textures
[
0
]))
{
if
(
Stage
>=
sizeof
(
This
->
stateBlock
->
textures
)
/
sizeof
(
This
->
stateBlock
->
textures
[
0
]))
{
ERR
(
"Current stage overflows textures array (stage %d vs size %d)
\n
"
,
Stage
,
ERR
(
"Current stage overflows textures array (stage %d)
\n
"
,
Stage
);
sizeof
(
This
->
stateBlock
->
textures
)
/
sizeof
(
This
->
stateBlock
->
textures
[
0
])
);
return
WINED3D_OK
;
/* Windows accepts overflowing this array ... we do not. */
return
WINED3D_OK
;
/* Windows accepts overflowing this array ... we do not. */
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment