You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by mt...@apache.org on 2005/06/12 09:01:03 UTC
cvs commit: jakarta-tomcat-connectors/jni/native/src info.c ssl.c sslutils.c
mturk 2005/06/12 00:01:03
Modified: jni/native/include tcn.h
jni/native/src info.c ssl.c sslutils.c
Log:
Fix various compile time warnings for -Wall
Revision Changes Path
1.17 +17 -10 jakarta-tomcat-connectors/jni/native/include/tcn.h
Index: tcn.h
===================================================================
RCS file: /home/cvs/jakarta-tomcat-connectors/jni/native/include/tcn.h,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -r1.16 -r1.17
--- tcn.h 11 Jun 2005 18:21:12 -0000 1.16
+++ tcn.h 12 Jun 2005 07:01:03 -0000 1.17
@@ -26,7 +26,19 @@
#error "Missing APR_HAS_THREADS support from APR."
#endif
-#define TCN_DO_STATISTICS 1
+#if defined(DEBUG) || defined(_DEBUG)
+/* On -DDEBUG use the statistics */
+#ifndef TCN_DO_STATISTICS
+#define TCN_DO_STATISTICS
+#endif
+#endif
+#include <stdio.h>
+#include <stdlib.h>
+#if defined(_WIN32) && !defined(__CYGWIN__)
+#include <process.h>
+#else
+#include <unistd.h>
+#endif
#include <jni.h>
#if defined(_DEBUG) || defined(DEBUG)
@@ -65,7 +77,8 @@
#define TCN_AINFO_CLASS TCN_CLASS_PATH "Sockaddr"
#define TCN_ERROR_CLASS TCN_CLASS_PATH "Error"
-#define UNREFERENCED(P) (P)
+#define UNREFERENCED(P) (P) = (P)
+#define UNREFERENCED_STDARGS e = e; o = o
#ifdef WIN32
#define LLT(X) (X)
#else
@@ -76,7 +89,6 @@
/* On stack buffer size */
#define TCN_BUFFER_SZ 8192
#define TCN_STDARGS JNIEnv *e, jobject o
-#define UNREFERENCED_STDARGS e; o
#define TCN_IMPLEMENT_CALL(RT, CL, FN) \
JNIEXPORT RT JNICALL Java_org_apache_tomcat_jni_##CL##_##FN
@@ -97,13 +109,8 @@
#define J2T(T) (apr_time_t)((T))
-#if 1
#define TCN_BEGIN_MACRO if (1) {
-#define TCN_END_MACRO } else (void *)(0)
-#else
-#define TCN_BEGIN_MACRO do {
-#define TCN_END_MACRO } while (0)
-#endif
+#define TCN_END_MACRO } else (void)(0)
#define TCN_ALLOC_CSTRING(V) \
const char *c##V = V ? (const char *)((*e)->GetStringUTFChars(e, V, 0)) : NULL
1.7 +7 -7 jakarta-tomcat-connectors/jni/native/src/info.c
Index: info.c
===================================================================
RCS file: /home/cvs/jakarta-tomcat-connectors/jni/native/src/info.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- info.c 24 May 2005 09:24:40 -0000 1.6
+++ info.c 12 Jun 2005 07:01:03 -0000 1.7
@@ -34,14 +34,14 @@
if (_fid##N == NULL) { \
(*e)->ExceptionClear(e); \
goto cleanup; \
- } (void *)(0)
+ } else (void)(0)
#define GET_FINFO_J(N) \
_fid##N = (*e)->GetFieldID(e, finfo, #N, "J"); \
if (_fid##N == NULL) { \
(*e)->ExceptionClear(e); \
goto cleanup; \
- } (void *)(0)
+ } else (void)(0)
#define GET_FINFO_S(N) \
_fid##N = (*e)->GetFieldID(e, finfo, #N, \
@@ -49,7 +49,7 @@
if (_fid##N == NULL) { \
(*e)->ExceptionClear(e); \
goto cleanup; \
- } (void *)(0)
+ } else (void)(0)
#define SET_FINFO_I(N, V) \
(*e)->SetIntField(e, obj, _fid##N, (jint)(V))
@@ -70,14 +70,14 @@
if (_aid##N == NULL) { \
(*e)->ExceptionClear(e); \
goto cleanup; \
- } (void *)(0)
+ } else (void)(0)
#define GET_AINFO_J(N) \
_aid##N = (*e)->GetFieldID(e, ainfo, #N, "J"); \
if (_aid##N == NULL) { \
(*e)->ExceptionClear(e); \
goto cleanup; \
- } (void *)(0)
+ } else (void)(0)
#define GET_AINFO_S(N) \
_aid##N = (*e)->GetFieldID(e, ainfo, #N, \
@@ -85,7 +85,7 @@
if (_aid##N == NULL) { \
(*e)->ExceptionClear(e); \
goto cleanup; \
- } (void *)(0)
+ } else (void)(0)
#define SET_AINFO_I(N, V) \
(*e)->SetIntField(e, obj, _aid##N, (jint)(V))
1.34 +2 -2 jakarta-tomcat-connectors/jni/native/src/ssl.c
Index: ssl.c
===================================================================
RCS file: /home/cvs/jakarta-tomcat-connectors/jni/native/src/ssl.c,v
retrieving revision 1.33
retrieving revision 1.34
diff -u -r1.33 -r1.34
--- ssl.c 11 Jun 2005 18:22:25 -0000 1.33
+++ ssl.c 12 Jun 2005 07:01:03 -0000 1.34
@@ -48,7 +48,7 @@
if (SSL_temp_keys[idx]) { \
type##_free((type *)SSL_temp_keys[idx]); \
SSL_temp_keys[idx] = NULL; \
- } else (void *)(0)
+ } else (void)(0)
#define SSL_TMP_KEYS_FREE(type) \
SSL_TMP_KEY_FREE(type, SSL_TMP_KEY_##type##_512); \
1.26 +1 -2 jakarta-tomcat-connectors/jni/native/src/sslutils.c
Index: sslutils.c
===================================================================
RCS file: /home/cvs/jakarta-tomcat-connectors/jni/native/src/sslutils.c,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -r1.25 -r1.26
--- sslutils.c 11 Jun 2005 18:24:17 -0000 1.25
+++ sslutils.c 12 Jun 2005 07:01:03 -0000 1.26
@@ -116,7 +116,6 @@
int SSL_password_callback(char *buf, int bufsiz, int verify,
void *cb)
{
- int rv = 0;
tcn_pass_cb_t *cb_data = (tcn_pass_cb_t *)cb;
if (buf == NULL)
---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org