You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by zw...@apache.org on 2014/05/12 19:26:54 UTC
git commit: TS-1475 Avoid clang warnings on Dead store / increment
Repository: trafficserver
Updated Branches:
refs/heads/master caf1bc13c -> c7df50254
TS-1475 Avoid clang warnings on Dead store / increment
Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/c7df5025
Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/c7df5025
Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/c7df5025
Branch: refs/heads/master
Commit: c7df50254c98b1cd301a148730824184c5e755bb
Parents: caf1bc1
Author: Leif Hedstrom <zw...@apache.org>
Authored: Mon May 12 10:41:13 2014 -0600
Committer: Leif Hedstrom <zw...@apache.org>
Committed: Mon May 12 10:41:17 2014 -0600
----------------------------------------------------------------------
iocore/cluster/P_ClusterInline.h | 12 ++++--------
1 file changed, 4 insertions(+), 8 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/c7df5025/iocore/cluster/P_ClusterInline.h
----------------------------------------------------------------------
diff --git a/iocore/cluster/P_ClusterInline.h b/iocore/cluster/P_ClusterInline.h
index c653956..965b79f 100644
--- a/iocore/cluster/P_ClusterInline.h
+++ b/iocore/cluster/P_ClusterInline.h
@@ -74,7 +74,6 @@ Cluster_read(ClusterMachine * owner_machine, int opcode,
int vers = CacheOpMsg_long::protoToVersion(owner_machine->msg_proto_major);
int flen;
int len = 0;
- int cur_len;
int res = 0;
char *msg;
char *data;
@@ -103,7 +102,8 @@ Cluster_read(ClusterMachine * owner_machine, int opcode,
msg = (char *) ALLOCA_DOUBLE(flen + len);
data = msg + flen;
- cur_len = len;
+ int cur_len = len;
+
res = request->m_heap->marshal(data, cur_len);
if (res < 0) {
goto err_exit;
@@ -113,7 +113,6 @@ Cluster_read(ClusterMachine * owner_machine, int opcode,
if ((res = params->marshal(data, cur_len)) < 0)
goto err_exit;
data += res;
- cur_len -= res;
memcpy(data, url_hostname, url_hlen);
CacheOpArgs_General readArgs;
@@ -226,17 +225,14 @@ Cluster_write(Continuation * cont, int expected_size,
// Perform data Marshal operation
msg = (char *) ALLOCA_DOUBLE(flen + len);
data = msg + flen;
- int res = 0;
-
- int cur_len = len;
if (old_info) {
- res = old_info->marshal(data, cur_len);
+ int res = old_info->marshal(data, len);
+
if (res < 0) {
goto err_exit;
}
data += res;
- cur_len -= res;
}
memcpy(data, url_hostname, url_hlen);
break;