You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@apr.apache.org by tr...@apache.org on 2011/03/21 18:04:18 UTC

svn commit: r1083870 - in /apr/apr/branches/1.4.x: ./ file_io/win32/ misc/unix/ network_io/win32/ test/ threadproc/win32/ time/win32/ user/win32/

Author: trawick
Date: Mon Mar 21 17:04:17 2011
New Revision: 1083870

URL: http://svn.apache.org/viewvc?rev=1083870&view=rev
Log:
merge trunk revs 1083169, 1083177, 1083178, 1083183, and 1083227
to resolve some gcc warnings and dead code on Windows

(the testlfsabi change from r1083183 is omitted, as the testcases
aren't in this branch)

Removed:
    apr/apr/branches/1.4.x/time/win32/access.c
Modified:
    apr/apr/branches/1.4.x/apr.dsp
    apr/apr/branches/1.4.x/file_io/win32/filestat.c
    apr/apr/branches/1.4.x/libapr.dsp
    apr/apr/branches/1.4.x/misc/unix/errorcodes.c
    apr/apr/branches/1.4.x/network_io/win32/sendrecv.c
    apr/apr/branches/1.4.x/test/testrand.c
    apr/apr/branches/1.4.x/test/testshm.c
    apr/apr/branches/1.4.x/threadproc/win32/signals.c
    apr/apr/branches/1.4.x/threadproc/win32/threadpriv.c
    apr/apr/branches/1.4.x/time/win32/timestr.c
    apr/apr/branches/1.4.x/user/win32/groupinfo.c
    apr/apr/branches/1.4.x/user/win32/userinfo.c

Modified: apr/apr/branches/1.4.x/apr.dsp
URL: http://svn.apache.org/viewvc/apr/apr/branches/1.4.x/apr.dsp?rev=1083870&r1=1083869&r2=1083870&view=diff
==============================================================================
--- apr/apr/branches/1.4.x/apr.dsp (original)
+++ apr/apr/branches/1.4.x/apr.dsp Mon Mar 21 17:04:17 2011
@@ -520,10 +520,6 @@ SOURCE=.\threadproc\win32\threadpriv.c
 # PROP Default_Filter ""
 # Begin Source File
 
-SOURCE=.\time\win32\access.c
-# End Source File
-# Begin Source File
-
 SOURCE=.\time\win32\time.c
 # End Source File
 # Begin Source File

Modified: apr/apr/branches/1.4.x/file_io/win32/filestat.c
URL: http://svn.apache.org/viewvc/apr/apr/branches/1.4.x/file_io/win32/filestat.c?rev=1083870&r1=1083869&r2=1083870&view=diff
==============================================================================
--- apr/apr/branches/1.4.x/file_io/win32/filestat.c (original)
+++ apr/apr/branches/1.4.x/file_io/win32/filestat.c Mon Mar 21 17:04:17 2011
@@ -97,7 +97,7 @@ static void resolve_prot(apr_finfo_t *fi
      * there is no reason for os_level testing here.
      */
     if ((wanted & APR_FINFO_WPROT) && !worldid) {
-        SID_IDENTIFIER_AUTHORITY SIDAuth = SECURITY_WORLD_SID_AUTHORITY;
+        SID_IDENTIFIER_AUTHORITY SIDAuth = {SECURITY_WORLD_SID_AUTHORITY};
         if (AllocateAndInitializeSid(&SIDAuth, 1, SECURITY_WORLD_RID,
                                      0, 0, 0, 0, 0, 0, 0, &worldid))
             atexit(free_world);
@@ -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/branches/1.4.x/libapr.dsp
URL: http://svn.apache.org/viewvc/apr/apr/branches/1.4.x/libapr.dsp?rev=1083870&r1=1083869&r2=1083870&view=diff
==============================================================================
--- apr/apr/branches/1.4.x/libapr.dsp (original)
+++ apr/apr/branches/1.4.x/libapr.dsp Mon Mar 21 17:04:17 2011
@@ -572,10 +572,6 @@ SOURCE=.\threadproc\win32\threadpriv.c
 # PROP Default_Filter ""
 # Begin Source File
 
-SOURCE=.\time\win32\access.c
-# End Source File
-# Begin Source File
-
 SOURCE=.\time\win32\time.c
 # End Source File
 # Begin Source File

Modified: apr/apr/branches/1.4.x/misc/unix/errorcodes.c
URL: http://svn.apache.org/viewvc/apr/apr/branches/1.4.x/misc/unix/errorcodes.c?rev=1083870&r1=1083869&r2=1083870&view=diff
==============================================================================
--- apr/apr/branches/1.4.x/misc/unix/errorcodes.c (original)
+++ apr/apr/branches/1.4.x/misc/unix/errorcodes.c Mon Mar 21 17:04:17 2011
@@ -189,56 +189,56 @@ static const struct {
     apr_status_t code;
     const char *msg;
 } gaErrorList[] = {
-    WSAEINTR,           "Interrupted system call",
-    WSAEBADF,           "Bad file number",
-    WSAEACCES,          "Permission denied",
-    WSAEFAULT,          "Bad address",
-    WSAEINVAL,          "Invalid argument",
-    WSAEMFILE,          "Too many open sockets",
-    WSAEWOULDBLOCK,     "Operation would block",
-    WSAEINPROGRESS,     "Operation now in progress",
-    WSAEALREADY,        "Operation already in progress",
-    WSAENOTSOCK,        "Socket operation on non-socket",
-    WSAEDESTADDRREQ,    "Destination address required",
-    WSAEMSGSIZE,        "Message too long",
-    WSAEPROTOTYPE,      "Protocol wrong type for socket",
-    WSAENOPROTOOPT,     "Bad protocol option",
-    WSAEPROTONOSUPPORT, "Protocol not supported",
-    WSAESOCKTNOSUPPORT, "Socket type not supported",
-    WSAEOPNOTSUPP,      "Operation not supported on socket",
-    WSAEPFNOSUPPORT,    "Protocol family not supported",
-    WSAEAFNOSUPPORT,    "Address family not supported",
-    WSAEADDRINUSE,      "Address already in use",
-    WSAEADDRNOTAVAIL,   "Can't assign requested address",
-    WSAENETDOWN,        "Network is down",
-    WSAENETUNREACH,     "Network is unreachable",
-    WSAENETRESET,       "Net connection reset",
-    WSAECONNABORTED,    "Software caused connection abort",
-    WSAECONNRESET,      "Connection reset by peer",
-    WSAENOBUFS,         "No buffer space available",
-    WSAEISCONN,         "Socket is already connected",
-    WSAENOTCONN,        "Socket is not connected",
-    WSAESHUTDOWN,       "Can't send after socket shutdown",
-    WSAETOOMANYREFS,    "Too many references, can't splice",
-    WSAETIMEDOUT,       "Connection timed out",
-    WSAECONNREFUSED,    "Connection refused",
-    WSAELOOP,           "Too many levels of symbolic links",
-    WSAENAMETOOLONG,    "File name too long",
-    WSAEHOSTDOWN,       "Host is down",
-    WSAEHOSTUNREACH,    "No route to host",
-    WSAENOTEMPTY,       "Directory not empty",
-    WSAEPROCLIM,        "Too many processes",
-    WSAEUSERS,          "Too many users",
-    WSAEDQUOT,          "Disc quota exceeded",
-    WSAESTALE,          "Stale NFS file handle",
-    WSAEREMOTE,         "Too many levels of remote in path",
-    WSASYSNOTREADY,     "Network system is unavailable",
-    WSAVERNOTSUPPORTED, "Winsock version out of range",
-    WSANOTINITIALISED,  "WSAStartup not yet called",
-    WSAEDISCON,         "Graceful shutdown in progress",
-    WSAHOST_NOT_FOUND,  "Host not found",
-    WSANO_DATA,         "No host data of that type was found",
-    0,                  NULL
+    {WSAEINTR,           "Interrupted system call"},
+    {WSAEBADF,           "Bad file number"},
+    {WSAEACCES,          "Permission denied"},
+    {WSAEFAULT,          "Bad address"},
+    {WSAEINVAL,          "Invalid argument"},
+    {WSAEMFILE,          "Too many open sockets"},
+    {WSAEWOULDBLOCK,     "Operation would block"},
+    {WSAEINPROGRESS,     "Operation now in progress"},
+    {WSAEALREADY,        "Operation already in progress"},
+    {WSAENOTSOCK,        "Socket operation on non-socket"},
+    {WSAEDESTADDRREQ,    "Destination address required"},
+    {WSAEMSGSIZE,        "Message too long"},
+    {WSAEPROTOTYPE,      "Protocol wrong type for socket"},
+    {WSAENOPROTOOPT,     "Bad protocol option"},
+    {WSAEPROTONOSUPPORT, "Protocol not supported"},
+    {WSAESOCKTNOSUPPORT, "Socket type not supported"},
+    {WSAEOPNOTSUPP,      "Operation not supported on socket"},
+    {WSAEPFNOSUPPORT,    "Protocol family not supported"},
+    {WSAEAFNOSUPPORT,    "Address family not supported"},
+    {WSAEADDRINUSE,      "Address already in use"},
+    {WSAEADDRNOTAVAIL,   "Can't assign requested address"},
+    {WSAENETDOWN,        "Network is down"},
+    {WSAENETUNREACH,     "Network is unreachable"},
+    {WSAENETRESET,       "Net connection reset"},
+    {WSAECONNABORTED,    "Software caused connection abort"},
+    {WSAECONNRESET,      "Connection reset by peer"},
+    {WSAENOBUFS,         "No buffer space available"},
+    {WSAEISCONN,         "Socket is already connected"},
+    {WSAENOTCONN,        "Socket is not connected"},
+    {WSAESHUTDOWN,       "Can't send after socket shutdown"},
+    {WSAETOOMANYREFS,    "Too many references, can't splice"},
+    {WSAETIMEDOUT,       "Connection timed out"},
+    {WSAECONNREFUSED,    "Connection refused"},
+    {WSAELOOP,           "Too many levels of symbolic links"},
+    {WSAENAMETOOLONG,    "File name too long"},
+    {WSAEHOSTDOWN,       "Host is down"},
+    {WSAEHOSTUNREACH,    "No route to host"},
+    {WSAENOTEMPTY,       "Directory not empty"},
+    {WSAEPROCLIM,        "Too many processes"},
+    {WSAEUSERS,          "Too many users"},
+    {WSAEDQUOT,          "Disc quota exceeded"},
+    {WSAESTALE,          "Stale NFS file handle"},
+    {WSAEREMOTE,         "Too many levels of remote in path"},
+    {WSASYSNOTREADY,     "Network system is unavailable"},
+    {WSAVERNOTSUPPORTED, "Winsock version out of range"},
+    {WSANOTINITIALISED,  "WSAStartup not yet called"},
+    {WSAEDISCON,         "Graceful shutdown in progress"},
+    {WSAHOST_NOT_FOUND,  "Host not found"},
+    {WSANO_DATA,         "No host data of that type was found"},
+    {0,                  NULL}
 };
 
 

Modified: apr/apr/branches/1.4.x/network_io/win32/sendrecv.c
URL: http://svn.apache.org/viewvc/apr/apr/branches/1.4.x/network_io/win32/sendrecv.c?rev=1083870&r1=1083869&r2=1083870&view=diff
==============================================================================
--- apr/apr/branches/1.4.x/network_io/win32/sendrecv.c (original)
+++ apr/apr/branches/1.4.x/network_io/win32/sendrecv.c Mon Mar 21 17:04:17 2011
@@ -210,6 +210,7 @@ APR_DECLARE(apr_status_t) apr_socket_rec
 }
 
 
+#if APR_HAS_SENDFILE
 static apr_status_t collapse_iovec(char **off, apr_size_t *len, 
                                    struct iovec *iovec, int numvec, 
                                    char *buf, apr_size_t buflen)
@@ -240,7 +241,6 @@ static apr_status_t collapse_iovec(char 
 }
 
 
-#if APR_HAS_SENDFILE
 /*
  * apr_status_t apr_socket_sendfile(apr_socket_t *, apr_file_t *, apr_hdtr_t *, 
  *                                 apr_off_t *, apr_size_t *, apr_int32_t flags)

Modified: apr/apr/branches/1.4.x/test/testrand.c
URL: http://svn.apache.org/viewvc/apr/apr/branches/1.4.x/test/testrand.c?rev=1083870&r1=1083869&r2=1083870&view=diff
==============================================================================
--- apr/apr/branches/1.4.x/test/testrand.c (original)
+++ apr/apr/branches/1.4.x/test/testrand.c Mon Mar 21 17:04:17 2011
@@ -63,6 +63,7 @@ static void rand_run_kat(abts_case *tc, 
     }
 }
 
+#if APR_HAS_FORK
 static int rand_check_kat(rnd_fn *f, apr_random_t *r,
                           const unsigned char expected[128])
 {
@@ -76,6 +77,7 @@ static int rand_check_kat(rnd_fn *f, apr
         return 1;
     return 0;
 }
+#endif
 
 static void rand_add_zeroes(apr_random_t *r)
 {

Modified: apr/apr/branches/1.4.x/test/testshm.c
URL: http://svn.apache.org/viewvc/apr/apr/branches/1.4.x/test/testshm.c?rev=1083870&r1=1083869&r2=1083870&view=diff
==============================================================================
--- apr/apr/branches/1.4.x/test/testshm.c (original)
+++ apr/apr/branches/1.4.x/test/testshm.c Mon Mar 21 17:04:17 2011
@@ -31,6 +31,7 @@
 
 #if APR_HAS_SHARED_MEMORY
 
+#if APR_HAS_FORK
 static int msgwait(int sleep_sec, int first_box, int last_box)
 {
     int i;
@@ -58,6 +59,7 @@ static void msgput(int boxnum, char *msg
     apr_cpystrn(boxes[boxnum].msg, msg, strlen(msg) + 1);
     boxes[boxnum].msgavail = 1;
 }
+#endif /* APR_HAS_FORK */
 
 static void test_anon_create(abts_case *tc, void *data)
 {

Modified: apr/apr/branches/1.4.x/threadproc/win32/signals.c
URL: http://svn.apache.org/viewvc/apr/apr/branches/1.4.x/threadproc/win32/signals.c?rev=1083870&r1=1083869&r2=1083870&view=diff
==============================================================================
--- apr/apr/branches/1.4.x/threadproc/win32/signals.c (original)
+++ apr/apr/branches/1.4.x/threadproc/win32/signals.c Mon Mar 21 17:04:17 2011
@@ -17,6 +17,7 @@
 #include "apr_arch_threadproc.h"
 #include "apr_arch_file_io.h"
 #include "apr_thread_proc.h"
+#include "apr_signal.h"
 #include "apr_file_io.h"
 #include "apr_general.h"
 #if APR_HAVE_SIGNAL_H
@@ -50,7 +51,7 @@ void apr_signal_init(apr_pool_t *pglobal
 {
 }
 
-const char *apr_signal_description_get(int signum)
+APR_DECLARE(const char *) apr_signal_description_get(int signum)
 {
     return "unknown signal (not supported)";
 }

Modified: apr/apr/branches/1.4.x/threadproc/win32/threadpriv.c
URL: http://svn.apache.org/viewvc/apr/apr/branches/1.4.x/threadproc/win32/threadpriv.c?rev=1083870&r1=1083869&r2=1083870&view=diff
==============================================================================
--- apr/apr/branches/1.4.x/threadproc/win32/threadpriv.c (original)
+++ apr/apr/branches/1.4.x/threadproc/win32/threadpriv.c Mon Mar 21 17:04:17 2011
@@ -41,7 +41,7 @@ APR_DECLARE(apr_status_t) apr_threadkey_
 APR_DECLARE(apr_status_t) apr_threadkey_private_get(void **new,
                                                  apr_threadkey_t *key)
 {
-    if ((*new) = TlsGetValue(key->key)) {
+    if (((*new) = TlsGetValue(key->key))) {
         return APR_SUCCESS;
     }
     return apr_get_os_error();

Modified: apr/apr/branches/1.4.x/time/win32/timestr.c
URL: http://svn.apache.org/viewvc/apr/apr/branches/1.4.x/time/win32/timestr.c?rev=1083870&r1=1083869&r2=1083870&view=diff
==============================================================================
--- apr/apr/branches/1.4.x/time/win32/timestr.c (original)
+++ apr/apr/branches/1.4.x/time/win32/timestr.c Mon Mar 21 17:04:17 2011
@@ -120,8 +120,8 @@ APR_DECLARE(apr_status_t) apr_ctime(char
 
 #ifndef _WIN32_WCE
 
-apr_size_t win32_strftime_extra(char *s, size_t max, const char *format,
-                                const struct tm *tm) 
+static apr_size_t win32_strftime_extra(char *s, size_t max, const char *format,
+                                       const struct tm *tm) 
 {
    /* If the new format string is bigger than max, the result string won't fit
     * anyway. If format strings are added, made sure the padding below is

Modified: apr/apr/branches/1.4.x/user/win32/groupinfo.c
URL: http://svn.apache.org/viewvc/apr/apr/branches/1.4.x/user/win32/groupinfo.c?rev=1083870&r1=1083869&r2=1083870&view=diff
==============================================================================
--- apr/apr/branches/1.4.x/user/win32/groupinfo.c (original)
+++ apr/apr/branches/1.4.x/user/win32/groupinfo.c Mon Mar 21 17:04:17 2011
@@ -36,11 +36,11 @@ APR_DECLARE(apr_status_t) apr_gid_get(ap
     DWORD rv;
     char *pos;
 
-    if (pos = strchr(groupname, '/')) {
+    if ((pos = strchr(groupname, '/'))) {
         domain = apr_pstrndup(p, groupname, pos - groupname);
         groupname = pos + 1;
     }
-    else if (pos = strchr(groupname, '\\')) {
+    else if ((pos = strchr(groupname, '\\'))) {
         domain = apr_pstrndup(p, groupname, pos - groupname);
         groupname = pos + 1;
     }

Modified: apr/apr/branches/1.4.x/user/win32/userinfo.c
URL: http://svn.apache.org/viewvc/apr/apr/branches/1.4.x/user/win32/userinfo.c?rev=1083870&r1=1083869&r2=1083870&view=diff
==============================================================================
--- apr/apr/branches/1.4.x/user/win32/userinfo.c (original)
+++ apr/apr/branches/1.4.x/user/win32/userinfo.c Mon Mar 21 17:04:17 2011
@@ -30,7 +30,7 @@
  * depends on IsValidSid(), which internally we better test long
  * before we get here!
  */
-void get_sid_string(char *buf, apr_size_t blen, apr_uid_t id)
+static void get_sid_string(char *buf, apr_size_t blen, apr_uid_t id)
 {
     PSID_IDENTIFIER_AUTHORITY psia;
     DWORD nsa;
@@ -45,10 +45,10 @@ void get_sid_string(char *buf, apr_size_
         + ((DWORD)(psia->Value[3]) << 16) + ((DWORD)(psia->Value[2]) << 24);
     sa  =  (DWORD)(psia->Value[1])        + ((DWORD)(psia->Value[0]) <<  8);
     if (sa) {
-        slen = apr_snprintf(buf, blen, "S-%lu-0x%04x%08x",
-                            SID_REVISION, sa, nsa);
+        slen = apr_snprintf(buf, blen, "S-%d-0x%04x%08x",
+                            SID_REVISION, (unsigned int)sa, (unsigned int)nsa);
     } else {
-        slen = apr_snprintf(buf, blen, "S-%lu-%lu",
+        slen = apr_snprintf(buf, blen, "S-%d-%lu",
                             SID_REVISION, nsa);
     }
 
@@ -211,11 +211,11 @@ APR_DECLARE(apr_status_t) apr_uid_get(ap
     DWORD rv;
     char *pos;
 
-    if (pos = strchr(username, '/')) {
+    if ((pos = strchr(username, '/'))) {
         domain = apr_pstrndup(p, username, pos - username);
         username = pos + 1;
     }
-    else if (pos = strchr(username, '\\')) {
+    else if ((pos = strchr(username, '\\'))) {
         domain = apr_pstrndup(p, username, pos - username);
         username = pos + 1;
     }