From: "Francisco J. Montoya" <fmontoya.removethis@dif.andthis.um.es>
Subject: Re: TYPE'Size in static expression
Date: Mon, 24 Oct 2005 12:56:31 +0200
Date: 2005-10-24T10:58:28+00:00 [thread overview]
Message-ID: <435CBDDF.3040607@dif.andthis.um.es> (raw)
In-Reply-To: p06ipbbj9t3d.15cu37vh2fjuo.dlg@40tude.net
Thank you very much for your quick answer, Dmitry.
That, indeed, solved my problem, but I still do not finish in
understanding why what I wrote did not work. The expression I wrote is
supposed to be of "Universal Integer Type", isn't it? So adding the
explicit type "Integer" to the constant definition should not make much
difference.
Anyhow, I'm just a newbie and a clumsy Ada programmer, so don't pay too
much attention to what I say ;)
Regards, and thanks again.
Dmitry A. Kazakov escribió:
> On Fri, 21 Oct 2005 10:04:59 +0200, Francisco J. Montoya wrote:
>
>
>>My first attempt was to make some definitions like the following:
>>
>> Buffer_Size : constant := 1024; -- 1Kb buffer
>> Num_Elements : constant := 8 * Buffer_Size / BaseType'Size; -- Wrong!
>
>
> Num_Elements : constant Integer :=
> 8 * Buffer_Size / BaseType'Size;
>
>
>> type Buffer is array (1..Num_Elements) of BaseType;
>
>
--
Francisco J. Montoya
Depto. Informatica y Sistemas, Facultad de Informatica
(E-30071 Campus de Espinardo) Universidad de Murcia (Spain)
Voice: +34 968 364620, Fax: +34 968 364151,
e-mail: fmontoya AT dif.um.es
next prev parent reply other threads:[~2005-10-24 10:56 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-10-21 8:04 TYPE'Size in static expression Francisco J. Montoya
2005-10-21 8:55 ` Dmitry A. Kazakov
2005-10-21 22:09 ` Jeffrey R. Carter
2005-10-24 10:56 ` Francisco J. Montoya [this message]
2005-10-24 11:45 ` Dmitry A. Kazakov
2005-10-24 19:15 ` Jeffrey R. Carter
2005-10-24 20:15 ` Robert A Duff
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox