summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorElliott Hughes <enh@google.com>2010-02-03 12:42:27 -0800
committerElliott Hughes <enh@google.com>2010-02-03 12:42:27 -0800
commit4a79c6e163367b4ca1adc5dda6573d57517d9067 (patch)
treeb5610aa9628dfb294c65baf0fdb5256460eb0ec5
parent5043da6f678448f6111d1a0dcc584f5adf01b526 (diff)
downloadandroid_dalvik-4a79c6e163367b4ca1adc5dda6573d57517d9067.tar.gz
android_dalvik-4a79c6e163367b4ca1adc5dda6573d57517d9067.tar.bz2
android_dalvik-4a79c6e163367b4ca1adc5dda6573d57517d9067.zip
Fix two compiler warnings.
Signed/unsigned comparison in "File.cpp", and && and || without parentheses in "OpenSSLSocketImpl.cpp". There's another signed/unsigned comparison in "ifaddrs-android.h" but that isn't fixable (http://b/2417132), which is going to stand in the way of turning on -Werror.
-rw-r--r--libcore/luni/src/main/native/java_io_File.cpp2
-rw-r--r--libcore/x-net/src/main/native/org_apache_harmony_xnet_provider_jsse_OpenSSLSocketImpl.cpp10
2 files changed, 6 insertions, 6 deletions
diff --git a/libcore/luni/src/main/native/java_io_File.cpp b/libcore/luni/src/main/native/java_io_File.cpp
index ed25ce7b3..bd8136102 100644
--- a/libcore/luni/src/main/native/java_io_File.cpp
+++ b/libcore/luni/src/main/native/java_io_File.cpp
@@ -128,7 +128,7 @@ static jbyteArray java_io_File_getLinkImpl(JNIEnv* env, jobject, jbyteArray path
// An error occurred.
return pathBytes;
}
- if (len < buf.size() - 1) {
+ if (static_cast<size_t>(len) < buf.size() - 1) {
// The buffer was big enough.
// TODO: why do we bother with the NUL termination? (if you change this, remove the "- 1"s above.)
buf[len] = '\0'; // readlink(2) doesn't NUL-terminate.
diff --git a/libcore/x-net/src/main/native/org_apache_harmony_xnet_provider_jsse_OpenSSLSocketImpl.cpp b/libcore/x-net/src/main/native/org_apache_harmony_xnet_provider_jsse_OpenSSLSocketImpl.cpp
index a3c86d6d1..20bb8a50c 100644
--- a/libcore/x-net/src/main/native/org_apache_harmony_xnet_provider_jsse_OpenSSLSocketImpl.cpp
+++ b/libcore/x-net/src/main/native/org_apache_harmony_xnet_provider_jsse_OpenSSLSocketImpl.cpp
@@ -1327,12 +1327,12 @@ static void org_apache_harmony_xnet_provider_jsse_OpenSSLSocketImpl_accept(JNIEn
*/
int sslErrorCode = SSL_get_error(ssl, ret);
if (sslErrorCode == SSL_ERROR_NONE ||
- sslErrorCode == SSL_ERROR_SYSCALL && errno == 0) {
- throwIOExceptionStr(env, "Connection closed by peer");
+ (sslErrorCode == SSL_ERROR_SYSCALL && errno == 0)) {
+ throwIOExceptionStr(env, "Connection closed by peer");
} else {
- throwIOExceptionWithSslErrors(env, ret, sslErrorCode,
- "Trouble accepting connection");
- }
+ throwIOExceptionWithSslErrors(env, ret, sslErrorCode,
+ "Trouble accepting connection");
+ }
free_ssl(env, object);
return;
} else if (ret < 0) {