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-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,ed023c7889c56295 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-08-28 05:18:21 PST Path: archiver1.google.com!newsfeed.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.frii.net!easynews!e420r-sjo4.usenetserver.com!usenetserver.com!e420r-atl2.usenetserver.com.POSTED!not-for-mail From: "Dale Pennington" Newsgroups: comp.lang.ada References: Subject: Re: Ada Compiler Complaint ? X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.00.2014.211 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2014.211 Message-ID: X-Complaints-To: abuse@usenetserver.com X-Abuse-Info: Please be sure to forward a copy of ALL headers X-Abuse-Info: Otherwise we will be unable to process your complaint properly. NNTP-Posting-Date: Tue, 28 Aug 2001 08:13:26 EDT Organization: WebUseNet Corp. - "ReInventing The UseNet" Date: Tue, 28 Aug 2001 07:10:59 -0500 Xref: archiver1.google.com comp.lang.ada:12510 Date: 2001-08-28T07:10:59-05:00 List-Id: First, this is code that we are being given by a third party as a library. Looking at the code segement it is being to used to dump a bit packed buffer area. The procedure Y kinda looks like this (PS do not hit me on small syntax errors, this is off the top of my head). function To_Bit_Array is new Unchecked_Conversion(System.Address,Bit_Array_Ptr); procedure Y( buffer : System.Address ; size : integer; Outfile : wrote in message news:mailman.998993202.10206.comp.lang.ada@ada.eu.org... > Since file IO can only be done in whole bytes, what > was your intention in instantiating Integer_IO for > your Bit type? E.g., ion which bit of each byte would > the data bit reside? > > Incidentally, the type bit would probably be better defined > as mod 2 instead of range 0 .. 1. > > ----- Original Message ----- > From: "Dale Pennington" > Newsgroups: comp.lang.ada > To: > Sent: August 27, 2001 10:02 PM > Subject: Ada Compiler Complaint ? > > > > Folks, looks like my company news server is acting wierd, so I am also > > posting from a home account. If this shows up twice, just ignore the second > > one. > > > > I have a chunk of code giving me an error I do not understand. The code is : > > > > package X > > ... > > type Bit is range (0..1); > > for Bit'Size use 1; > > > > type Bit_Array is array(1..20000) of Bit; > > pragma Pack(Bit_Array); > > > > type Bit_Array_Ptr is access Bit_Array; > > > > package Bit_Io is new Ada.Text_Io.Integer_Io(Bit); > > > > ... > > > > procedure Y > > ... > > A_Bit_Array : Bit_Array_Ptr; > > begin > > ... > > Bit_Io.Put(Outfile,A_Bit_Array(I),1); > > ... > > end Y; > > ... > > end package X; > > > > The compiler complains for the Bit_Io.Put instruction on the column > > A_Bit_Array starts : > > expected type "System.Unsigned_Types.Packed_Byte" > > found type "Bit" defined at xxx. > > > > Where xxx is the line the type Bit is at. > > > > Anyone know why the compiler is complaining, and what I can do about it ? > > > > Thanks > > > > Dale Pennington > > > > > > > > > > > > > > _______________________________________________ > > comp.lang.ada mailing list > > comp.lang.ada@ada.eu.org > > http://ada.eu.org/mailman/listinfo/comp.lang.ada > > >