X-Git-Url: http://g0dil.de/git?a=blobdiff_plain;f=Packets%2FPacketParser.mpp;h=c9c112e0c897f68094b495e3432566e8c274e420;hb=41fe0d795abca302db24e7a955df6ef15ffed722;hp=581ef301ff34a73d3dbb28a1e8334d08a61a2339;hpb=ef0a3583fc76292d631de6a4a5cad4a432351ac8;p=senf.git diff --git a/Packets/PacketParser.mpp b/Packets/PacketParser.mpp index 581ef30..c9c112e 100644 --- a/Packets/PacketParser.mpp +++ b/Packets/PacketParser.mpp @@ -65,8 +65,8 @@ # define SENF_PACKET_PARSER_I_INITSIZE_C(_0,_1,n,elt) \ BOOST_PP_IF(n,+,) senf::init_bytes< SENF_PACKET_PARSER_I_GET_TYPE(elt) >::value # -# define SENF_PACKET_PARSER_I_DEFINE_FIELDS(fields) \ - size_type offset_0_() const { return 0; } \ +# define SENF_PACKET_PARSER_I_DEFINE_FIELDS(offset,fields) \ + size_type offset_0_() const { return offset; } \ BOOST_PP_SEQ_FOR_EACH_I(SENF_PACKET_PARSER_I_FIELD_C, _, fields) \ size_type bytes() const { \ return BOOST_PP_CAT(offset_,BOOST_PP_CAT(BOOST_PP_SEQ_SIZE(fields),_)) (); \ @@ -82,8 +82,8 @@ BOOST_PP_EXPAND( \ SENF_PACKET_PARSER_I_FIXED_FIELD_DISPATCH SENF_PACKET_PARSER_I_UNWRAP(n,elt)) # -# define SENF_PACKET_PARSER_I_DEFINE_FIXED_FIELDS(fields) \ - static const size_type offset_0_ = 0; \ +# define SENF_PACKET_PARSER_I_DEFINE_FIXED_FIELDS(offset,fields) \ + static const size_type offset_0_ = offset; \ BOOST_PP_SEQ_FOR_EACH_I(SENF_PACKET_PARSER_I_FIXED_FIELD_C, _, fields) \ static const size_type fixed_bytes = \ BOOST_PP_CAT(offset_,BOOST_PP_CAT(BOOST_PP_SEQ_SIZE(fields),_)); \ @@ -101,7 +101,7 @@ return BOOST_PP_CAT(offset_,BOOST_PP_CAT(n,_)) () + senf::bytes( name () ); \ } \ size_type BOOST_PP_CAT(name, _offset) () const { \ - return BOOST_PP_CAT(offset_,BOOST_PP_CAT(BOOST_PP_INC(n),_)) () ; \ + return BOOST_PP_CAT(offset_,BOOST_PP_CAT(n,_)) () ; \ } # # define SENF_PACKET_PARSER_I_FIXED_Field(n,name,type) \ @@ -112,7 +112,7 @@ static const size_type BOOST_PP_CAT(offset_,BOOST_PP_CAT(BOOST_PP_INC(n),_)) = \ BOOST_PP_CAT(offset_,BOOST_PP_CAT(n,_)) + type::fixed_bytes; \ static const size_type BOOST_PP_CAT(name,_offset) = \ - BOOST_PP_CAT(offset_,BOOST_PP_CAT(BOOST_PP_INC(n),_)); + BOOST_PP_CAT(offset_,BOOST_PP_CAT(n,_)); # # define SENF_PACKET_PARSER_I_OverlayField(n,name,type) \ typedef type BOOST_PP_CAT(name,_t) ; \ @@ -123,7 +123,7 @@ return BOOST_PP_CAT(offset_,BOOST_PP_CAT(n,_)) (); \ } \ size_type BOOST_PP_CAT(name, _offset) () const { \ - return BOOST_PP_CAT(offset_,BOOST_PP_CAT(BOOST_PP_INC(n),_)) () ; \ + return BOOST_PP_CAT(offset_,BOOST_PP_CAT(n,_)) () ; \ } # # define SENF_PACKET_PARSER_I_FIXED_OverlayField(n,name,type) \ @@ -134,7 +134,7 @@ static const size_type BOOST_PP_CAT(offset_,BOOST_PP_CAT(BOOST_PP_INC(n),_)) = \ BOOST_PP_CAT(offset_,BOOST_PP_CAT(n,_)); \ static const size_type BOOST_PP_CAT(name,_offset) = \ - BOOST_PP_CAT(offset_,BOOST_PP_CAT(BOOST_PP_INC(n),_)); + BOOST_PP_CAT(offset_,BOOST_PP_CAT(n,_)); # # ///////////////////////////////mpp.e/////////////////////////////////////// # endif