You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by jp...@apache.org on 2013/04/20 05:44:16 UTC

git commit: TS-1586: Fix the SPDY plugin build under clang on Linux.

Updated Branches:
  refs/heads/master c88d6153e -> 270edbe70


TS-1586: Fix the SPDY plugin build under clang on Linux.


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

Branch: refs/heads/master
Commit: 270edbe704bc3d69b56026d8d54e0f16891cb649
Parents: c88d615
Author: James Peach <jp...@apache.org>
Authored: Fri Apr 19 20:43:25 2013 -0700
Committer: James Peach <jp...@apache.org>
Committed: Fri Apr 19 20:43:25 2013 -0700

----------------------------------------------------------------------
 CHANGES                                       |    1 +
 plugins/experimental/spdy/lib/spdy/message.cc |   32 ++++++++++----------
 plugins/experimental/spdy/spdy.cc             |    8 ++--
 3 files changed, 21 insertions(+), 20 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/270edbe7/CHANGES
----------------------------------------------------------------------
diff --git a/CHANGES b/CHANGES
index 3351e2b..374f71c 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,6 +1,7 @@
                                                          -*- coding: utf-8 -*-
   Changes with Apache Traffic Server 3.3.3
 
+  *) [TS-1586] Fix the SPDY plugin build under clang on Linux.
 
   *) [TS-1053] Make combo_handler compiler. Author: Conan Wang.
 

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/270edbe7/plugins/experimental/spdy/lib/spdy/message.cc
----------------------------------------------------------------------
diff --git a/plugins/experimental/spdy/lib/spdy/message.cc b/plugins/experimental/spdy/lib/spdy/message.cc
index 4521443..96de42d 100644
--- a/plugins/experimental/spdy/lib/spdy/message.cc
+++ b/plugins/experimental/spdy/lib/spdy/message.cc
@@ -69,7 +69,7 @@ stringof<spdy::error>(const spdy::error& e)
 // assembler.
 
 template <typename T> T
-extract(const uint8_t __restrict * &ptr) {
+extract(const uint8_t * &ptr) {
     T val;
     memcpy(&val, ptr, sizeof(val));
     std::advance(ptr, sizeof(val));
@@ -77,31 +77,31 @@ extract(const uint8_t __restrict * &ptr) {
 }
 
 template <> uint8_t
-extract<uint8_t>(const uint8_t __restrict * &ptr) {
+extract<uint8_t>(const uint8_t * &ptr) {
     return *ptr++;
 }
 
 template <typename T> void
-insert(const T& val, uint8_t __restrict * &ptr) {
+insert(const T& val, uint8_t * &ptr) {
     memcpy(ptr, &val, sizeof(val));
     std::advance(ptr, sizeof(val));
 }
 
 static inline uint32_t
-extract_stream_id(const uint8_t __restrict * &ptr)
+extract_stream_id(const uint8_t * &ptr)
 {
     return ntohl(extract<uint32_t>(ptr)) & 0x7fffffffu;
 }
 
 static inline void
-insert_stream_id(uint32_t stream_id, uint8_t __restrict * &ptr)
+insert_stream_id(uint32_t stream_id, uint8_t * &ptr)
 {
     insert<uint32_t>(htonl(stream_id & 0x7fffffffu), ptr);
 }
 
 spdy::message_header
 spdy::message_header::parse(
-        const uint8_t __restrict * ptr, size_t len)
+        const uint8_t * ptr, size_t len)
 {
     message_header header;
 
@@ -130,7 +130,7 @@ spdy::message_header::parse(
 
 size_t
 spdy::message_header::marshall(
-        const message_header& msg, uint8_t __restrict * ptr, size_t len)
+        const message_header& msg, uint8_t * ptr, size_t len)
 {
     if (len < message_header::size) {
         throw protocol_error(std::string("short message_header buffer"));
@@ -150,7 +150,7 @@ spdy::message_header::marshall(
 
 spdy::syn_stream_message
 spdy::syn_stream_message::parse(
-        const uint8_t __restrict * ptr, size_t len)
+        const uint8_t * ptr, size_t len)
 {
     syn_stream_message msg;
 
@@ -167,7 +167,7 @@ spdy::syn_stream_message::parse(
 
 spdy::goaway_message
 spdy::goaway_message::parse(
-        const uint8_t __restrict * ptr, size_t len)
+        const uint8_t * ptr, size_t len)
 {
     goaway_message msg;
 
@@ -182,7 +182,7 @@ spdy::goaway_message::parse(
 
 spdy::rst_stream_message
 spdy::rst_stream_message::parse(
-        const uint8_t __restrict * ptr, size_t len)
+        const uint8_t * ptr, size_t len)
 {
     rst_stream_message msg;
 
@@ -197,7 +197,7 @@ spdy::rst_stream_message::parse(
 
 size_t
 spdy::rst_stream_message::marshall(
-        const rst_stream_message& msg, uint8_t __restrict * ptr, size_t len)
+        const rst_stream_message& msg, uint8_t * ptr, size_t len)
 {
     if (len < rst_stream_message::size) {
         throw protocol_error(std::string("short rst_stream buffer"));
@@ -353,10 +353,10 @@ marshall_name_value_pairs_v2(
 
 static spdy::key_value_block
 parse_name_value_pairs_v2(
-        const uint8_t __restrict * ptr, size_t len)
+        const uint8_t * ptr, size_t len)
 {
     int32_t npairs;
-    const uint8_t __restrict * end = ptr + len;
+    const uint8_t * end = ptr + len;
 
     spdy::key_value_block kvblock;
 
@@ -419,7 +419,7 @@ spdy::key_value_block
 spdy::key_value_block::parse(
         protocol_version            version,
         zstream<decompress>&        decompressor,
-        const uint8_t __restrict *  ptr,
+        const uint8_t *  ptr,
         size_t                      len)
 {
     std::vector<uint8_t>    bytes;
@@ -508,7 +508,7 @@ spdy::key_value_block::insert(
 
 spdy::ping_message
 spdy::ping_message::parse(
-        const uint8_t __restrict * ptr, size_t len)
+        const uint8_t * ptr, size_t len)
 {
     ping_message msg;
 
@@ -522,7 +522,7 @@ spdy::ping_message::parse(
 
 size_t
 spdy::ping_message::marshall(
-        const ping_message& msg, uint8_t __restrict * ptr, size_t len)
+        const ping_message& msg, uint8_t * ptr, size_t len)
 {
     if (len < ping_message::size) {
         throw protocol_error(std::string("short ping_message buffer"));

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/270edbe7/plugins/experimental/spdy/spdy.cc
----------------------------------------------------------------------
diff --git a/plugins/experimental/spdy/spdy.cc b/plugins/experimental/spdy/spdy.cc
index 9e88058..0f0dc43 100644
--- a/plugins/experimental/spdy/spdy.cc
+++ b/plugins/experimental/spdy/spdy.cc
@@ -35,7 +35,7 @@ static void
 recv_rst_stream(
         const spdy::message_header& header,
         spdy_io_control *           io,
-        const uint8_t __restrict *  ptr)
+        const uint8_t *  ptr)
 {
     spdy::rst_stream_message rst;
 
@@ -53,7 +53,7 @@ static void
 recv_syn_stream(
         const spdy::message_header& header,
         spdy_io_control *           io,
-        const uint8_t __restrict *  ptr)
+        const uint8_t *  ptr)
 {
     spdy::syn_stream_message    syn;
     spdy_io_stream *            stream;
@@ -125,7 +125,7 @@ static void
 recv_ping(
         const spdy::message_header& header,
         spdy_io_control *           io,
-        const uint8_t __restrict *  ptr)
+        const uint8_t *  ptr)
 {
     spdy::ping_message ping;
 
@@ -146,7 +146,7 @@ static void
 dispatch_spdy_control_frame(
         const spdy::message_header& header,
         spdy_io_control *           io,
-        const uint8_t __restrict *  ptr)
+        const uint8_t *  ptr)
 {
     switch (header.control.type) {
     case spdy::CONTROL_SYN_STREAM:


Re: git commit: TS-1586: Fix the SPDY plugin build under clang on Linux.

Posted by James Peach <ja...@me.com>.
On Apr 20, 2013, at 4:06 AM, Igor Galić <i....@brainsware.org> wrote:

> 
> 
> ----- Original Message -----
>> Updated Branches:
>>  refs/heads/master c88d6153e -> 270edbe70
>> 
>> 
>> TS-1586: Fix the SPDY plugin build under clang on Linux.
> [snip]
>> Commit: 270edbe704bc3d69b56026d8d54e0f16891cb649
>> Parents: c88d615
>> Author: James Peach <jp...@apache.org>
>> Authored: Fri Apr 19 20:43:25 2013 -0700
>> Committer: James Peach <jp...@apache.org>
>> Committed: Fri Apr 19 20:43:25 2013 -0700
>> 
>> ----------------------------------------------------------------------
>> CHANGES                                       |    1 +
>> plugins/experimental/spdy/lib/spdy/message.cc |   32
>> ++++++++++----------
>> plugins/experimental/spdy/spdy.cc             |    8 ++--
>> 3 files changed, 21 insertions(+), 20 deletions(-)
>> ----------------------------------------------------------------------
>> 
>> 
>> http://git-wip-us.apache.org/repos/asf/trafficserver/blob/270edbe7/CHANGES
>> ----------------------------------------------------------------------
>> diff --git a/CHANGES b/CHANGES
>> index 3351e2b..374f71c 100644
>> --- a/CHANGES
>> +++ b/CHANGES
>> @@ -1,6 +1,7 @@
>>                                                          -*- coding:
>>                                                          utf-8 -*-
>>   Changes with Apache Traffic Server 3.3.3
>> 
>> +  *) [TS-1586] Fix the SPDY plugin build under clang on Linux.
>> 
>>   *) [TS-1053] Make combo_handler compiler. Author: Conan Wang.
>> 
>> 
>> http://git-wip-us.apache.org/repos/asf/trafficserver/blob/270edbe7/plugins/experimental/spdy/lib/spdy/message.cc
>> ----------------------------------------------------------------------
>> diff --git a/plugins/experimental/spdy/lib/spdy/message.cc
>> b/plugins/experimental/spdy/lib/spdy/message.cc
>> index 4521443..96de42d 100644
>> --- a/plugins/experimental/spdy/lib/spdy/message.cc
>> +++ b/plugins/experimental/spdy/lib/spdy/message.cc
>> @@ -69,7 +69,7 @@ stringof<spdy::error>(const spdy::error& e)
>> // assembler.
>> 
>> template <typename T> T
>> -extract(const uint8_t __restrict * &ptr) {
>> +extract(const uint8_t * &ptr) {
>>     T val;
>>     memcpy(&val, ptr, sizeof(val));
>>     std::advance(ptr, sizeof(val));
>> @@ -77,31 +77,31 @@ extract(const uint8_t __restrict * &ptr) {
>> }
>> 
>> template <> uint8_t
>> -extract<uint8_t>(const uint8_t __restrict * &ptr) {
>> +extract<uint8_t>(const uint8_t * &ptr) {
>>     return *ptr++;
>> }
> 
> 
> ugh.. I should've updated my patch which moves the "*" before "__restrict",

That's what the original code did. We changed it to this because it wasn't building on something ...



> in accordance to http://gcc.gnu.org/onlinedocs/gcc/Restricted-Pointers.html
> But perhaps this is all good, since it makes us more portable.
> 
> 
> -- i
> Igor Galić
> 
> Tel: +43 (0) 664 886 22 883
> Mail: i.galic@brainsware.org
> URL: http://brainsware.org/
> GPG: 6880 4155 74BD FD7C B515  2EA5 4B1D 9E08 A097 C9AE

Re: git commit: TS-1586: Fix the SPDY plugin build under clang on Linux.

Posted by Igor Galić <i....@brainsware.org>.

----- Original Message -----
> Updated Branches:
>   refs/heads/master c88d6153e -> 270edbe70
> 
> 
> TS-1586: Fix the SPDY plugin build under clang on Linux.
[snip]
> Commit: 270edbe704bc3d69b56026d8d54e0f16891cb649
> Parents: c88d615
> Author: James Peach <jp...@apache.org>
> Authored: Fri Apr 19 20:43:25 2013 -0700
> Committer: James Peach <jp...@apache.org>
> Committed: Fri Apr 19 20:43:25 2013 -0700
> 
> ----------------------------------------------------------------------
>  CHANGES                                       |    1 +
>  plugins/experimental/spdy/lib/spdy/message.cc |   32
>  ++++++++++----------
>  plugins/experimental/spdy/spdy.cc             |    8 ++--
>  3 files changed, 21 insertions(+), 20 deletions(-)
> ----------------------------------------------------------------------
> 
> 
> http://git-wip-us.apache.org/repos/asf/trafficserver/blob/270edbe7/CHANGES
> ----------------------------------------------------------------------
> diff --git a/CHANGES b/CHANGES
> index 3351e2b..374f71c 100644
> --- a/CHANGES
> +++ b/CHANGES
> @@ -1,6 +1,7 @@
>                                                           -*- coding:
>                                                           utf-8 -*-
>    Changes with Apache Traffic Server 3.3.3
>  
> +  *) [TS-1586] Fix the SPDY plugin build under clang on Linux.
>  
>    *) [TS-1053] Make combo_handler compiler. Author: Conan Wang.
>  
> 
> http://git-wip-us.apache.org/repos/asf/trafficserver/blob/270edbe7/plugins/experimental/spdy/lib/spdy/message.cc
> ----------------------------------------------------------------------
> diff --git a/plugins/experimental/spdy/lib/spdy/message.cc
> b/plugins/experimental/spdy/lib/spdy/message.cc
> index 4521443..96de42d 100644
> --- a/plugins/experimental/spdy/lib/spdy/message.cc
> +++ b/plugins/experimental/spdy/lib/spdy/message.cc
> @@ -69,7 +69,7 @@ stringof<spdy::error>(const spdy::error& e)
>  // assembler.
>  
>  template <typename T> T
> -extract(const uint8_t __restrict * &ptr) {
> +extract(const uint8_t * &ptr) {
>      T val;
>      memcpy(&val, ptr, sizeof(val));
>      std::advance(ptr, sizeof(val));
> @@ -77,31 +77,31 @@ extract(const uint8_t __restrict * &ptr) {
>  }
>  
>  template <> uint8_t
> -extract<uint8_t>(const uint8_t __restrict * &ptr) {
> +extract<uint8_t>(const uint8_t * &ptr) {
>      return *ptr++;
>  }


ugh.. I should've updated my patch which moves the "*" before "__restrict",
in accordance to http://gcc.gnu.org/onlinedocs/gcc/Restricted-Pointers.html
But perhaps this is all good, since it makes us more portable.


-- i
Igor Galić

Tel: +43 (0) 664 886 22 883
Mail: i.galic@brainsware.org
URL: http://brainsware.org/
GPG: 6880 4155 74BD FD7C B515  2EA5 4B1D 9E08 A097 C9AE