Commit 35485e12 by Samuel Tardieu Committed by Samuel Tardieu

g-socket.ads, [...] (Get_Address): Make Stream a "not null" parameter.

    gcc/ada/
	* g-socket.ads, g-socket.adb (Get_Address): Make Stream a
	"not null" parameter.

From-SVN: r134386
parent 111c1cd9
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
Socket_Error exception.
......@@ -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);
......
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment