trafficserver-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From zw...@apache.org
Subject svn commit: r1215543 - in /trafficserver/traffic/trunk/iocore/cluster: ClusterCache.cc ClusterHandler.cc P_ClusterCache.h P_ClusterCacheInternal.h P_ClusterHandler.h P_ClusterInternal.h
Date Sat, 17 Dec 2011 18:12:25 GMT
Author: zwoop
Date: Sat Dec 17 18:12:24 2011
New Revision: 1215543

URL: http://svn.apache.org/viewvc?rev=1215543&view=rev
Log:
TS-992 Rename swapXY() to ts_swapXY() to avoid name space collisions.
Author: Piotr Sikora
Review: Leif

Modified:
    trafficserver/traffic/trunk/iocore/cluster/ClusterCache.cc
    trafficserver/traffic/trunk/iocore/cluster/ClusterHandler.cc
    trafficserver/traffic/trunk/iocore/cluster/P_ClusterCache.h
    trafficserver/traffic/trunk/iocore/cluster/P_ClusterCacheInternal.h
    trafficserver/traffic/trunk/iocore/cluster/P_ClusterHandler.h
    trafficserver/traffic/trunk/iocore/cluster/P_ClusterInternal.h

Modified: trafficserver/traffic/trunk/iocore/cluster/ClusterCache.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/iocore/cluster/ClusterCache.cc?rev=1215543&r1=1215542&r2=1215543&view=diff
==============================================================================
--- trafficserver/traffic/trunk/iocore/cluster/ClusterCache.cc (original)
+++ trafficserver/traffic/trunk/iocore/cluster/ClusterCache.cc Sat Dec 17 18:12:24 2011
@@ -2030,7 +2030,7 @@ cache_op_result_ClusterFunction(ClusterM
         ink_assert(((len - flen) == sizeof(int32_t)));
         op_result_error = *(int32_t *) msg->moi;
         if (mh->NeedByteSwap())
-          swap32((uint32_t *) & op_result_error);
+          ats_swap32((uint32_t *) & op_result_error);
         op_result_error = -op_result_error;
         break;
       }

Modified: trafficserver/traffic/trunk/iocore/cluster/ClusterHandler.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/iocore/cluster/ClusterHandler.cc?rev=1215543&r1=1215542&r2=1215543&view=diff
==============================================================================
--- trafficserver/traffic/trunk/iocore/cluster/ClusterHandler.cc (original)
+++ trafficserver/traffic/trunk/iocore/cluster/ClusterHandler.cc Sat Dec 17 18:12:24 2011
@@ -850,8 +850,8 @@ ClusterHandler::process_set_data_msgs()
     char *endp = p + read.msg.control_bytes;
     while (p < endp) {
       if (needByteSwap) {
-        swap32((uint32_t *) p);   // length
-        swap32((uint32_t *) (p + sizeof(int32_t))); // function code
+        ats_swap32((uint32_t *) p);   // length
+        ats_swap32((uint32_t *) (p + sizeof(int32_t))); // function code
       }
       int len = *(int32_t *) p;
       cluster_function_index = *(uint32_t *) (p + sizeof(int32_t));
@@ -867,8 +867,8 @@ ClusterHandler::process_set_data_msgs()
         // Reverse swap since this message will be reprocessed.
 
         if (needByteSwap) {
-          swap32((uint32_t *) p); // length
-          swap32((uint32_t *) (p + sizeof(int32_t)));       // function code
+          ats_swap32((uint32_t *) p); // length
+          ats_swap32((uint32_t *) (p + sizeof(int32_t)));       // function code
         }
         break;                  // End of set_data messages
       }
@@ -884,7 +884,7 @@ ClusterHandler::process_set_data_msgs()
 
     while (ic) {
       if (needByteSwap) {
-        swap32((uint32_t *) ic->data);    // function code
+        ats_swap32((uint32_t *) ic->data);    // function code
       }
       cluster_function_index = *((uint32_t *) ic->data);
 
@@ -897,8 +897,8 @@ ClusterHandler::process_set_data_msgs()
 
         // Reverse swap since this will be processed again for deallocation.
         if (needByteSwap) {
-          swap32((uint32_t *) p); // length
-          swap32((uint32_t *) (p + sizeof(int32_t)));       // function code
+          ats_swap32((uint32_t *) p); // length
+          ats_swap32((uint32_t *) (p + sizeof(int32_t)));       // function code
         }
         // Mark message as processed.
         // Defer dellocation until entire read is complete.
@@ -908,7 +908,7 @@ ClusterHandler::process_set_data_msgs()
       } else {
         // Reverse swap action this message will be reprocessed.
         if (needByteSwap) {
-          swap32((uint32_t *) ic->data);  // function code
+          ats_swap32((uint32_t *) ic->data);  // function code
         }
         break;
       }
@@ -936,8 +936,8 @@ ClusterHandler::process_small_control_ms
     // incoming queue for processing by callout threads.
     /////////////////////////////////////////////////////////////////
     if (needByteSwap) {
-      swap32((uint32_t *) p);     // length
-      swap32((uint32_t *) (p + sizeof(int32_t)));   // function code
+      ats_swap32((uint32_t *) p);     // length
+      ats_swap32((uint32_t *) (p + sizeof(int32_t)));   // function code
     }
     int len = *(int32_t *) p;
     p += sizeof(int32_t);
@@ -991,7 +991,7 @@ ClusterHandler::process_large_control_ms
 
   while ((ic = incoming_control.dequeue())) {
     if (needByteSwap) {
-      swap32((uint32_t *) ic->data);      // function code
+      ats_swap32((uint32_t *) ic->data);      // function code
     }
     cluster_function_index = *((uint32_t *) ic->data);
     ink_release_assert(cluster_function_index != SET_CHANNEL_DATA_CLUSTER_FUNCTION);

Modified: trafficserver/traffic/trunk/iocore/cluster/P_ClusterCache.h
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/iocore/cluster/P_ClusterCache.h?rev=1215543&r1=1215542&r2=1215543&view=diff
==============================================================================
--- trafficserver/traffic/trunk/iocore/cluster/P_ClusterCache.h (original)
+++ trafficserver/traffic/trunk/iocore/cluster/P_ClusterCache.h Sat Dec 17 18:12:24 2011
@@ -107,35 +107,35 @@
 // Miscellaneous byte swap routines
 //////////////////////////////////////////////////////////////
 inline void
-swap16(uint16_t * d)
+ats_swap16(uint16_t * d)
 {
   unsigned char *p = (unsigned char *) d;
   *d = ((p[1] << 8) | p[0]);
 }
 
 inline uint16_t
-swap16(uint16_t d)
+ats_swap16(uint16_t d)
 {
-  swap16(&d);
+  ats_swap16(&d);
   return d;
 }
 
 inline void
-swap32(uint32_t * d)
+ats_swap32(uint32_t * d)
 {
   unsigned char *p = (unsigned char *) d;
   *d = ((p[3] << 24) | (p[2] << 16) | (p[1] << 8) | p[0]);
 }
 
 inline uint32_t
-swap32(uint32_t d)
+ats_swap32(uint32_t d)
 {
-  swap32(&d);
+  ats_swap32(&d);
   return d;
 }
 
 inline void
-swap64(uint64_t * d)
+ats_swap64(uint64_t * d)
 {
   unsigned char *p = (unsigned char *) d;
   *d = (((uint64_t) p[7] << 56) | ((uint64_t) p[6] << 48) |
@@ -144,9 +144,9 @@ swap64(uint64_t * d)
 }
 
 inline uint64_t
-swap64(uint64_t d)
+ats_swap64(uint64_t d)
 {
-  swap64(&d);
+  ats_swap64(&d);
   return d;
 }
 
@@ -308,7 +308,7 @@ struct ClusterVCToken
 
   inline void SwapBytes()
   {
-    swap32(&sequence_number);
+    ats_swap32(&sequence_number);
   }
 };
 
@@ -1018,10 +1018,10 @@ struct ClusterHelloMessage
   void AdjustByteOrder()
   {
     if (!NativeByteOrder()) {
-      swap16(&_major);
-      swap16(&_minor);
-      swap16(&_min_major);
-      swap16(&_min_minor);
+      ats_swap16(&_major);
+      ats_swap16(&_minor);
+      ats_swap16(&_min_major);
+      ats_swap16(&_min_minor);
     }
   }
 };
@@ -1056,7 +1056,7 @@ struct ClusterMessageHeader
   int GetMsgVersion()
   {
     if (NeedByteSwap()) {
-      return swap16(_MsgVersion);
+      return ats_swap16(_MsgVersion);
     } else {
       return _MsgVersion;
     }

Modified: trafficserver/traffic/trunk/iocore/cluster/P_ClusterCacheInternal.h
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/iocore/cluster/P_ClusterCacheInternal.h?rev=1215543&r1=1215542&r2=1215543&view=diff
==============================================================================
--- trafficserver/traffic/trunk/iocore/cluster/P_ClusterCacheInternal.h (original)
+++ trafficserver/traffic/trunk/iocore/cluster/P_ClusterCacheInternal.h Sat Dec 17 18:12:24
2011
@@ -427,8 +427,8 @@ struct CacheLookupMsg:public ClusterMess
   {
     if (NeedByteSwap()) {
       ink_release_assert(!"No byte swap for INK_MD5");
-      swap32(&seq_number);
-      swap32(&frag_type);
+      ats_swap32(&seq_number);
+      ats_swap32(&frag_type);
     }
   }
   //////////////////////////////////////////////////////////////////////////
@@ -479,14 +479,14 @@ struct CacheOpMsg_long:public ClusterMes
   {
     if (NeedByteSwap()) {
       ink_release_assert(!"No byte swap for INK_MD5");
-      swap16(&cfl_flags);
-      swap32(&seq_number);
-      swap32(&nbytes);
-      swap32(&data);
-      swap32((uint32_t *) & channel);
+      ats_swap16(&cfl_flags);
+      ats_swap32(&seq_number);
+      ats_swap32(&nbytes);
+      ats_swap32(&data);
+      ats_swap32((uint32_t *) & channel);
       token.SwapBytes();
-      swap32((uint32_t *) & buffer_size);
-      swap32((uint32_t *) & frag_type);
+      ats_swap32((uint32_t *) & buffer_size);
+      ats_swap32((uint32_t *) & frag_type);
     }
   }
   //////////////////////////////////////////////////////////////////////////
@@ -538,13 +538,13 @@ struct CacheOpMsg_short:public ClusterMe
   {
     if (NeedByteSwap()) {
       ink_release_assert(!"No byte swap for INK_MD5");
-      swap16(&cfl_flags);
-      swap32(&seq_number);
-      swap32(&nbytes);
-      swap32(&data);
+      ats_swap16(&cfl_flags);
+      ats_swap32(&seq_number);
+      ats_swap32(&nbytes);
+      ats_swap32(&data);
       if (opcode == CACHE_OPEN_READ) {
-        swap32((uint32_t *) & buffer_size);
-        swap32((uint32_t *) & channel);
+        ats_swap32((uint32_t *) & buffer_size);
+        ats_swap32((uint32_t *) & channel);
         token.SwapBytes();
       }
     }
@@ -591,8 +591,8 @@ struct CacheOpMsg_short_2:public Cluster
     if (NeedByteSwap()) {
       ink_release_assert(!"No byte swap for MD5_1");
       ink_release_assert(!"No byte swap for MD5_2");
-      swap16(&cfl_flags);
-      swap32(&seq_number);
+      ats_swap16(&cfl_flags);
+      ats_swap32(&seq_number);
     }
   }
   //////////////////////////////////////////////////////////////////////////
@@ -633,8 +633,8 @@ struct CacheOpReplyMsg:public ClusterMes
   inline void SwapBytes()
   {
     if (NeedByteSwap()) {
-      swap32(&seq_number);
-      swap32((uint32_t *) & result);
+      ats_swap32(&seq_number);
+      ats_swap32((uint32_t *) & result);
       token.SwapBytes();
     }
   }

Modified: trafficserver/traffic/trunk/iocore/cluster/P_ClusterHandler.h
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/iocore/cluster/P_ClusterHandler.h?rev=1215543&r1=1215542&r2=1215543&view=diff
==============================================================================
--- trafficserver/traffic/trunk/iocore/cluster/P_ClusterHandler.h (original)
+++ trafficserver/traffic/trunk/iocore/cluster/P_ClusterHandler.h Sat Dec 17 18:12:24 2011
@@ -176,9 +176,9 @@ struct Descriptor
 
   inline void SwapBytes()
   {
-    swap16((uint16_t *) this);    // Hack
-    swap16((uint16_t *) & sequence_number);
-    swap32((uint32_t *) & length);
+    ats_swap16((uint16_t *) this);    // Hack
+    ats_swap16((uint16_t *) & sequence_number);
+    ats_swap32((uint32_t *) & length);
   }
 };
 
@@ -205,12 +205,12 @@ struct ClusterMsgHeader
   }
   inline void SwapBytes()
   {
-    swap16((uint16_t *) & count);
-    swap16((uint16_t *) & descriptor_cksum);
-    swap16((uint16_t *) & control_bytes_cksum);
-    swap16((uint16_t *) & unused);
-    swap32((uint32_t *) & control_bytes);
-    swap32((uint32_t *) & count_check);
+    ats_swap16((uint16_t *) & count);
+    ats_swap16((uint16_t *) & descriptor_cksum);
+    ats_swap16((uint16_t *) & control_bytes_cksum);
+    ats_swap16((uint16_t *) & unused);
+    ats_swap32((uint32_t *) & control_bytes);
+    ats_swap32((uint32_t *) & count_check);
   }
 };
 

Modified: trafficserver/traffic/trunk/iocore/cluster/P_ClusterInternal.h
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/iocore/cluster/P_ClusterInternal.h?rev=1215543&r1=1215542&r2=1215543&view=diff
==============================================================================
--- trafficserver/traffic/trunk/iocore/cluster/P_ClusterInternal.h (original)
+++ trafficserver/traffic/trunk/iocore/cluster/P_ClusterInternal.h Sat Dec 17 18:12:24 2011
@@ -252,10 +252,10 @@ struct CloseMessage:public ClusterMessag
   inline void SwapBytes()
   {
     if (NeedByteSwap()) {
-      swap32(&channel);
-      swap32((uint32_t *) & status);
-      swap32((uint32_t *) & lerrno);
-      swap32(&sequence_number);
+      ats_swap32(&channel);
+      ats_swap32((uint32_t *) & status);
+      ats_swap32((uint32_t *) & lerrno);
+      ats_swap32(&sequence_number);
     }
   }
   ////////////////////////////////////////////////////////////////////////////
@@ -295,7 +295,7 @@ struct MachineListMessage:public Cluster
   }
   inline void SwapBytes()
   {
-    swap32(&n_ip);
+    ats_swap32(&n_ip);
   }
   ////////////////////////////////////////////////////////////////////////////
 };
@@ -338,9 +338,9 @@ struct SetChanDataMessage:public Cluster
   inline void SwapBytes()
   {
     if (NeedByteSwap()) {
-      swap32(&channel);
-      swap32(&sequence_number);
-      swap32(&data_type);
+      ats_swap32(&channel);
+      ats_swap32(&sequence_number);
+      ats_swap32(&data_type);
     }
   }
   ////////////////////////////////////////////////////////////////////////////
@@ -381,9 +381,9 @@ struct SetChanPinMessage:public ClusterM
   inline void SwapBytes()
   {
     if (NeedByteSwap()) {
-      swap32(&channel);
-      swap32(&sequence_number);
-      swap32(&pin_time);
+      ats_swap32(&channel);
+      ats_swap32(&sequence_number);
+      ats_swap32(&pin_time);
     }
   }
   ////////////////////////////////////////////////////////////////////////////
@@ -424,9 +424,9 @@ struct SetChanPriorityMessage:public Clu
   inline void SwapBytes()
   {
     if (NeedByteSwap()) {
-      swap32(&channel);
-      swap32(&sequence_number);
-      swap32(&disk_priority);
+      ats_swap32(&channel);
+      ats_swap32(&sequence_number);
+      ats_swap32(&disk_priority);
     }
   }
   ////////////////////////////////////////////////////////////////////////////



Mime
View raw message