Permalink
Browse files

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


git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1083227 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information...
1 parent 33c353c commit 13b3efee1835b42d5b3cacad400e5f5fcb623961 @trawick trawick committed Mar 19, 2011
Showing with 4 additions and 2 deletions.
  1. +3 −1 file_io/win32/filestat.c
  2. +1 −1 user/win32/userinfo.c
@@ -268,7 +268,7 @@ apr_status_t more_finfo(apr_finfo_t *finfo, const void *ufile,
((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 *finfo, const void *ufile,
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
@@ -46,7 +46,7 @@ static void get_sid_string(char *buf, apr_size_t blen, apr_uid_t id)
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);

0 comments on commit 13b3efe

Please sign in to comment.