Commit 7b2c27aa authored by Andrew Talbot's avatar Andrew Talbot Committed by Alexandre Julliard

gdi32: Cast-qual warnings fix.

parent 3ac7720f
...@@ -114,7 +114,8 @@ INT16 WINAPI SetEnvironment16(LPCSTR lpPortName, LPDEVMODEA lpdev, UINT16 nCount ...@@ -114,7 +114,8 @@ INT16 WINAPI SetEnvironment16(LPCSTR lpPortName, LPDEVMODEA lpdev, UINT16 nCount
{ {
ATOM atom; ATOM atom;
BOOL16 nullport = FALSE; BOOL16 nullport = FALSE;
LPSTR p; LPCSTR port_name;
LPSTR device_mode;
ENVTABLE *env; ENVTABLE *env;
HGLOBAL16 handle; HGLOBAL16 handle;
...@@ -131,20 +132,20 @@ INT16 WINAPI SetEnvironment16(LPCSTR lpPortName, LPDEVMODEA lpdev, UINT16 nCount ...@@ -131,20 +132,20 @@ INT16 WINAPI SetEnvironment16(LPCSTR lpPortName, LPDEVMODEA lpdev, UINT16 nCount
} }
if (nCount) { /* store DEVMODE struct */ if (nCount) { /* store DEVMODE struct */
if (nullport) if (nullport)
p = (LPSTR)lpdev; port_name = (LPSTR)lpdev;
else else
p = (LPSTR)lpPortName; port_name = lpPortName;
if ((atom = PortNameToAtom(p, TRUE)) if ((atom = PortNameToAtom(port_name, TRUE))
&& (env = SearchEnvTable(0)) && (env = SearchEnvTable(0))
&& (handle = GlobalAlloc16(GMEM_SHARE|GMEM_MOVEABLE, nCount))) { && (handle = GlobalAlloc16(GMEM_SHARE|GMEM_MOVEABLE, nCount))) {
if (!(p = GlobalLock16(handle))) { if (!(device_mode = GlobalLock16(handle))) {
GlobalFree16(handle); GlobalFree16(handle);
return 0; return 0;
} }
env->atom = atom; env->atom = atom;
env->handle = handle; env->handle = handle;
memcpy(p, lpdev, nCount); memcpy(device_mode, lpdev, nCount);
GlobalUnlock16(handle); GlobalUnlock16(handle);
return handle; return handle;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment