apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From traw...@apache.org
Subject svn commit: r1083227 - in /apr/apr/trunk: file_io/win32/filestat.c user/win32/userinfo.c
Date Sat, 19 Mar 2011 16:53:30 GMT
Author: trawick
Date: Sat Mar 19 16:53:29 2011
New Revision: 1083227

URL: http://svn.apache.org/viewvc?rev=1083227&view=rev
Log:
fix some gcc warnings on Windows

the return of APR_EGENERAL is to bypass a theoretical reference to an 
unset variable (sizelo) in a should-not-occur path, following an
existing example

Modified:
    apr/apr/trunk/file_io/win32/filestat.c
    apr/apr/trunk/user/win32/userinfo.c

Modified: apr/apr/trunk/file_io/win32/filestat.c
URL: http://svn.apache.org/viewvc/apr/apr/trunk/file_io/win32/filestat.c?rev=1083227&r1=1083226&r2=1083227&view=diff
==============================================================================
--- apr/apr/trunk/file_io/win32/filestat.c (original)
+++ apr/apr/trunk/file_io/win32/filestat.c Sat Mar 19 16:53:29 2011
@@ -268,7 +268,7 @@ apr_status_t more_finfo(apr_finfo_t *fin
                                  ((wanted & APR_FINFO_PROT) ? &dacl : NULL),
                                  NULL, &pdesc);
         else
-            return APR_INCOMPLETE;
+            return APR_INCOMPLETE; /* should not occur */
         if (rv == ERROR_SUCCESS)
             apr_pool_cleanup_register(finfo->pool, pdesc, free_localheap, 
                                  apr_pool_cleanup_null);
@@ -319,6 +319,8 @@ apr_status_t more_finfo(apr_finfo_t *fin
                 sizelo = GetCompressedFileSizeW((apr_wchar_t*)ufile, &sizehi);
             else if (whatfile == MORE_OF_FSPEC)
                 sizelo = GetCompressedFileSizeA((char*)ufile, &sizehi);
+            else
+                return APR_EGENERAL; /* should not occur */
         
             if (sizelo != INVALID_FILE_SIZE || GetLastError() == NO_ERROR) {
 #if APR_HAS_LARGE_FILES

Modified: apr/apr/trunk/user/win32/userinfo.c
URL: http://svn.apache.org/viewvc/apr/apr/trunk/user/win32/userinfo.c?rev=1083227&r1=1083226&r2=1083227&view=diff
==============================================================================
--- apr/apr/trunk/user/win32/userinfo.c (original)
+++ apr/apr/trunk/user/win32/userinfo.c Sat Mar 19 16:53:29 2011
@@ -46,7 +46,7 @@ static void get_sid_string(char *buf, ap
     sa  =  (DWORD)(psia->Value[1])        + ((DWORD)(psia->Value[0]) <<  8);
     if (sa) {
         slen = apr_snprintf(buf, blen, "S-%d-0x%04x%08x",
-                            SID_REVISION, sa, nsa);
+                            SID_REVISION, (unsigned int)sa, (unsigned int)nsa);
     } else {
         slen = apr_snprintf(buf, blen, "S-%d-%lu",
                             SID_REVISION, nsa);



Mime
View raw message