-- --
-- B o d y --
-- --
--- Copyright (C) 2001-2010, AdaCore --
+-- Copyright (C) 2001-2011, AdaCore --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
procedure Narrow (Item : in out Socket_Set_Type);
-- Update Last as it may be greater than the real last socket
+ procedure Check_For_Fd_Set (Fd : Socket_Type);
+ pragma Inline (Check_For_Fd_Set);
+ -- Raise Constraint_Error if Fd is less than 0 or greater than or equal to
+ -- FD_SETSIZE.
+
-- Types needed for Datagram_Socket_Stream_Type
type Datagram_Socket_Stream_Type is new Root_Stream_Type with record
Narrow (E_Socket_Set);
end Check_Selector;
+ ----------------------
+ -- Check_For_Fd_Set --
+ ----------------------
+
+ procedure Check_For_Fd_Set (Fd : Socket_Type) is
+ begin
+ if Fd < 0 or else Fd >= SOSC.FD_SETSIZE then
+ raise Constraint_Error with "invalid value for socket set: "
+ & Image (Fd);
+ end if;
+ end Check_For_Fd_Set;
+
-----------
-- Clear --
-----------
is
Last : aliased C.int := C.int (Item.Last);
begin
+ Check_For_Fd_Set (Socket);
if Item.Last /= No_Socket then
Remove_Socket_From_Set (Item.Set'Access, C.int (Socket));
Last_Socket_In_Set (Item.Set'Access, Last'Unchecked_Access);
Socket : Socket_Type) return Boolean
is
begin
+ Check_For_Fd_Set (Socket);
return Item.Last /= No_Socket
and then Socket <= Item.Last
and then Is_Socket_In_Set (Item.Set'Access, C.int (Socket)) /= 0;
procedure Set (Item : in out Socket_Set_Type; Socket : Socket_Type) is
begin
+ Check_For_Fd_Set (Socket);
if Item.Last = No_Socket then
-- Uninitialized socket set, make sure it is properly zeroed out
-- --
-- S p e c --
-- --
--- Copyright (C) 1992-2010, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2011, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- Subprograms --
-----------------
- procedure Analyze_Exception_Renaming (N : Node_Id);
- procedure Analyze_Expanded_Name (N : Node_Id);
- procedure Analyze_Generic_Function_Renaming (N : Node_Id);
- procedure Analyze_Generic_Package_Renaming (N : Node_Id);
- procedure Analyze_Generic_Procedure_Renaming (N : Node_Id);
- procedure Analyze_Object_Renaming (N : Node_Id);
- procedure Analyze_Package_Renaming (N : Node_Id);
- procedure Analyze_Subprogram_Renaming (N : Node_Id);
- procedure Analyze_Use_Package (N : Node_Id);
- procedure Analyze_Use_Type (N : Node_Id);
+ procedure Analyze_Exception_Renaming (N : Node_Id);
+ procedure Analyze_Expanded_Name (N : Node_Id);
+ procedure Analyze_Generic_Function_Renaming (N : Node_Id);
+ procedure Analyze_Generic_Package_Renaming (N : Node_Id);
+ procedure Analyze_Generic_Procedure_Renaming (N : Node_Id);
+ procedure Analyze_Object_Renaming (N : Node_Id);
+ procedure Analyze_Package_Renaming (N : Node_Id);
+ procedure Analyze_Subprogram_Renaming (N : Node_Id);
+ procedure Analyze_Use_Package (N : Node_Id);
+ procedure Analyze_Use_Type (N : Node_Id);
procedure End_Scope;
-- Called at end of scope. On exit from blocks and bodies (subprogram,
procedure End_Use_Package (N : Node_Id);
procedure End_Use_Type (N : Node_Id);
- -- Subsidiaries of End_Use_Clauses. Also called directly for use clauses
+ -- Subsidiaries of End_Use_Clauses. Also called directly for use clauses
-- appearing in context clauses.
procedure Find_Direct_Name (N : Node_Id);
-- Given a direct name (Identifier or Operator_Symbol), this routine scans
- -- the homonym chain for the name searching for corresponding visible
+ -- the homonym chain for the name, searching for corresponding visible
-- entities to find the referenced entity (or in the case of overloading,
- -- entities). On return, the Entity and Etype fields are set. In the
- -- non-overloaded case, these are the correct final entries. In the
- -- overloaded case, Is_Overloaded is set, Etype and Entity refer to an
- -- arbitrary element of the overloads set, and an appropriate list of
- -- entries has been made in the overload interpretation table (to be
- -- disambiguated in the resolve phase).
+ -- one candidate interpretation). On return, the Entity and Etype fields
+ -- are set. In the non-overloaded case, these are the correct entries.
+ -- In the overloaded case, the flag Is_Overloaded is set, Etype and Entity
+ -- refer to an arbitrary element of the overloads set, and the appropriate
+ -- entries have been added to the overloads table entry for the node. The
+ -- overloading will be disambiguated during type resolution.
+ --
+ -- Note, when this is called during semantic analysis in the overloaded
+ -- case, the entity set will be the most recently declared homonym. In
+ -- particular, the caller may follow the homonym chain checking for all
+ -- entries in the current scope, and that will give all homonyms that are
+ -- declared before the point of call in the current scope. This is useful
+ -- for example in the processing for pragma Inline.
procedure Find_Selected_Component (N : Node_Id);
-- Resolve various cases of selected components, recognize expanded names