Commit 9db1c5d3 authored by Maxime Perrotin's avatar Maxime Perrotin

Add files

parent c83ac287
with Text_IO; use Text_IO;
package body ASN1_Iterators.Generic_Integer is
function Next (Value : Sort) return Sort is
Result : Sort := Sort (Integer_64 (Value) + Increment);
begin
loop
exit when Is_Constraint_Valid (Result);
pragma Loop_Invariant
(Integer_64 (Result) <= Integer_64 (Sort'Last) - Increment
or else (raise Stop_Iteration));
Result := Sort (Integer_64 (Result) + Increment);
end loop;
return Result;
end Next;
end ASN1_Iterators.Generic_Integer;
with Text_IO; use Text_IO;
package body ASN1_Iterators.Generic_Unsigned_Integer is
function Next (Value : Sort) return Sort is
Result : Sort := Sort (Unsigned_64 (Value) + Increment);
begin
loop
exit when Is_Constraint_Valid (Result);
pragma Loop_Invariant
(Unsigned_64 (Result) <= Unsigned_64 (Sort'Last) - Increment
or else (raise Stop_Iteration));
Result := Sort (Unsigned_64 (Result) + Increment);
end loop;
return Result;
end Next;
end ASN1_Iterators.Generic_Unsigned_Integer;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment