Skip to content

Commit

Permalink
Fix style in templates
Browse files Browse the repository at this point in the history
Ref. #487, #509
  • Loading branch information
treiher committed Dec 1, 2020
1 parent 9691398 commit f119df5
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions rflx/templates/rflx_message_sequence.adb
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@ is
end Switch;

procedure Update (Ctx : in out Context; Element_Ctx : in out Element_Context) is
Buffer : Types.Bytes_Ptr;
Buffer : Types.Bytes_Ptr;
Valid_Message : constant Boolean := Element_Valid_Message (Element_Ctx);
Last : Types.Bit_Index := Types.Bit_Index'First;
Last : Types.Bit_Index := Types.Bit_Index'First;
begin
if Valid_Message then
Last := Element_Last (Element_Ctx);
Expand Down
6 changes: 3 additions & 3 deletions rflx/templates/rflx_scalar_sequence.adb
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ is
Pre => Has_Buffer (Ctx) and Ctx.Last - Ctx.Sequence_Last >= Element_Base_Type'Size,
Post => Has_Buffer (Ctx) and Ctx.Buffer_First = Ctx.Buffer_First'Old and Ctx.Buffer_Last = Ctx.Buffer_Last'Old and Ctx.First = Ctx.First'Old and Ctx.Last = Ctx.Last'Old and Sequence_Last (Ctx) = Sequence_Last (Ctx)'Old
is
Last_Bit : constant Types.Bit_Index := Ctx.Sequence_Last + Element_Base_Type'Size;
Last_Bit : constant Types.Bit_Index := Ctx.Sequence_Last + Element_Base_Type'Size;
Buffer_First : constant Types.Index := Types.Byte_Index (Ctx.Sequence_Last + 1);
Buffer_Last : constant Types.Index := Types.Byte_Index (Last_Bit);
Offset : constant Types.Offset := Types.Offset ((8 - (Last_Bit mod 8)) mod 8);
Buffer_Last : constant Types.Index := Types.Byte_Index (Last_Bit);
Offset : constant Types.Offset := Types.Offset ((8 - (Last_Bit mod 8)) mod 8);
function Extract is new Types.Extract (Element_Base_Type);
begin
if Buffer_First >= Ctx.Buffer'First and Buffer_Last <= Ctx.Buffer'Last and Buffer_First <= Buffer_Last then
Expand Down
4 changes: 2 additions & 2 deletions tests/spark/generated/rflx-rflx_message_sequence.adb
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@ is
end Switch;

procedure Update (Ctx : in out Context; Element_Ctx : in out Element_Context) is
Buffer : Types.Bytes_Ptr;
Buffer : Types.Bytes_Ptr;
Valid_Message : constant Boolean := Element_Valid_Message (Element_Ctx);
Last : Types.Bit_Index := Types.Bit_Index'First;
Last : Types.Bit_Index := Types.Bit_Index'First;
begin
if Valid_Message then
Last := Element_Last (Element_Ctx);
Expand Down
6 changes: 3 additions & 3 deletions tests/spark/generated/rflx-rflx_scalar_sequence.adb
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ is
Pre => Has_Buffer (Ctx) and Ctx.Last - Ctx.Sequence_Last >= Element_Base_Type'Size,
Post => Has_Buffer (Ctx) and Ctx.Buffer_First = Ctx.Buffer_First'Old and Ctx.Buffer_Last = Ctx.Buffer_Last'Old and Ctx.First = Ctx.First'Old and Ctx.Last = Ctx.Last'Old and Sequence_Last (Ctx) = Sequence_Last (Ctx)'Old
is
Last_Bit : constant Types.Bit_Index := Ctx.Sequence_Last + Element_Base_Type'Size;
Last_Bit : constant Types.Bit_Index := Ctx.Sequence_Last + Element_Base_Type'Size;
Buffer_First : constant Types.Index := Types.Byte_Index (Ctx.Sequence_Last + 1);
Buffer_Last : constant Types.Index := Types.Byte_Index (Last_Bit);
Offset : constant Types.Offset := Types.Offset ((8 - (Last_Bit mod 8)) mod 8);
Buffer_Last : constant Types.Index := Types.Byte_Index (Last_Bit);
Offset : constant Types.Offset := Types.Offset ((8 - (Last_Bit mod 8)) mod 8);
function Extract is new Types.Extract (Element_Base_Type);
begin
if Buffer_First >= Ctx.Buffer'First and Buffer_Last <= Ctx.Buffer'Last and Buffer_First <= Buffer_Last then
Expand Down

0 comments on commit f119df5

Please sign in to comment.