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 07:22:05 PST Path: archiver1.google.com!newsfeed.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!cpk-news-hub1.bbnplanet.com!news.gtei.net!news-FFM2.ecrc.net!news.iks-jena.de!lutz From: lutz@iks-jena.de (Lutz Donnerhacke) Newsgroups: comp.lang.ada Subject: Re: Ada The Best Language? Date: Fri, 20 Jul 2001 14:19:02 +0000 (UTC) Organization: IKS GmbH Jena Message-ID: 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: taranis.iks-jena.de X-Trace: branwen.iks-jena.de 995638742 26045 217.17.192.37 (20 Jul 2001 14:19:02 GMT) X-Complaints-To: usenet@iks-jena.de NNTP-Posting-Date: Fri, 20 Jul 2001 14:19:02 +0000 (UTC) User-Agent: slrn/0.9.6.3 (Linux) Xref: archiver1.google.com comp.lang.ada:10335 Date: 2001-07-20T14:19:02+00:00 List-Id: * Bertrand Augereau wrote: >> Please specify the C++ Code for offset 6. >> [...] >> dont_fragment at 6 range 6 .. 6; >> more_fragments at 6 range 5 .. 5; >> offset1 at 6 range 0 .. 4; >> [...] > >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? >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.) >> https://www.iks-jena.de/mitarb/lutz/ada/net/net-portability__adb.htm >> >> It's horrible ugly, but compile time evaluable and the generated code >> is incredibly fine. Ever seen a Compiler generating an endian prefix on >> alpha? > >Sometimes you have to live with ugliness... No. I'm designing a language to specify such format.