From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=0.4 required=5.0 tests=BAYES_00,FORGED_MUA_MOZILLA autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,d778a4f52acd9d43 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Received: by 10.68.189.194 with SMTP id gk2mr16629941pbc.3.1324888390306; Mon, 26 Dec 2011 00:33:10 -0800 (PST) Path: lh20ni65679pbb.0!nntp.google.com!news2.google.com!volia.net!news2.volia.net!feed-A.news.volia.net!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Niklas Holsti Newsgroups: comp.lang.ada Subject: Re: Representation clauses for base-64 encoding Date: Mon, 26 Dec 2011 10:33:08 +0200 Organization: Tidorum Ltd Message-ID: <9lqpq5Ft05U1@mid.individual.net> References: <9lgi3jFhaU1@mid.individual.net> Mime-Version: 1.0 X-Trace: individual.net HjecI/MgOH926zD/6TB4nAqwc1yLwERdfrp8YmU0sOiOVgLRCc Cancel-Lock: sha1:pU4yF/lt9qtahuvmMgt2PWOyhAs= User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:8.0) Gecko/20111105 Thunderbird/8.0 In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Date: 2011-12-26T10:33:08+02:00 List-Id: On 11-12-23 03:30 , Randy Brukardt wrote: > "Niklas Holsti" wrote in message > news:9lgi3jFhaU1@mid.individual.net... >> On 11-12-22 11:41 , Natasha Kerensikova wrote: > ... >>> type Octet_Block is array (1 .. 3) of Octet; >>> pragma Pack (Octet_Block); >> >> I would add the following, to check that packing is effective: >> >> for Octet_Block'Size use 24; > > I think it would probably be better to forget Pack and actually say what you > mean here: > > type Octet_Block is array (1 .. 3) of Octet; > for Octet_Block'Component_Size use 8; > > "Pack" should be reserved for cases where you don't care about the exact > layout, you just want to save space. Here you do care about the exact > layout, so use a Component_Size. Fine adjustment: when Component_Size is not a factor or multiple of the word size, RM 13.3(73) says that the array may also have to be packed in order to eliminate gaps between components. Of course, a Component_Size of 8 bits is usually a factor of the word size. But perhaps not always. -- Niklas Holsti Tidorum Ltd niklas holsti tidorum fi . @ .