tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mt...@apache.org
Subject svn commit: r1202585 - in /tomcat/jk/trunk/native/common: jk_ajp14.c jk_ajp_common.c jk_msg_buff.c jk_msg_buff.h
Date Wed, 16 Nov 2011 08:42:18 GMT
Author: mturk
Date: Wed Nov 16 08:42:18 2011
New Revision: 1202585

URL: http://svn.apache.org/viewvc?rev=1202585&view=rev
Log:
No need for that many casts. Use simpler string api

Modified:
    tomcat/jk/trunk/native/common/jk_ajp14.c
    tomcat/jk/trunk/native/common/jk_ajp_common.c
    tomcat/jk/trunk/native/common/jk_msg_buff.c
    tomcat/jk/trunk/native/common/jk_msg_buff.h

Modified: tomcat/jk/trunk/native/common/jk_ajp14.c
URL: http://svn.apache.org/viewvc/tomcat/jk/trunk/native/common/jk_ajp14.c?rev=1202585&r1=1202584&r2=1202585&view=diff
==============================================================================
--- tomcat/jk/trunk/native/common/jk_ajp14.c (original)
+++ tomcat/jk/trunk/native/common/jk_ajp14.c Wed Nov 16 08:42:18 2011
@@ -185,7 +185,7 @@ int ajp14_unmarshal_log_ok(jk_msg_buf_t 
         return JK_FALSE;
     }
 
-    sname = (char *)jk_b_get_string(msg);
+    sname = jk_b_get_string(msg);
 
     if (!sname) {
         jk_log(l, JK_LOG_ERROR,
@@ -414,7 +414,7 @@ int ajp14_unmarshal_context_info(jk_msg_
     char *cname;
     char *uri;
 
-    vname = (char *)jk_b_get_string(msg);
+    vname = jk_b_get_string(msg);
 
     JK_TRACE_ENTER(l);
     jk_log(l, JK_LOG_DEBUG,
@@ -442,7 +442,7 @@ int ajp14_unmarshal_context_info(jk_msg_
 
     for (;;) {
 
-        cname = (char *)jk_b_get_string(msg);
+        cname = jk_b_get_string(msg);
 
         if (!cname) {
             jk_log(l, JK_LOG_ERROR,
@@ -471,7 +471,7 @@ int ajp14_unmarshal_context_info(jk_msg_
 
         for (;;) {
 
-            uri = (char *)jk_b_get_string(msg);
+            uri = jk_b_get_string(msg);
 
             if (!uri) {
                 jk_log(l, JK_LOG_ERROR,
@@ -620,7 +620,7 @@ int ajp14_unmarshal_context_state_reply(
 
     JK_TRACE_ENTER(l);
     /* get virtual name */
-    vname = (char *)jk_b_get_string(msg);
+    vname = jk_b_get_string(msg);
 
     if (!vname) {
         jk_log(l, JK_LOG_ERROR,
@@ -641,7 +641,7 @@ int ajp14_unmarshal_context_state_reply(
     for (;;) {
 
         /* get context name */
-        cname = (char *)jk_b_get_string(msg);
+        cname = jk_b_get_string(msg);
 
         if (!cname) {
             jk_log(l, JK_LOG_ERROR,

Modified: tomcat/jk/trunk/native/common/jk_ajp_common.c
URL: http://svn.apache.org/viewvc/tomcat/jk/trunk/native/common/jk_ajp_common.c?rev=1202585&r1=1202584&r2=1202585&view=diff
==============================================================================
--- tomcat/jk/trunk/native/common/jk_ajp_common.c (original)
+++ tomcat/jk/trunk/native/common/jk_ajp_common.c Wed Nov 16 08:42:18 2011
@@ -670,7 +670,7 @@ static int ajp_unmarshal_response(jk_msg
         return JK_FALSE;
     }
 
-    d->msg = (char *)jk_b_get_string(msg);
+    d->msg = jk_b_get_string(msg);
     if (d->msg) {
 #if (defined(AS400) && !defined(AS400_UTF8)) || defined(_OSD_POSIX)
         jk_xlate_from_ascii(d->msg, strlen(d->msg));
@@ -713,7 +713,7 @@ static int ajp_unmarshal_response(jk_msg
                     }
                 }
                 else {
-                    d->header_names[i] = (char *)jk_b_get_string(msg);
+                    d->header_names[i] = jk_b_get_string(msg);
                     if (!d->header_names[i]) {
                         jk_log(l, JK_LOG_ERROR,
                                "NULL header name");
@@ -727,7 +727,7 @@ static int ajp_unmarshal_response(jk_msg
 
                 }
 
-                d->header_values[i] = (char *)jk_b_get_string(msg);
+                d->header_values[i] = jk_b_get_string(msg);
                 if (!d->header_values[i]) {
                     jk_log(l, JK_LOG_ERROR,
                            "NULL header value");

Modified: tomcat/jk/trunk/native/common/jk_msg_buff.c
URL: http://svn.apache.org/viewvc/tomcat/jk/trunk/native/common/jk_msg_buff.c?rev=1202585&r1=1202584&r2=1202585&view=diff
==============================================================================
--- tomcat/jk/trunk/native/common/jk_msg_buff.c (original)
+++ tomcat/jk/trunk/native/common/jk_msg_buff.c Wed Nov 16 08:42:18 2011
@@ -131,7 +131,7 @@ int jk_b_set_buffer(jk_msg_buf_t *msg, u
 
 int jk_b_set_buffer_size(jk_msg_buf_t *msg, int buffSize)
 {
-    unsigned char *data = (unsigned char *)jk_pool_alloc(msg->pool, buffSize);
+    unsigned char *data = jk_pool_alloc(msg->pool, buffSize);
 
     if (!data) {
         return -1;
@@ -207,7 +207,7 @@ int jk_b_append_bytes(jk_msg_buf_t *msg,
     }
 
     /* We checked for space !!  */
-    memcpy((char *)msg->buf + msg->len, param, len);
+    memcpy(msg->buf + msg->len, param, len);
     msg->len += len;
 
     return 0;
@@ -272,8 +272,7 @@ unsigned char jk_b_pget_byte(jk_msg_buf_
     return msg->buf[pos];
 }
 
-
-unsigned char *jk_b_get_string(jk_msg_buf_t *msg)
+char *jk_b_get_string(jk_msg_buf_t *msg)
 {
     unsigned short size = jk_b_get_int(msg);
     int start = msg->pos;
@@ -288,7 +287,7 @@ unsigned char *jk_b_get_string(jk_msg_bu
     msg->pos += size;
     msg->pos++;                 /* terminating NULL */
 
-    return (unsigned char *)(msg->buf + start);
+    return (char *)(msg->buf + start);
 }
 
 int jk_b_get_bytes(jk_msg_buf_t *msg, unsigned char *buf, int len)

Modified: tomcat/jk/trunk/native/common/jk_msg_buff.h
URL: http://svn.apache.org/viewvc/tomcat/jk/trunk/native/common/jk_msg_buff.h?rev=1202585&r1=1202584&r2=1202585&view=diff
==============================================================================
--- tomcat/jk/trunk/native/common/jk_msg_buff.h (original)
+++ tomcat/jk/trunk/native/common/jk_msg_buff.h Wed Nov 16 08:42:18 2011
@@ -120,7 +120,7 @@ unsigned long jk_b_get_long(jk_msg_buf_t
 
 /** Get a String from the current position
  */
-unsigned char *jk_b_get_string(jk_msg_buf_t *msg);
+char *jk_b_get_string(jk_msg_buf_t *msg);
 
 /** Get Bytes from the current position
  */



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Mime
View raw message