tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mt...@apache.org
Subject svn commit: r1196297 - /tomcat/jk/trunk/native/iis/jk_isapi_plugin.c
Date Tue, 01 Nov 2011 21:39:42 GMT
Author: mturk
Date: Tue Nov  1 21:39:41 2011
New Revision: 1196297

URL: http://svn.apache.org/viewvc?rev=1196297&view=rev
Log:
Use size_t since we call the functions mostly with sizeof param. No functional change

Modified:
    tomcat/jk/trunk/native/iis/jk_isapi_plugin.c

Modified: tomcat/jk/trunk/native/iis/jk_isapi_plugin.c
URL: http://svn.apache.org/viewvc/tomcat/jk/trunk/native/iis/jk_isapi_plugin.c?rev=1196297&r1=1196296&r2=1196297&view=diff
==============================================================================
--- tomcat/jk/trunk/native/iis/jk_isapi_plugin.c (original)
+++ tomcat/jk/trunk/native/iis/jk_isapi_plugin.c Tue Nov  1 21:39:41 2011
@@ -577,14 +577,14 @@ static BOOL initialize_extension(void);
 static int read_registry_init_data(void);
 
 static int get_config_parameter(LPVOID src, const char *tag,
-                                char *val, DWORD sz);
+                                char *val, size_t sz);
 
 static int get_config_bool(LPVOID src, const char *tag, int def);
 
 static int get_config_int(LPVOID src, const char *tag, int def);
 
 static int get_registry_config_parameter(HKEY hkey,
-                                         const char *tag, char *b, DWORD sz);
+                                         const char *tag, char *b, size_t sz);
 
 static int get_registry_config_number(HKEY hkey, const char *tag,
                                       int *val);
@@ -2383,7 +2383,6 @@ BOOL WINAPI DllMain(HINSTANCE hInst,    
                     LPVOID lpReserved)  /* Reserved parameter for future use    */
 {
     int rc;
-    BOOL fReturn = TRUE;
     char fname[MAX_PATH];
 
     UNREFERENCED_PARAMETER(lpReserved);
@@ -2399,7 +2398,7 @@ BOOL WINAPI DllMain(HINSTANCE hInst,    
             }
             else {
                 /* Cannot obtain file name ? */
-                fReturn = JK_FALSE;
+                return FALSE;
             }
             if ((p = strrchr(fname, '\\'))) {
                 *(p++) = '\0';
@@ -2410,11 +2409,11 @@ BOOL WINAPI DllMain(HINSTANCE hInst,    
             }
             else {
                 /* Cannot obtain file name ? */
-                fReturn = JK_FALSE;
+                return JK_FALSE;
             }
         }
         else {
-            fReturn = JK_FALSE;
+            return JK_FALSE;
         }
         /* Construct redirector headers to use for this redirector instance */
         StringCbPrintf(URI_HEADER_NAME, RES_BUFFER_SIZE, HEADER_TEMPLATE, URI_HEADER_NAME_BASE,
hInst);
@@ -2446,7 +2445,7 @@ BOOL WINAPI DllMain(HINSTANCE hInst,    
         break;
     }
 
-    return fReturn;
+    return TRUE;
 }
 
 static DWORD WINAPI watchdog_thread(void *param)
@@ -2941,7 +2940,7 @@ static int read_registry_init_data(void)
 }
 
 static int get_config_parameter(LPVOID src, const char *tag,
-                                char *val, DWORD sz)
+                                char *val, size_t sz)
 {
     const char *tmp = NULL;
     if (using_ini_file) {
@@ -2990,15 +2989,14 @@ static int get_config_bool(LPVOID src, c
 }
 
 static int get_registry_config_parameter(HKEY hkey,
-                                         const char *tag, char *b, DWORD sz)
+                                         const char *tag, char *b, size_t sz)
 {
     DWORD type = 0;
-    LONG lrc;
-
-    sz = sz - 1; /* Reserve space for RegQueryValueEx to add null terminator */
-    b[sz] = '\0'; /* Null terminate in case RegQueryValueEx doesn't */
+    LONG  lrc;
+    DWORD ssz = (DWORD)sz -1;
 
-    lrc = RegQueryValueEx(hkey, tag, NULL, &type, (LPBYTE)b, &sz);
+    b[ssz] = '\0'; /* Null terminate in case RegQueryValueEx doesn't */
+    lrc = RegQueryValueEx(hkey, tag, NULL, &type, (LPBYTE)b, &ssz);
     if ((ERROR_SUCCESS != lrc) || (type != REG_SZ)) {
         return JK_FALSE;
     }



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Mime
View raw message