summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff Trawick <trawick@apache.org>2011-03-19 12:17:02 +0000
committerJeff Trawick <trawick@apache.org>2011-03-19 12:17:02 +0000
commit0b764570f9ded99d8d85cc033545ebe4da78064a (patch)
tree9253eb02ee98593e0f37db5b03eeec4d228639ec
parenteb478010e910121da6dbaa07b4e53b11776bba81 (diff)
downloadapr-0b764570f9ded99d8d85cc033545ebe4da78064a.tar.gz
clean up some low hanging gcc warnings on Win
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1083169 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--network_io/win32/sendrecv.c2
-rw-r--r--test/testrand.c2
-rw-r--r--test/testshm.c2
-rw-r--r--threadproc/win32/signals.c1
-rw-r--r--threadproc/win32/threadpriv.c2
-rw-r--r--time/win32/timestr.c4
-rw-r--r--user/win32/userinfo.c8
7 files changed, 13 insertions, 8 deletions
diff --git a/network_io/win32/sendrecv.c b/network_io/win32/sendrecv.c
index 1ca8df42e..0fb11add5 100644
--- a/network_io/win32/sendrecv.c
+++ b/network_io/win32/sendrecv.c
@@ -210,6 +210,7 @@ APR_DECLARE(apr_status_t) apr_socket_recvfrom(apr_sockaddr_t *from,
}
+#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 **off, apr_size_t *len,
}
-#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)
diff --git a/test/testrand.c b/test/testrand.c
index 6ced4a34f..333491f3e 100644
--- a/test/testrand.c
+++ b/test/testrand.c
@@ -63,6 +63,7 @@ static void rand_run_kat(abts_case *tc, rnd_fn *f, apr_random_t *r,
}
}
+#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_random_t *r,
return 1;
return 0;
}
+#endif
static void rand_add_zeroes(apr_random_t *r)
{
diff --git a/test/testshm.c b/test/testshm.c
index 6c192f290..bbaf62504 100644
--- a/test/testshm.c
+++ b/test/testshm.c
@@ -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)
{
diff --git a/threadproc/win32/signals.c b/threadproc/win32/signals.c
index b97023094..1cc153e30 100644
--- a/threadproc/win32/signals.c
+++ b/threadproc/win32/signals.c
@@ -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
diff --git a/threadproc/win32/threadpriv.c b/threadproc/win32/threadpriv.c
index 0cbfe620e..787c142c4 100644
--- a/threadproc/win32/threadpriv.c
+++ b/threadproc/win32/threadpriv.c
@@ -41,7 +41,7 @@ APR_DECLARE(apr_status_t) apr_threadkey_private_create(apr_threadkey_t **key,
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();
diff --git a/time/win32/timestr.c b/time/win32/timestr.c
index c28f8e799..138412352 100644
--- a/time/win32/timestr.c
+++ b/time/win32/timestr.c
@@ -124,8 +124,8 @@ APR_DECLARE(apr_status_t) apr_ctime(char *date_str, apr_time_t t)
#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
diff --git a/user/win32/userinfo.c b/user/win32/userinfo.c
index 3d45df4f3..d09aaae83 100644
--- a/user/win32/userinfo.c
+++ b/user/win32/userinfo.c
@@ -45,10 +45,10 @@ void get_sid_string(char *buf, apr_size_t blen, apr_uid_t id)
+ ((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",
+ slen = apr_snprintf(buf, blen, "S-%d-0x%04x%08x",
SID_REVISION, sa, 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(apr_uid_t *uid, apr_gid_t *gid,
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;
}