TS-2097: remove unsued string functions

first round of removing unsued/useless string functions


Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/ac04a761
Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/ac04a761
Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/ac04a761

Branch: refs/heads/3.3.x
Commit: ac04a7615a063370f8959d73eaf5ab204c384d2b
Parents: 9533a4d
Author: Igor Galić <i.ga...@brainsware.org>
Authored: Mon Aug 5 22:22:34 2013 +0200
Committer: Igor Galić <i.ga...@brainsware.org>
Committed: Mon Aug 5 22:22:34 2013 +0200

----------------------------------------------------------------------
 lib/ts/ink_string.h        | 68 -----------------------------------------
 mgmt/cluster/ClusterCom.cc |  4 +--
 2 files changed, 2 insertions(+), 70 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/ac04a761/lib/ts/ink_string.h
----------------------------------------------------------------------
diff --git a/lib/ts/ink_string.h b/lib/ts/ink_string.h
index 8703d25..0e88634 100644
--- a/lib/ts/ink_string.h
+++ b/lib/ts/ink_string.h
@@ -97,49 +97,6 @@ void ink_utf8_to_latin1(const char *in, int inlen, char 
*out, int *outlen);
 
 /*---------------------------------------------------------------------------*
 
-  char *ink_strchr(char *s, char c)
-
-  A faster version of strchr.
-
- *---------------------------------------------------------------------------*/
-
-static inline char *
-ink_strchr(char *s, char c)
-{
-  while (*s) {
-    if (*s == c)
-      return (s);
-    else
-      ++s;
-  }
-  return (NULL);
-}                               /* End ink_strchr */
-
-
-/*---------------------------------------------------------------------------*
-
-  int ink_string_is_prefix(char *prefix, char *str)
-
-  Returns 1 is <prefix> is a strict prefix of <str>, 0 otherwise.
-
- *---------------------------------------------------------------------------*/
-
-static inline int
-ink_string_is_prefix(char *prefix, char *str)
-{
-  while (*prefix && *str && *prefix == *str) {
-    ++prefix;
-    ++str;
-  }
-  if (*prefix == '\0')
-    return (1);
-  else
-    return (0);
-}                               /* End ink_string_is_prefix */
-
-
-/*---------------------------------------------------------------------------*
-
   char *ink_string_copy(char *dest, char *src, int n)
 
   This routine is like ink_strncpy, but it stops writing to <dest>
@@ -168,31 +125,6 @@ ink_string_copy(char *dest, char *src, int n)
 }                               /* End ink_string_copy */
 
 
-/*---------------------------------------------------------------------------*
-
-  char *ink_string_concatenate_two_strings(char *dest, char *s1, char *s2)
-
-  This routine concatenates the two strings <s1> and <s2> into the buffer
-  <dest>, returning the pointer to <dest>.
-
- *---------------------------------------------------------------------------*/
-
-static inline char *
-ink_string_concatenate_two_strings(char *dest, char *s1, char *s2)
-{
-  char *d;
-
-  d = dest;
-  while (*s1)
-    *d++ = *s1++;
-  while (*s2)
-    *d++ = *s2++;
-  *d++ = '\0';
-
-  return (dest);
-}                               /* End ink_string_concatenate_two_strings */
-
-
 // inline int ptr_len_cmp(const char* p1, int l1, const char* p2, int l2)
 //
 //     strcmp() functionality for two ptr length pairs

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/ac04a761/mgmt/cluster/ClusterCom.cc
----------------------------------------------------------------------
diff --git a/mgmt/cluster/ClusterCom.cc b/mgmt/cluster/ClusterCom.cc
index 2fedee5..4f8344c 100644
--- a/mgmt/cluster/ClusterCom.cc
+++ b/mgmt/cluster/ClusterCom.cc
@@ -896,10 +896,10 @@ ClusterCom::handleMultiCastStatPacket(char *last, 
ClusterPeerInfo * peer)
     case RECD_COUNTER:{
         RecInt tmp_msg_val = -1;
         tmp_id = ink_atoi(line);
-        char *v2 = ink_strchr(line, ':'), *v3 = NULL;
+        char *v2 = strchr(line, ':'), *v3 = NULL;
         if (v2) {
           tmp_type = (RecDataT) ink_atoi(v2 + 1);
-          v3 = ink_strchr(v2 + 1, ':');
+          v3 = strchr(v2 + 1, ':');
           if (v3)
             tmp_msg_val = ink_atoi64(v3 + 1);
         }

Reply via email to