comp.lang.ada
 help / color / mirror / Atom feed
From: Jeffrey Carter <spam.jrcarter.not@spam.not.acm.org>
Subject: Re: Question[s] about aliased extended return.
Date: Fri, 09 Nov 2012 18:08:43 -0700
Date: 2012-11-09T18:08:43-07:00	[thread overview]
Message-ID: <k7k9es$5nd$1@dont-email.me> (raw)
In-Reply-To: <bc5c504b-6261-4a18-a7b6-36bb95fabd7f@googlegroups.com>

On 11/09/2012 12:42 PM, Shark8 wrote:
>
>      Function GetTexGen (	coord : Texture_Coordinate_Type;
> 				pname : Texture_Coordinate_Generation)
> 				Return Double_Vector_Type is
>      begin
> 	Return Result : Double_Vector_Type(1..Get_Elements( pname )) do
> 		glGetTexGendv(
> 			coord  => Convert(coord),
> 			pname  => Convert(pname),
> 			params => To_Pointer( Result'Address )
> 		);
> 	End Return;
>      end GetTexGen;

The extended return exists for build-in-place results of limited types. There's 
really no reason to use it for other types.

function Gettexgen (Coord : in Texture_Coordiate_Type;
                     Pname : in Texture_Coordinate_Generation)
return Double_Vector_Type is
    Result : aliased Double_Vector_Type (1 .. Get_Elements (Pname) );
begin -- Gettexgen
    Glgettexgendv (Coord  => Convert (Coord),
                   Pname  => Convert (Pname),
                   Params => Result'Unchecked_Access);

    return Result;
end Gettexgen;

-- 
Jeff Carter
"It is the German who is so uncourteous to his verbs."
A Scandal in Bohemia
122



  parent reply	other threads:[~2012-11-10  1:08 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-02 15:55 Question[s] about aliased extended return Shark8
2012-11-09  0:43 ` Randy Brukardt
2012-11-09  3:40   ` Yannick Duchêne (Hibou57)
2012-11-10  7:34     ` Randy Brukardt
2012-11-09 19:42   ` Shark8
2012-11-09 20:53     ` sbelmont700
2012-11-09 21:44       ` Yannick Duchêne (Hibou57)
2012-11-09 22:04         ` sbelmont700
2012-11-09 22:56           ` Shark8
2012-11-09 22:54         ` Shark8
2012-11-10  7:27           ` Randy Brukardt
2012-11-10 16:08             ` Shark8
2012-11-10  1:08     ` Jeffrey Carter [this message]
2012-11-10  1:52       ` Shark8
2012-11-10  2:17         ` Yannick Duchêne (Hibou57)
2012-11-10 10:59         ` Bill Findlay
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox