From: Samuel Tardieu Date: Thu, 17 Apr 2008 09:28:55 +0000 (+0000) Subject: g-socket.ads, [...] (Get_Address): Make Stream a "not null" parameter. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=35485e124cb43114a6c634ce37d8a8c709000cc3;p=gcc.git 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 --- diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index 4b509a120ae..e02847fe3de 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,8 @@ +2008-04-17 Samuel Tardieu + + * g-socket.ads, g-socket.adb (Get_Address): Make Stream a + "not null" parameter. + 2008-04-17 Samuel Tardieu * g-socket.adb: Add a message "IPv6 not supported" to the diff --git a/gcc/ada/g-socket.adb b/gcc/ada/g-socket.adb index f561010679a..981495f5cae 100644 --- a/gcc/ada/g-socket.adb +++ b/gcc/ada/g-socket.adb @@ -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); diff --git a/gcc/ada/g-socket.ads b/gcc/ada/g-socket.ads index 0ed1be0124d..55b68134515 100644 --- a/gcc/ada/g-socket.ads +++ b/gcc/ada/g-socket.ads @@ -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