mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-14 19:09:16 +02:00
+ get_unsigned_inttype(def) to get an unsigned integer type of the same
size as the provided def (must be an orddef or enumdef) git-svn-id: trunk@34033 -
This commit is contained in:
parent
8e2607d96d
commit
33b44443b8
@ -103,6 +103,10 @@ interface
|
|||||||
}
|
}
|
||||||
function is_signed(def : tdef) : boolean;
|
function is_signed(def : tdef) : boolean;
|
||||||
|
|
||||||
|
{# Returns an unsigned integer type of the same size as def; def must be
|
||||||
|
an ordinal or enum }
|
||||||
|
function get_unsigned_inttype(def: tdef): torddef;
|
||||||
|
|
||||||
{# Returns whether def_from's range is comprised in def_to's if both are
|
{# Returns whether def_from's range is comprised in def_to's if both are
|
||||||
orddefs, false otherwise }
|
orddefs, false otherwise }
|
||||||
function is_in_limit(def_from,def_to : tdef) : boolean;
|
function is_in_limit(def_from,def_to : tdef) : boolean;
|
||||||
@ -608,6 +612,18 @@ implementation
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
function get_unsigned_inttype(def: tdef): torddef;
|
||||||
|
begin
|
||||||
|
case def.typ of
|
||||||
|
orddef,
|
||||||
|
enumdef:
|
||||||
|
result:=cgsize_orddef(tcgsize2unsigned[def_cgsize(def)]);
|
||||||
|
else
|
||||||
|
internalerror(2016062001);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
function is_in_limit(def_from,def_to : tdef) : boolean;
|
function is_in_limit(def_from,def_to : tdef) : boolean;
|
||||||
|
|
||||||
begin
|
begin
|
||||||
|
Loading…
Reference in New Issue
Block a user