Skip to content

Commit 7576dc2

Browse files
committed
Activate gnat check Implicit_IN_Mode_Parameters rule.
Fix all corresponding violations. Some others minor style fixes.
1 parent ea768f6 commit 7576dc2

20 files changed

Lines changed: 81 additions & 84 deletions

aws.checks

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
+RRaising_External_Exceptions
44
+RName_Clashes
55
+RGOTO_Statements
6+
+RImplicit_IN_Mode_Parameters
67
-- ******* to be activated ******************************************
78
-- +RExceptions_As_Control_Flow
8-
-- +RImplicit_IN_Mode_Parameters
99
-- +RImplicit_SMALL_For_Fixed_Point_Types
1010
-- +RNon_Qualified_Aggregates
1111
-- +ROTHERS_In_Aggregates

config/aws-net-std__gnat.adb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ package body AWS.Net.Std is
7373
-- Raise and log exception Socket_Error with E's message and a reference to
7474
-- the routine name.
7575

76-
procedure Raise_Socket_Error (Error : in Integer; Socket : Socket_Type);
76+
procedure Raise_Socket_Error (Error : in Integer; Socket : in Socket_Type);
7777
pragma No_Return (Raise_Socket_Error);
7878

7979
function Error_Message (Error : in Integer) return String;
@@ -222,13 +222,13 @@ package body AWS.Net.Std is
222222
Events : constant Event_Set
223223
:= Net.Wait (Socket, (Output => True, Input => False));
224224

225-
procedure Raise_Error (Errno : Integer);
225+
procedure Raise_Error (Errno : in Integer);
226226

227227
-----------------
228228
-- Raise_Error --
229229
-----------------
230230

231-
procedure Raise_Error (Errno : Integer) is
231+
procedure Raise_Error (Errno : in Integer) is
232232
Msg : constant String := Error_Message (Errno);
233233
begin
234234
Log.Error (Socket, Msg);

config/ssl-thin__openssl.ads

Lines changed: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@
22
-- Secure Sockets Layer --
33
-- Binding to OpenSSL library --
44
-- --
5-
-- Copyright (C) 2000-2006 --
6-
-- AdaCore --
5+
-- Copyright (C) 2000-2008, AdaCore --
76
-- --
87
-- This library is free software; you can redistribute it and/or modify --
98
-- it under the terms of the GNU General Public License as published by --
@@ -78,7 +77,7 @@ package SSL.Thin is
7877
References : int;
7978
Num_Read : unsigned_long;
8079
Num_Write : unsigned_long;
81-
-- CRYPTO_EX_DATA ex_data; -- Do not need to translete it.
80+
-- CRYPTO_EX_DATA ex_data; -- Do not need to translete it
8281
end record;
8382

8483
subtype SSL_Method is Pointer;
@@ -265,13 +264,15 @@ package SSL.Thin is
265264

266265
function CRYPTO_num_locks return Natural;
267266

268-
procedure CRYPTO_set_id_callback (Id_Function : Pointer);
269-
procedure CRYPTO_set_locking_callback (Locking_Function : Pointer);
267+
procedure CRYPTO_set_id_callback (Id_Function : in Pointer);
268+
procedure CRYPTO_set_locking_callback (Locking_Function : in Pointer);
270269
function CRYPTO_get_locking_callback return Pointer;
271270

272-
procedure CRYPTO_set_dynlock_create_callback (Create_Function : Pointer);
273-
procedure CRYPTO_set_dynlock_lock_callback (Lock_Function : Pointer);
274-
procedure CRYPTO_set_dynlock_destroy_callback (Destroy_Function : Pointer);
271+
procedure CRYPTO_set_dynlock_create_callback
272+
(Create_Function : in Pointer);
273+
procedure CRYPTO_set_dynlock_lock_callback (Lock_Function : in Pointer);
274+
procedure CRYPTO_set_dynlock_destroy_callback
275+
(Destroy_Function : in Pointer);
275276

276277
function CRYPTO_get_dynlock_create_callback return Pointer;
277278
function CRYPTO_get_dynlock_lock_callback return Pointer;
@@ -346,7 +347,7 @@ package SSL.Thin is
346347

347348
function SSL_set_fd (S : in SSL_Handle; Fd : in int) return int;
348349

349-
procedure SSL_set_bio (SSL : in SSL_Handle; RBIO, WBIO : BIO_Access);
350+
procedure SSL_set_bio (SSL : in SSL_Handle; RBIO, WBIO : in BIO_Access);
350351

351352
function SSL_get_rbio (SSL : in SSL_Handle) return BIO_Access;
352353
function SSL_get_wbio (SSL : in SSL_Handle) return BIO_Access;
@@ -485,12 +486,12 @@ package SSL.Thin is
485486
-- BIO_set_fd(b,fd,c) BIO_int_ctrl(b,BIO_C_SET_FD,c,fd)
486487

487488
function BIO_ctrl
488-
(Bp : in BIO_Access; Cmd : in int; Larg : in long; Parg : Pointer)
489+
(Bp : in BIO_Access; Cmd : in int; Larg : in long; Parg : in Pointer)
489490
return long;
490491
-- BIO_pending(b) = (int)BIO_ctrl(b,BIO_CTRL_PENDING,0,NULL)
491492

492493
procedure BIO_ctrl
493-
(Bp : in BIO_Access; Cmd : in int; Larg : in long; Parg : Pointer);
494+
(Bp : in BIO_Access; Cmd : in int; Larg : in long; Parg : in Pointer);
494495
-- BIO_get_fd(b,c) = BIO_ctrl(b,BIO_C_GET_FD,0,(char *)c)
495496
-- BIO_set_mem_eof_return(b,v)
496497
-- = BIO_ctrl(b,BIO_C_SET_BUF_MEM_EOF_RETURN,v,NULL)
@@ -505,15 +506,15 @@ package SSL.Thin is
505506
(bio1 : access BIO_Access; writebuf1 : in size_t;
506507
bio2 : access BIO_Access; writebuf2 : in size_t) return int;
507508

508-
function BIO_nread0 (BIO : BIO_Access; Buf : Pointer) return int;
509+
function BIO_nread0 (BIO : in BIO_Access; Buf : in Pointer) return int;
509510
function BIO_nread
510-
(BIO : BIO_Access; Buf : Pointer; Num : in int) return int;
511-
-- Buf is the address of the buffer address.
511+
(BIO : in BIO_Access; Buf : in Pointer; Num : in int) return int;
512+
-- Buf is the address of the buffer address
512513

513-
function BIO_nwrite0 (BIO : BIO_Access; Buf : Pointer) return int;
514+
function BIO_nwrite0 (BIO : in BIO_Access; Buf : in Pointer) return int;
514515
function BIO_nwrite
515-
(BIO : BIO_Access; Buf : Pointer; Num : in int) return int;
516-
-- Buf is the address of the buffer address.
516+
(BIO : in BIO_Access; Buf : in Pointer; Num : in int) return int;
517+
-- Buf is the address of the buffer address
517518

518519
function BIO_free (BIO : in BIO_Access) return int;
519520
procedure BIO_free (BIO : in BIO_Access);

include/zlib-streams.adb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
----------------------------------------------------------------
22
-- ZLib for Ada thick binding. --
33
-- --
4-
-- Copyright (C) 2002-2003 Dmitriy Anisimkov --
4+
-- Copyright (C) 2002-2008, Dmitriy Anisimkov --
55
-- --
66
-- Open source license information is in the zlib.ads file. --
77
----------------------------------------------------------------
@@ -19,7 +19,7 @@ package body ZLib.Streams is
1919
(Stream_Element_Array, Buffer_Access);
2020
begin
2121
if Stream.Mode = Out_Stream or Stream.Mode = Duplex then
22-
-- We should flush the data written by the writer.
22+
-- We should flush the data written by the writer
2323

2424
Flush (Stream, Finish);
2525

@@ -116,7 +116,7 @@ package body ZLib.Streams is
116116
-- Is_Open --
117117
-------------
118118

119-
function Is_Open (Stream : Stream_Type) return Boolean is
119+
function Is_Open (Stream : in Stream_Type) return Boolean is
120120
begin
121121
return Is_Open (Stream.Reader) or else Is_Open (Stream.Writer);
122122
end Is_Open;

include/zlib-streams.ads

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
----------------------------------------------------------------
22
-- ZLib for Ada thick binding. --
33
-- --
4-
-- Copyright (C) 2002-2003 Dmitriy Anisimkov --
4+
-- Copyright (C) 2002-2008, Dmitriy Anisimkov --
55
-- --
66
-- Open source license information is in the zlib.ads file. --
77
----------------------------------------------------------------
@@ -34,19 +34,19 @@ package ZLib.Streams is
3434

3535
function Read_Total_In (Stream : in Stream_Type) return Count;
3636
pragma Inline (Read_Total_In);
37-
-- Return total number of bytes read from back stream so far.
37+
-- Return total number of bytes read from back stream so far
3838

3939
function Read_Total_Out (Stream : in Stream_Type) return Count;
4040
pragma Inline (Read_Total_Out);
41-
-- Return total number of bytes read so far.
41+
-- Return total number of bytes read so far
4242

4343
function Write_Total_In (Stream : in Stream_Type) return Count;
4444
pragma Inline (Write_Total_In);
45-
-- Return total number of bytes written so far.
45+
-- Return total number of bytes written so far
4646

4747
function Write_Total_Out (Stream : in Stream_Type) return Count;
4848
pragma Inline (Write_Total_Out);
49-
-- Return total number of bytes written to the back stream.
49+
-- Return total number of bytes written to the back stream
5050

5151
procedure Create
5252
(Stream : out Stream_Type;
@@ -75,7 +75,7 @@ package ZLib.Streams is
7575
-- !!! When the Need_Header is False ZLib-Ada is using undocumented
7676
-- ZLib 1.1.4 functionality to do not create/wait for ZLib headers.
7777

78-
function Is_Open (Stream : Stream_Type) return Boolean;
78+
function Is_Open (Stream : in Stream_Type) return Boolean;
7979

8080
procedure Close (Stream : in out Stream_Type);
8181

include/zlib-thin.adb

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
----------------------------------------------------------------
22
-- ZLib for Ada thick binding. --
33
-- --
4-
-- Copyright (C) 2002-2003 Dmitriy Anisimkov --
4+
-- Copyright (C) 2002-2008, Dmitriy Anisimkov --
55
-- --
66
-- Open source license information is in the zlib.ads file. --
77
----------------------------------------------------------------
@@ -35,13 +35,12 @@ package body ZLib.Thin is
3535
------------------
3636

3737
function Deflate_Init
38-
(strm : Z_Streamp;
39-
level : Int;
40-
method : Int;
41-
windowBits : Int;
42-
memLevel : Int;
43-
strategy : Int)
44-
return Int is
38+
(strm : in Z_Streamp;
39+
level : in Int;
40+
method : in Int;
41+
windowBits : in Int;
42+
memLevel : in Int;
43+
strategy : in Int) return Int is
4544
begin
4645
return deflateInit2
4746
(strm,
@@ -58,7 +57,8 @@ package body ZLib.Thin is
5857
-- Inflate_Init --
5958
------------------
6059

61-
function Inflate_Init (strm : Z_Streamp; windowBits : Int) return Int is
60+
function Inflate_Init
61+
(strm : in Z_Streamp; windowBits : in Int) return Int is
6262
begin
6363
return inflateInit2 (strm, windowBits, ZLIB_VERSION, Z_Stream_Size);
6464
end Inflate_Init;

soap/soap-generator.adb

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -106,10 +106,10 @@ package body SOAP.Generator is
106106
-- Children - a pragma for each child unit
107107

108108
procedure With_Unit
109-
(File : Text_IO.File_Type;
110-
Name : String;
111-
Elab : Elab_Pragma := Single;
112-
Use_Clause : Boolean := False);
109+
(File : in Text_IO.File_Type;
110+
Name : in String;
111+
Elab : in Elab_Pragma := Single;
112+
Use_Clause : in Boolean := False);
113113
-- Output a with clause for unit Name, also output a use clause if
114114
-- Use_Clause is set. A pragma Elaborate_All is issued for this unit if
115115
-- Elab is set.
@@ -2722,10 +2722,10 @@ package body SOAP.Generator is
27222722
---------------
27232723

27242724
procedure With_Unit
2725-
(File : Text_IO.File_Type;
2726-
Name : String;
2727-
Elab : Elab_Pragma := Single;
2728-
Use_Clause : Boolean := False) is
2725+
(File : in Text_IO.File_Type;
2726+
Name : in String;
2727+
Elab : in Elab_Pragma := Single;
2728+
Use_Clause : in Boolean := False) is
27292729
begin
27302730
Text_IO.Put_Line (File, "with " & Name & ';');
27312731

soap/soap-types.adb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -757,7 +757,7 @@ package body SOAP.Types is
757757
-- I2D --
758758
---------
759759

760-
function I2D (N : Natural) return Str2 is
760+
function I2D (N : in Natural) return Str2 is
761761
V : constant String := Natural'Image (N);
762762
begin
763763
if N > 9 then

src/aws-client-http_utils.adb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1009,13 +1009,13 @@ package body AWS.Client.HTTP_Utils is
10091009
:= Ada.Characters.Handling.To_Lower
10101010
(Header (Answer, Messages.Content_Encoding_Token));
10111011

1012-
procedure Decode_Init (Header : ZLib.Header_Type);
1012+
procedure Decode_Init (Header : in ZLib.Header_Type);
10131013

10141014
-----------------
10151015
-- Decode_Init --
10161016
-----------------
10171017

1018-
procedure Decode_Init (Header : ZLib.Header_Type) is
1018+
procedure Decode_Init (Header : in ZLib.Header_Type) is
10191019
use type Utils.Stream_Element_Array_Access;
10201020
begin
10211021
ZLib.Inflate_Init (Connection.Decode_Filter, Header => Header);

src/aws-config.adb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ package body AWS.Config is
5555
-- Admin_URI --
5656
---------------
5757

58-
function Admin_URI (O : Object) return String is
58+
function Admin_URI (O : in Object) return String is
5959
begin
6060
return To_String (O.P (Admin_URI).Str_Value);
6161
end Admin_URI;
@@ -64,7 +64,7 @@ package body AWS.Config is
6464
-- Case_Sensitive_Parameters --
6565
-------------------------------
6666

67-
function Case_Sensitive_Parameters (O : Object) return Boolean is
67+
function Case_Sensitive_Parameters (O : in Object) return Boolean is
6868
begin
6969
return O.P (Case_Sensitive_Parameters).Bool_Value;
7070
end Case_Sensitive_Parameters;

0 commit comments

Comments
 (0)