comp.lang.ada
 help / color / mirror / Atom feed
* Porting from Modula-2 to Ada
@ 2002-10-18  8:24 Manuel Collado
  2002-10-18  9:45 ` Bernd Specht
                   ` (3 more replies)
  0 siblings, 4 replies; 19+ messages in thread
From: Manuel Collado @ 2002-10-18  8:24 UTC (permalink / raw)


We are porting some legacy Modula-2/C code to Ada. The code uses
low-level facilities from Modula-2 and C. We would like to port it to
clean Ada, without interfacing to C code. In addition we would like to
keep the old interface unchanged (if possible).

Al present we are looking for ways to manage memory and binary files as
arrays of bytes. The trouble is that Modula-2 allows the use of relaxed
ARRAY OF BYTE subprogram formal parameters, that are compatible with
actual parameters of any type. Example:

   PROCEDURE Xxx( raw: ARRAY OF BYTE );
      ...
   BEGIN
      FOR  k := 0 TO HIGH(raw) DO
         ... raw[k] ....
      END
   END Xxx;

   Num: INTEGER;
   ...
      Xxx( Num );
   ...


So far, my only porting scheme is to replace ARRAY OF BYTE parameters by
the pair (address, size), as follows:

   procedure Xxx (Raw_Address: System.Address; Raw_Size: Integer) ...

   Num: Integer;
   ...
      Xxx (Num'Address, Num'Size);
   ...

But this requires recoding every call to the procedure. Is there another
way to pass raw data without having to recode every call?

Thanks.
-- 
To reply by e-mail, please remove the extra dot
in the given address:  m.collado -> mcollado



^ permalink raw reply	[flat|nested] 19+ messages in thread

end of thread, other threads:[~2003-02-09  6:07 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-10-18  8:24 Porting from Modula-2 to Ada Manuel Collado
2002-10-18  9:45 ` Bernd Specht
2002-10-18 10:33   ` Lutz Donnerhacke
2002-10-18 10:55     ` Jeffrey Creem
2002-10-18 11:21       ` Lutz Donnerhacke
2002-10-18 22:01         ` Jeffrey Creem
2002-10-18 21:29     ` Jeffrey Carter
2002-10-18 21:39       ` Jeffrey Carter
2002-10-18 11:20 ` Nicolas Cailín Paul Gloster
2002-10-18 15:14   ` Pat Rogers
2002-10-24 14:51     ` Colin Paul Gloster
2002-10-25  3:43       ` Dennis Lee Bieber
2003-02-04 14:12       ` Colin Paul Gloster
2003-02-09  6:07         ` Robert I. Eachus
2002-10-19 13:30 ` SteveD
2002-10-22  7:48   ` Manuel Collado
2002-10-22  7:55 ` Manuel Collado
2002-10-22 18:56   ` Jeffrey Carter
2002-10-23  9:08     ` Manuel Collado

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox