]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
g-socket.ads, [...] (Get_Address): Make Stream a "not null" parameter.
authorSamuel Tardieu <sam@rfc1149.net>
Thu, 17 Apr 2008 09:28:55 +0000 (09:28 +0000)
committerSamuel Tardieu <sam@gcc.gnu.org>
Thu, 17 Apr 2008 09:28:55 +0000 (09:28 +0000)
    gcc/ada/
* g-socket.ads, g-socket.adb (Get_Address): Make Stream a
"not null" parameter.

From-SVN: r134386

gcc/ada/ChangeLog
gcc/ada/g-socket.adb
gcc/ada/g-socket.ads

index 4b509a120ae89221904178a4537f2392fb9f40de..e02847fe3deb349c7c448dd16a700a176cd926b3 100644 (file)
@@ -1,3 +1,8 @@
+2008-04-17  Samuel Tardieu  <sam@rfc1149.net>
+
+       * g-socket.ads, g-socket.adb (Get_Address): Make Stream a
+       "not null" parameter.
+
 2008-04-17  Samuel Tardieu  <sam@rfc1149.net>
 
        * g-socket.adb: Add a message "IPv6 not supported" to the
index f561010679a5554629344cf1c29dd59297527c8b..981495f5caed66d5a7c248cb7a240c520217d2ab 100644 (file)
@@ -763,11 +763,11 @@ package body GNAT.Sockets is
    -- Get_Address --
    -----------------
 
-   function Get_Address (Stream : Stream_Access) return Sock_Addr_Type is
+   function Get_Address
+     (Stream : not null Stream_Access) return Sock_Addr_Type
+   is
    begin
-      if Stream = null then
-         raise Socket_Error;
-      elsif Stream.all in Datagram_Socket_Stream_Type then
+      if Stream.all in Datagram_Socket_Stream_Type then
          return Datagram_Socket_Stream_Type (Stream.all).From;
       else
          return Get_Peer_Name (Stream_Socket_Stream_Type (Stream.all).Socket);
index 0ed1be0124db962330e72e22726be9bce3d470b1..55b68134515a9ebf380c8426ca0c56c43c9e15ad 100644 (file)
@@ -900,7 +900,8 @@ package GNAT.Sockets is
    --  Create a stream associated with a datagram-based socket that is already
    --  bound. Send_To is the socket address to which messages are being sent.
 
-   function Get_Address (Stream : Stream_Access) return Sock_Addr_Type;
+   function Get_Address
+     (Stream : not null Stream_Access) return Sock_Addr_Type;
    --  Return the socket address from which the last message was received
 
    procedure Free is new Ada.Unchecked_Deallocation