summaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorcharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2012-08-06 07:43:45 +0000
committercharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2012-08-06 07:43:45 +0000
commit81beaf053a90c6134143195b6755edfb0a6c0080 (patch)
tree30a99f9deb518a84c7ea1adc58a359038b3d8b43 /gcc
parentba9b1a3986f32262a221d4cfef7f05338129df82 (diff)
downloadgcc-81beaf053a90c6134143195b6755edfb0a6c0080.tar.gz
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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@190157 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ada/ChangeLog9
-rw-r--r--gcc/ada/g-socket.adb20
-rw-r--r--gcc/ada/s-htable.adb10
-rw-r--r--gcc/ada/s-oscons-tmplt.c7
4 files changed, 22 insertions, 24 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog
index f0336329a73..df4334b1ef1 100644
--- a/gcc/ada/ChangeLog
+++ b/gcc/ada/ChangeLog
@@ -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>
* exp_ch9.adb (Build_Lock_Free_Unprotected_Subprogram_Body):
diff --git a/gcc/ada/g-socket.adb b/gcc/ada/g-socket.adb
index d84c28f0732..ac03f42165e 100644
--- a/gcc/ada/g-socket.adb
+++ b/gcc/ada/g-socket.adb
@@ -480,9 +480,7 @@ package body GNAT.Sockets is
-- no check required. Warnings suppressed because condition
-- is known at compile time.
- pragma Warnings (Off);
if Target_OS = Windows then
- pragma Warnings (On);
return;
@@ -1150,10 +1148,7 @@ package body GNAT.Sockets is
-- struct timeval, but on Windows it is a milliseconds count in
-- a DWORD.
- pragma Warnings (Off);
if Target_OS = Windows then
- pragma Warnings (On);
-
Len := V4'Size / 8;
Add := V4'Address;
@@ -1217,9 +1212,7 @@ package body GNAT.Sockets is
when Send_Timeout |
Receive_Timeout =>
- pragma Warnings (Off);
if Target_OS = Windows then
- pragma Warnings (On);
-- Timeout is in milliseconds, actual value is 500 ms +
-- returned value (unless it is 0).
@@ -1736,8 +1729,6 @@ package body GNAT.Sockets is
Item : out Ada.Streams.Stream_Element_Array;
Last : out Ada.Streams.Stream_Element_Offset)
is
- pragma Warnings (Off, Stream);
-
First : Ada.Streams.Stream_Element_Offset := Item'First;
Index : Ada.Streams.Stream_Element_Offset := First - 1;
Max : constant Ada.Streams.Stream_Element_Offset := Item'Last;
@@ -2270,9 +2261,7 @@ package body GNAT.Sockets is
when Send_Timeout |
Receive_Timeout =>
- pragma Warnings (Off);
if Target_OS = Windows then
- pragma Warnings (On);
-- On Windows, the timeout is a DWORD in milliseconds, and
-- 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;
begin
- -- Big-endian case. No conversion needed. On these platforms,
- -- htons() defaults to a null procedure.
-
- pragma Warnings (Off);
- -- Since the test can generate "always True/False" warning
+ -- Big-endian case. No conversion needed. On these platforms, htons()
+ -- defaults to a null procedure.
if Default_Bit_Order = High_Order_First then
return S;
- pragma Warnings (On);
-
-- Little-endian case. We must swap the high and low bytes of this
-- short to make the port number network compliant.
diff --git a/gcc/ada/s-htable.adb b/gcc/ada/s-htable.adb
index e2b5235f054..b8116f9437d 100644
--- a/gcc/ada/s-htable.adb
+++ b/gcc/ada/s-htable.adb
@@ -6,7 +6,7 @@
-- --
-- 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 --
-- terms of the GNU General Public License as published by the Free Soft- --
@@ -62,7 +62,6 @@ package body System.HTable is
begin
Elmt := Table (Hash (K));
-
loop
if Elmt = Null_Ptr then
return Null_Ptr;
@@ -96,10 +95,10 @@ package body System.HTable is
begin
if not Iterator_Started then
return Null_Ptr;
+ else
+ Iterator_Ptr := Next (Iterator_Ptr);
+ return Get_Non_Null;
end if;
-
- Iterator_Ptr := Next (Iterator_Ptr);
- return Get_Non_Null;
end Get_Next;
------------------
@@ -183,7 +182,6 @@ package body System.HTable is
procedure Set (E : Elmt_Ptr) is
Index : Header_Num;
-
begin
Index := Hash (Get_Key (E));
Set_Next (E, Table (Index));
diff --git a/gcc/ada/s-oscons-tmplt.c b/gcc/ada/s-oscons-tmplt.c
index 467a1e4356e..dbfab4ec804 100644
--- a/gcc/ada/s-oscons-tmplt.c
+++ b/gcc/ada/s-oscons-tmplt.c
@@ -264,6 +264,13 @@ package System.OS_Constants is
# define TARGET_OS "Other_OS"
#endif
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
CST(Target_Name, "")
/*