kernel32: Cast-qual warning fix

Andrew Talbot Andrew.Talbot at talbotville.com
Wed Nov 1 15:36:32 CST 2006


May I get away with this? My rationale is that strchr() (with optimisation 
under gcc) will be inlined, and it only has to find the first character of a 
null-terminated string, so at least it should be quicker than copying the 
string. If rejecting, please tell me why on wine-devel.

Thanks,

-- Andy.
---
Changelog:
    kernel32: Cast-qual warning fix.

diff -urN a/dlls/kernel32/ne_module.c b/dlls/kernel32/ne_module.c
--- a/dlls/kernel32/ne_module.c	2006-10-13 11:27:18.000000000 +0100
+++ b/dlls/kernel32/ne_module.c	2006-11-01 19:29:27.000000000 +0000
@@ -1658,7 +1658,7 @@
 
     if ((name_beg == lpCmdLine) && (!args))
     { /* just use the original cmdline string as file name */
-        name = (LPSTR)lpCmdLine;
+        name = strchr(lpCmdLine, lpCmdLine[0]);
     }
     else
     {



More information about the wine-patches mailing list