krnl386.exe16: Constify some variables

Andrew Talbot andrew.talbot at talbotville.com
Fri Sep 9 16:12:50 CDT 2011


Changelog: 
    krnl386.exe16: Constify some variables.

diff --git a/dlls/krnl386.exe16/ne_module.c b/dlls/krnl386.exe16/ne_module.c
index 95dcab8..2fd367a 100644
--- a/dlls/krnl386.exe16/ne_module.c
+++ b/dlls/krnl386.exe16/ne_module.c
@@ -963,8 +963,8 @@ static HINSTANCE16 MODULE_LoadModule16( LPCSTR libname, BOOL implicit, BOOL lib_
     NE_MODULE *pModule;
     const IMAGE_DOS_HEADER *descr = NULL;
     const char *file_name = NULL;
-    char dllname[32], *p;
-    const char *basename, *main_module;
+    char dllname[32];
+    const char *basename, *main_module, *p;
 
     /* strip path information */
 
@@ -975,12 +975,14 @@ static HINSTANCE16 MODULE_LoadModule16( LPCSTR libname, BOOL implicit, BOOL lib_
 
     if (strlen(basename) < sizeof(dllname)-6)
     {
+        char *q;
+
         strcpy( dllname, basename );
-        p = strrchr( dllname, '.' );
-        if (!p) strcat( dllname, ".dll" );
-        for (p = dllname; *p; p++) if (*p >= 'A' && *p <= 'Z') *p += 32;
+        q = strrchr( dllname, '.' );
+        if (!q) strcat( dllname, ".dll" );
+        for (q = dllname; *q; q++) if (*q >= 'A' && *q <= 'Z') *q += 32;
 
-        strcpy( p, "16" );
+        strcpy( q, "16" );
         if ((mod32 = LoadLibraryA( dllname )))
         {
             if (!(descr = (void *)GetProcAddress( mod32, "__wine_spec_dos_header" )))
diff --git a/dlls/krnl386.exe16/snoop.c b/dlls/krnl386.exe16/snoop.c
index 4b8477c..cef0fda 100644
--- a/dlls/krnl386.exe16/snoop.c
+++ b/dlls/krnl386.exe16/snoop.c
@@ -99,7 +99,8 @@ static	HANDLE16		xsnr = 0;
 void
 SNOOP16_RegisterDLL(HMODULE16 hModule,LPCSTR name) {
 	SNOOP16_DLL	**dll = &(firstdll);
-	char		*s;
+	const char	*p;
+	char		*q;
 
 	if (!TRACE_ON(snoop)) return;
 
@@ -146,11 +147,11 @@ SNOOP16_RegisterDLL(HMODULE16 hModule,LPCSTR name) {
 
 	(*dll)->next	= NULL;
 	(*dll)->hmod	= hModule;
-	if ((s=strrchr(name,'\\')))
-		name = s+1;
+	if ((p=strrchr(name,'\\')))
+		name = p+1;
 	strcpy( (*dll)->name, name );
-	if ((s=strrchr((*dll)->name,'.')))
-		*s='\0';
+	if ((q=strrchr((*dll)->name,'.')))
+		*q='\0';
 	(*dll)->funhandle = GlobalHandleToSel16(GLOBAL_Alloc(GMEM_ZEROINIT,65535,0,WINE_LDT_FLAGS_CODE));
 	(*dll)->funs = GlobalLock16((*dll)->funhandle);
 	if (!(*dll)->funs) {



More information about the wine-patches mailing list