AdaCore / aws

AWS is a complete framework to develop Web based applications in Ada.
Other
127 stars 37 forks source link

Mixed styles - aspect and for #330

Open pjljvandelaar opened 2 years ago

pjljvandelaar commented 2 years ago

The code starting on https://github.com/AdaCore/aws/blob/7488c0f6f4c593b51e8b61b94d245e2ff4896e33/config/ssl/aws-net-ssl__openssl.adb#L215 seems to mix two styles (aspects and for keyword).

Why not make the following change

-   Max_Overhead : Stream_Element_Count range 0 .. 2**15 := 81 with Atomic;
-   for Max_Overhead'Size use 16;
+   Max_Overhead : Stream_Element_Count range 0 .. 2**15 := 81 with
+      Atomic,
+      Size => 16;

Note: issue was found using https://github.com/TNO/Renaissance-Ada/blob/main/src/tools/Code_Reviewer and made as an example at https://github.com/TNO/Renaissance-Ada

TurboGit commented 2 years ago

Sure, seems better with a slight reformatting:

Max_Overhead : Stream_Element_Count range 0 .. 2**15 := 81
  with Atomic, Size => 16;
pjljvandelaar commented 2 years ago

I am using GnatPP to format the code, so I did not pay much attention to the format. Yet, I agree that it can be formatted better: have to see how to change the parameter of GnatPP to get this result.