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=unavailable autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail From: Simon Wright Newsgroups: comp.lang.ada Subject: Re: AI12-0218: What is the portable representation clause for processing IETF packets on little-endian machines? Date: Fri, 11 May 2018 14:46:59 +0100 Organization: A noiseless patient Spider Message-ID: References: <9af47760-e731-4cb5-a1a0-d63e31019ce5@googlegroups.com> <877eob1cc6.fsf@nightsong.com> <5c9b9f90-884f-4de7-8663-d39a67949f4f@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: reader02.eternal-september.org; posting-host="906cab77493fe040d97f450db9e7653d"; logging-data="15757"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+EsRsbnRJ8LKQyN7fgdP6mnM8ZgFVNrQ0=" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.3 (darwin) Cancel-Lock: sha1:Jc/SYpxWEfVlXfmEVilZj15D9BA= sha1:aO0My8bcp6dPBUqxgVIBh771NBs= Xref: reader02.eternal-september.org comp.lang.ada:52271 Date: 2018-05-11T14:46:59+01:00 List-Id: Simon Wright writes: > type Leap_Indicator is (No_Warning, > Last_Minute_Has_61_Seconds, > Last_Minute_Has_59_Seconds, > Alarm_Condition); > > type Version is range 3 .. 4; > > type Mode is (Reserved, > Symmetric_Active, > Symmetric_Passive, > Client, > Server, > Broadcast, > Reserved_For_NTP_Control_Message, > Reserved_For_Private_Use); > > type Status is record > LI : Leap_Indicator; > VN : Version; > M : Mode; > end record; > > in native layout (nowadays I'd be a lot more specific about > sizes). Actually, I don't think I would: I realise that in that code I was leaving it up to the compiler to work out the best representation for use in the vast majority of the program. Just specify enumerations, ranges and don't overthink it.