diff options
Diffstat (limited to 'gcc/ada/g-socket.adb')
-rw-r--r-- | gcc/ada/g-socket.adb | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/gcc/ada/g-socket.adb b/gcc/ada/g-socket.adb index 75a1c300fef..b2d4f259cc3 100644 --- a/gcc/ada/g-socket.adb +++ b/gcc/ada/g-socket.adb @@ -44,7 +44,7 @@ with GNAT.Task_Lock; with GNAT.Sockets.Linker_Options; pragma Warnings (Off, GNAT.Sockets.Linker_Options); --- Need to include pragma Linker_Options which is platform dependent. +-- Need to include pragma Linker_Options which is platform dependent with System; use System; @@ -226,9 +226,9 @@ package body GNAT.Sockets is -------------------- procedure Abort_Selector (Selector : Selector_Type) is - Buf : Character; + Buf : aliased Character := ASCII.NUL; Discard : C.int; - pragma Warnings (Off, Discard); + pragma Unreferenced (Discard); begin -- Send an empty array to unblock C select system call @@ -1288,7 +1288,7 @@ package body GNAT.Sockets is begin return Item.Last /= No_Socket and then Socket <= Item.Last - and then Is_Socket_In_Set (Item.Set, C.int (Socket)); + and then Is_Socket_In_Set (Item.Set, C.int (Socket)) /= 0; end Is_Set; ------------------- @@ -1865,22 +1865,23 @@ package body GNAT.Sockets is use type C.unsigned_short; begin - pragma Warnings (Off); - -- 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 + 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. else return (S / 256) + (S mod 256) * 256; end if; - - pragma Warnings (On); end Short_To_Network; --------------------- |