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=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,e710f7d3f890e76b X-Google-Attributes: gid103376,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news3.google.com!feeder1-2.proxad.net!proxad.net!feeder1-1.proxad.net!club-internet.fr!feedme-small.clubint.net!nuzba.szn.dk!news.jacob-sparre.dk!pnx.dk!not-for-mail From: Jacob Sparre Andersen Newsgroups: comp.lang.ada Subject: Re: Base64-Encoding Date: Mon, 15 Oct 2007 17:14:25 +0200 Organization: Jacob's private Usenet server Message-ID: References: <20071015161229.3f439230@cube.tz.axivion.com> <20071015165435.0eef160d@cube.tz.axivion.com> NNTP-Posting-Host: taasingegade.news.jacob-sparre.dk Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: jacob-sparre.dk 1192461266 13002 85.82.239.166 (15 Oct 2007 15:14:26 GMT) X-Complaints-To: news@jacob-sparre.dk NNTP-Posting-Date: Mon, 15 Oct 2007 15:14:26 +0000 (UTC) User-Agent: Gnus/5.110006 (No Gnus v0.6) Emacs/21.4 (gnu/linux) Cancel-Lock: sha1:lm9svWBedRwhcLY5rXczLMO55Rg= Xref: g2news2.google.com comp.lang.ada:2453 Date: 2007-10-15T17:14:25+02:00 List-Id: Stefan Bellon wrote: > On Mon, 15 Oct, Jacob Sparre Andersen wrote: >> Padded_Data : String (1 .. Padded_Length) := Data & (others => >> ASCII.NUL); >> >> would work fine. > > This results in: > > error: "others" choice not allowed here I can't figure out why, but here's something which does work: Padded_Data : String (1 .. Padded_Length) := Data & (Data'Length + 1 .. Padded_Length => ASCII.NUL); > I hoped for this as well, but it looks like the attribute Bit_Order is > only defined for record types. This is what 13.5.3 says and indeed GNAT > refuses to accept a 'Bit_Order on Six_Bits or the array thereof. Doesn't that simply mean that you have to make "Base64_Data" an array of Base64_Block, where Base64_Block is declared like this: type Base64_Block is record A, B, C, D : Six_Bits; end record; This way you will be allowed bit ordering on the Base64_Block, which hopefully will solve your problem. Greetings, Jacob -- Adlai Stevenson said it all when, at an event during the 1956 Presidential campaign, a woman shouted, "You have the vote of every thinking person!" Stevenson shouted back, "That's not enough, madam, we need a majority!"