From: Al Johnston <sofeise@mindspring.com>
Subject: HOW? item_ptr := item'access
Date: 2000/04/11
Date: 2000-04-11T16:06:34+00:00 [thread overview]
Message-ID: <38F34D00.FA32AC68@mindspring.com> (raw)
I am trying to get rid of some of are use of system.address/
unchecked_conversion as part of my port to ada95. I have
run into a snag. The line (full test case code follows this msg):
t_DBase_Ptr : Database_Ptr_Typ := Database'access; <<< -----
compiler complans
causes a compiler error indicating that "database" must be
declare "aliased" that is
database : aliased database_typ;
problem is that this object is never declared in
the ada code (it is created/destroyed in our c code) so there
is no place to do this.
Is there a way of doing the same thing useing "use"/"use at"?
what should I do to get this to work?
tnx,
-al
package PDB is
type Database_Typ is limited private;
type Database_Ptr_Typ is access Database_Typ;
procedure Close(Database : in out Database_Typ);
private
type Database_Item;
type Database_Typ is access Database_Item;
end PDB;
with PDB_C_Lib;
with system;
package body PDB is
type Parameter_Item is new System.Address;
type Database_Item is new System.Address;
procedure Close(Database : in out Database_Typ) is
t_DBase_Ptr : Database_Ptr_Typ := Database'access; <<< -----
compiler complans
begin
PDB_C_Lib.pdb_close(t_DBase_Ptr);
end Close;
end PDB;
package PDB_C_Lib is
procedure pdb_close(Database_Ptr : PDB.Database_Ptr_Typ);
pragma import(c,pdb_close,"pdb_close");
end PDB_C_Lib;
the c "pdb_close" routine sets the pointer (database_ptr) to null;
next reply other threads:[~2000-04-11 0:00 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2000-04-11 0:00 Al Johnston [this message]
2000-04-12 0:00 ` HOW? item_ptr := item'access Ted Dennison
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox