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,971aa11c293c3db1 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-07-20 08:35:04 PST Path: archiver1.google.com!newsfeed.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!fr.usenet-edu.net!usenet-edu.net!wanadoo.fr!proxad.net!nerim.net!norfair.nerim.net!not-for-mail From: "Bertrand Augereau" Newsgroups: comp.lang.ada Subject: Re: Ada The Best Language? Date: Fri, 20 Jul 2001 17:39:27 +0200 Organization: Nerim -- xDSL Internet Provider Message-ID: <9j9j37$27qe$1@norfair.nerim.net> References: <5be89e2f.0107170838.c71ad61@posting.google.com> <5be89e2f.0107180235.726d46a8@posting.google.com> <3B55B01A.DAC06D79@icn.siemens.de> <5be89e2f.0107181248.73298c57@posting.google.com> <9j949b$1ujp$1@norfair.nerim.net> <9j983r$20jq$1@norfair.nerim.net> <9j9bdh$22kn$1@norfair.nerim.net> NNTP-Posting-Host: aboukir-101-2-1-inutero.adsl.nerim.net X-Trace: norfair.nerim.net 995643303 73550 62.4.19.69 (20 Jul 2001 15:35:03 GMT) X-Complaints-To: abuse@nerim.net NNTP-Posting-Date: Fri, 20 Jul 2001 15:35:03 +0000 (UTC) X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.50.4522.1200 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200 Xref: archiver1.google.com comp.lang.ada:10338 Date: 2001-07-20T17:39:27+02:00 List-Id: > > > >struct Head > >{ > > ... > > unsigned int offset1:5; > > unsigned int more_fragments :1; > > unsigned int dont_fragment : 1; > > unsigned int pad:1; > > .. > >} > > What does "Head.more_fragments = (total - send)/packet_size;" mean? It is an unsigned int affectation which is undefined if ((total - send)/packet_size) is bigger than 1 bit, no? > > >But you have to ensure the previous elements of the structure make the > >padding right. > > No problem. I can live with that (unfortunely, I can't remember the C++ > language definition specifying that all components must be not aligned but > packed.) I guess bitfields force packing, but I'm not sure. And my Stroustrup's not there. Else you got me and we have to rely on copmpiler specific stuff. I'll check.