[multiple changes]

2012-08-06  Robert Dewar  <dewar@adacore.com>

	* s-htable.adb: Minor reformatting.

2012-08-06  Thomas Quinot  <quinot@adacore.com>

	* s-oscons-tmplt.c, g-socket.adb (System.OS_Constants.Target_OS):
	Suppress warnings so that we don't have to do it at each usage.

From-SVN: r190157
This commit is contained in:
Arnaud Charlet 2012-08-06 09:43:45 +02:00
parent b3f96dc15b
commit 1bd84c71bc
4 changed files with 22 additions and 24 deletions

View File

@ -1,3 +1,12 @@
2012-08-06 Robert Dewar <dewar@adacore.com>
* s-htable.adb: Minor reformatting.
2012-08-06 Thomas Quinot <quinot@adacore.com>
* s-oscons-tmplt.c, g-socket.adb (System.OS_Constants.Target_OS):
Suppress warnings so that we don't have to do it at each usage.
2012-08-06 Vincent Pucci <pucci@adacore.com> 2012-08-06 Vincent Pucci <pucci@adacore.com>
* exp_ch9.adb (Build_Lock_Free_Unprotected_Subprogram_Body): * exp_ch9.adb (Build_Lock_Free_Unprotected_Subprogram_Body):

View File

@ -480,9 +480,7 @@ package body GNAT.Sockets is
-- no check required. Warnings suppressed because condition -- no check required. Warnings suppressed because condition
-- is known at compile time. -- is known at compile time.
pragma Warnings (Off);
if Target_OS = Windows then if Target_OS = Windows then
pragma Warnings (On);
return; return;
@ -1150,10 +1148,7 @@ package body GNAT.Sockets is
-- struct timeval, but on Windows it is a milliseconds count in -- struct timeval, but on Windows it is a milliseconds count in
-- a DWORD. -- a DWORD.
pragma Warnings (Off);
if Target_OS = Windows then if Target_OS = Windows then
pragma Warnings (On);
Len := V4'Size / 8; Len := V4'Size / 8;
Add := V4'Address; Add := V4'Address;
@ -1217,9 +1212,7 @@ package body GNAT.Sockets is
when Send_Timeout | when Send_Timeout |
Receive_Timeout => Receive_Timeout =>
pragma Warnings (Off);
if Target_OS = Windows then if Target_OS = Windows then
pragma Warnings (On);
-- Timeout is in milliseconds, actual value is 500 ms + -- Timeout is in milliseconds, actual value is 500 ms +
-- returned value (unless it is 0). -- returned value (unless it is 0).
@ -1736,8 +1729,6 @@ package body GNAT.Sockets is
Item : out Ada.Streams.Stream_Element_Array; Item : out Ada.Streams.Stream_Element_Array;
Last : out Ada.Streams.Stream_Element_Offset) Last : out Ada.Streams.Stream_Element_Offset)
is is
pragma Warnings (Off, Stream);
First : Ada.Streams.Stream_Element_Offset := Item'First; First : Ada.Streams.Stream_Element_Offset := Item'First;
Index : Ada.Streams.Stream_Element_Offset := First - 1; Index : Ada.Streams.Stream_Element_Offset := First - 1;
Max : constant Ada.Streams.Stream_Element_Offset := Item'Last; Max : constant Ada.Streams.Stream_Element_Offset := Item'Last;
@ -2270,9 +2261,7 @@ package body GNAT.Sockets is
when Send_Timeout | when Send_Timeout |
Receive_Timeout => Receive_Timeout =>
pragma Warnings (Off);
if Target_OS = Windows then if Target_OS = Windows then
pragma Warnings (On);
-- On Windows, the timeout is a DWORD in milliseconds, and -- On Windows, the timeout is a DWORD in milliseconds, and
-- the actual timeout is 500 ms + the given value (unless it -- the actual timeout is 500 ms + the given value (unless it
@ -2317,17 +2306,12 @@ package body GNAT.Sockets is
use type C.unsigned_short; use type C.unsigned_short;
begin begin
-- Big-endian case. No conversion needed. On these platforms, -- Big-endian case. No conversion needed. On these platforms, htons()
-- htons() defaults to a null procedure. -- defaults to a null procedure.
pragma Warnings (Off);
-- Since the test can generate "always True/False" warning
if Default_Bit_Order = High_Order_First then if Default_Bit_Order = High_Order_First then
return S; return S;
pragma Warnings (On);
-- Little-endian case. We must swap the high and low bytes of this -- Little-endian case. We must swap the high and low bytes of this
-- short to make the port number network compliant. -- short to make the port number network compliant.

View File

@ -6,7 +6,7 @@
-- -- -- --
-- B o d y -- -- B o d y --
-- -- -- --
-- Copyright (C) 1995-2011, AdaCore -- -- Copyright (C) 1995-2012, AdaCore --
-- -- -- --
-- GNAT is free software; you can redistribute it and/or modify it under -- -- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- -- -- terms of the GNU General Public License as published by the Free Soft- --
@ -62,7 +62,6 @@ package body System.HTable is
begin begin
Elmt := Table (Hash (K)); Elmt := Table (Hash (K));
loop loop
if Elmt = Null_Ptr then if Elmt = Null_Ptr then
return Null_Ptr; return Null_Ptr;
@ -96,10 +95,10 @@ package body System.HTable is
begin begin
if not Iterator_Started then if not Iterator_Started then
return Null_Ptr; return Null_Ptr;
else
Iterator_Ptr := Next (Iterator_Ptr);
return Get_Non_Null;
end if; end if;
Iterator_Ptr := Next (Iterator_Ptr);
return Get_Non_Null;
end Get_Next; end Get_Next;
------------------ ------------------
@ -183,7 +182,6 @@ package body System.HTable is
procedure Set (E : Elmt_Ptr) is procedure Set (E : Elmt_Ptr) is
Index : Header_Num; Index : Header_Num;
begin begin
Index := Hash (Get_Key (E)); Index := Hash (Get_Key (E));
Set_Next (E, Table (Index)); Set_Next (E, Table (Index));

View File

@ -264,6 +264,13 @@ package System.OS_Constants is
# define TARGET_OS "Other_OS" # define TARGET_OS "Other_OS"
#endif #endif
C("Target_OS", OS_Type, TARGET_OS, "") C("Target_OS", OS_Type, TARGET_OS, "")
/*
pragma Warnings (Off, Target_OS);
-- Suppress warnings on Target_OS since it is in general tested for
-- equality with a constant valueto implement conditional compilation,
-- which normally generates a constant condition warning.
*/
#define Target_Name TARGET #define Target_Name TARGET
CST(Target_Name, "") CST(Target_Name, "")
/* /*