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=0.2 required=5.0 tests=BAYES_00,INVALID_MSGID, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,641f47d4563311a6,start X-Google-Attributes: gid103376,public From: Joseph P Vlietstra Subject: Array of bytes type Date: 2000/05/19 Message-ID: <3924E094.6B03B5BD@concentric.net>#1/1 X-Deja-AN: 625297227 Content-Transfer-Encoding: 7bit X-Accept-Language: en Content-Type: text/plain; charset=us-ascii Organization: Mojave Systems Corporation Mime-Version: 1.0 Reply-To: joevl@concentric.net Newsgroups: comp.lang.ada Date: 2000-05-19T00:00:00+00:00 List-Id: Hi all, I'm on a project which reuses/modifies code from several sources and previous projects. While integrating these packages together we found 5 different declarations for an "array of bytes" type. The declarations are similar enough that UC will copy slices from one type to another but different enough to prevent any "clever" conversions (e.g., overlays will fail due to different sizes in index type). We will probably standardize on one array of bytes type, play with renames, etc. But this effort has raises a question: what is the plainest, simplest to reuse, declaration of an array of bytes? (I would hope that some future project will steal/reuse my code without the headaches I'm facing.) Alternatives: 1. Roll my own. For example: type Byte_Array is array(Integer range <>) of Interfaces.Unsigned_8; This seems like a universally useful array of bytes type; but I already have 5 different opinions of what a useful array of bytes type should look like. So I'm thinking about hijacking something that is already defined in the LRM. 2. Use Stream_Element_Array. We do a lot of UC between our byte arrays and other data types. (Commmands come in and telemetry goes out in byte arrays.) This approach allows the possibility of using 'Read and 'Write to perform conversions on the byte array (using memory stream). The problem, of course, is that Stream_Element is implementation defined and need not match Storage_Element. BTW: Does anyone know of an implementation where Stream_Element doesn't match Storage_Element? 3. Use Storage_Element_Array. Again, this is implementation defined. (We're using a 32-bit processor, but a lot of spacecraft still use 1750A processors where the storage element is 16 bits.) 4. FLAME PROTECTION ON Use String FLAME PROTECTION OFF 5. Any other ideas?