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.9 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM,WEIRD_PORT autolearn=no autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!mx02.eternal-september.org!.POSTED!not-for-mail From: =?UTF-8?B?QmrDtnJuIEx1bmRpbg==?= Newsgroups: comp.lang.ada Subject: Ada.Containers warnings with gnat Date: Sat, 15 Nov 2014 15:35:41 +0100 Organization: A noiseless patient Spider Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Date: Sat, 15 Nov 2014 14:34:12 +0000 (UTC) Injection-Info: mx02.eternal-september.org; posting-host="b769336d2d75b70563e15ed95a5ef354"; logging-data="13055"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19oAeexbKfJaU+hNqN7YD9T" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Icedove/31.1.2 Cancel-Lock: sha1:m/Frg+Lz5Vz0L2BXiQSiAQlEC0A= Xref: news.eternal-september.org comp.lang.ada:23376 Date: 2014-11-15T15:35:41+01:00 List-Id: Hi! I'm using a db to keep data in, that I retrieve and put into ordered and hashed maps from Ada.Containers. I do this to * learn to use Ada standard containers, instead of home-rolled lists * to simulate outcome of different parameters into a business modell Reading from db takes about 1 hour, with i5/ssd/12 gb ram needless to say, I'd like this to go faster. So, I rewrote the simulator to use the mentioned containers. I then run it once, and save the maps into (largish ) files instead via streams and 'write/'read. fantastic performance. The simulator was in a single file before -> no problem. So I then refactored and created a storage package and suddenly I get warnings like /home/bnl/bnlbot/botstart/bot-1-0/source/ada/local/utils/simulation_storage.ads 17. package Sample_Map_Pack is new Ada.Containers.Ordered_Maps | >>> warning: in instantiation at a-coorma.ads:266 >>> warning: no entities of package "Ada.Streams" are referenced 23. package Marketid_Map_Pack is new Ada.Containers.Hashed_Maps | >>> warning: in instantiation at a-cohama.ads:342 >>> warning: no entities of package "Ada.Streams" are referenced 30. package Winner_Map_Pack is new Ada.Containers.Hashed_Maps | >>> warning: in instantiation at a-cohama.ads:342 >>> warning: no entities of package "Ada.Streams" are referenced 37. package Win_Place_Map_Pack is new Ada.Containers.Hashed_Maps | >>> warning: in instantiation at a-cohama.ads:342 >>> warning: no entities of package "Ada.Streams" are referenced what do the mean ? The body of the package uses streams like Log("read Marketid_Map from file "); declare File : Ada.Streams.Stream_IO.File_Type; Stream : Ada.Streams.Stream_IO.Stream_Access; Filename : String := Map_files(Marketid).Filename.Fix_String; begin Ada.Streams.Stream_IO.Open (File => File, Name => Filename, Mode => Ada.Streams.Stream_IO.In_File); Stream := Ada.Streams.Stream_IO.Stream (File); Marketid_Map_Pack.Map'Read(Stream, Marketid_Map); Ada.Streams.Stream_IO.Close(File); Log("Marketid_Map read from file " & Filename); end; package spec is --------------------------- with Ada; with Ada.Strings; with Ada.Strings.Hash; with Ada.Containers; with Ada.Containers.Hashed_Maps; with Ada.Containers.Ordered_Maps; with Calendar2; with Bot_Types; use Bot_Types; with Table_Apricesfinish; with Table_Arunners; package Simulation_Storage is package Sample_Map_Pack is new Ada.Containers.Ordered_Maps (Key_Type => Calendar2.Time_Type, Element_Type => Table_Apricesfinish.Apricesfinish_List_Pack2.List, "<" => Calendar2."<", "=" => Table_Apricesfinish.Apricesfinish_List_Pack2."="); package Marketid_Map_Pack is new Ada.Containers.Hashed_Maps (Market_Id_Type, Sample_Map_Pack.Map, Ada.Strings.Hash, "=", Sample_Map_Pack."="); package Winner_Map_Pack is new Ada.Containers.Hashed_Maps (Market_Id_Type, Table_Arunners.Arunners_List_Pack2.List, Ada.Strings.Hash, "=", Table_Arunners.Arunners_List_Pack2."="); package Win_Place_Map_Pack is new Ada.Containers.Hashed_Maps (Market_Id_Type, Market_Id_Type, Ada.Strings.Hash, "=", "="); procedure Create_Files_From_Database; procedure Fill_Maps(Marketid_Map : out Marketid_Map_Pack.Map; Winner_Map : out Winner_Map_Pack.Map; Win_Place_Map : out Win_Place_Map_Pack.Map) ; end Simulation_Storage; -- Björn