Skip to content

prefer aspects over representation clauses #72

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 15 additions & 14 deletions src/gnatcoll-email-utils.adb
Original file line number Diff line number Diff line change
Expand Up @@ -1511,10 +1511,11 @@ package body GNATCOLL.Email.Utils is
Block_Suffix : constant String := "?=";
Block_Separator : constant String := " ";

In_Bytes : Stream_Element_Array (Stream_Element_Offset (Str'First)
.. Stream_Element_Offset (Str'Last))
with Import;
for In_Bytes'Address use Str'Address;
In_Bytes :
Stream_Element_Array
(Stream_Element_Offset (Str'First) ..
Stream_Element_Offset (Str'Last)) with
Import, Address => Str'Address;

Max : constant Natural :=
Integer'Max
Expand Down Expand Up @@ -1547,8 +1548,8 @@ package body GNATCOLL.Email.Utils is
In_Last : Stream_Element_Offset;
Out_Last : Stream_Element_Offset;
Out_Chars : String (1 .. (Str'Length + 2) * 4 / 3);
Out_Bytes : Stream_Element_Array (1 .. Out_Chars'Length) with Import;
for Out_Bytes'Address use Out_Chars'Address;
Out_Bytes : Stream_Element_Array (1 .. Out_Chars'Length) with
Import, Address => Out_Chars'Address;
begin
Put_Parts (Block_Prefix);

Expand All @@ -1560,8 +1561,8 @@ package body GNATCOLL.Email.Utils is
Coder.Close;

Put_Parts
(Out_Chars (1 .. Natural (Out_Last)) & Block_Suffix
& (if Last_One then "" else Block_Separator));
(Out_Chars (1 .. Natural (Out_Last)) & Block_Suffix &
(if Last_One then "" else Block_Separator));
end Encode_Append;

Start, Next, Fit : Integer;
Expand Down Expand Up @@ -1607,8 +1608,8 @@ package body GNATCOLL.Email.Utils is
declare
Out_Last : Stream_Element_Offset;
Text : String (1 .. Integer'Min (Max_Block_Len, 76));
Buffer : Stream_Element_Array (1 .. Text'Length) with Import;
for Buffer'Address use Text'Address;
Buffer : Stream_Element_Array (1 .. Text'Length) with
Import, Address => Text'Address;
Flush : constant Flush_Mode :=
(if Index > In_Bytes'Last - Text'Length * 3 / 4 + 1
then Finish else No_Flush);
Expand Down Expand Up @@ -1644,13 +1645,13 @@ package body GNATCOLL.Email.Utils is
is
use Ada.Streams;
Decoder : Base64.Decoder_Type;
Src : Stream_Element_Array (1 .. Str'Length) with Import;
for Src'Address use Str'Address;
Src : Stream_Element_Array (1 .. Str'Length) with
Import, Address => Str'Address;
Index : Stream_Element_Offset := Src'First;
Dest : Stream_Element_Array (1 .. 4096);
Last : Stream_Element_Offset;
Text : String (1 .. Dest'Length);
for Text'Address use Dest'Address;
Text : String (1 .. Dest'Length) with
Address => Dest'Address;
Flush : Flush_Mode := No_Flush;
begin
Decoder.Initialize;
Expand Down