summaryrefslogtreecommitdiff
path: root/pidl/lib/Parse/Pidl/Typelist.pm
diff options
context:
space:
mode:
authorTim Prouty <tprouty@samba.org>2009-01-17 14:40:12 -0800
committerTim Prouty <tprouty@samba.org>2009-01-17 19:37:52 -0800
commit142b2a61f8a77b3065ce4c78b459ab714d6d190a (patch)
tree6215d9521f1d4fb97a0b88b2e3561811a8420d50 /pidl/lib/Parse/Pidl/Typelist.pm
parent6d300399b52e0921ce205ef2f053b722b21edeeb (diff)
downloadsamba-142b2a61f8a77b3065ce4c78b459ab714d6d190a.tar.gz
samba-142b2a61f8a77b3065ce4c78b459ab714d6d190a.tar.bz2
samba-142b2a61f8a77b3065ce4c78b459ab714d6d190a.zip
pidl: Remove "max" and make "range" smarter about unsigned types
This eliminates a warning in pidl generated code, while preserving cross-platform idl compatibility.
Diffstat (limited to 'pidl/lib/Parse/Pidl/Typelist.pm')
-rw-r--r--pidl/lib/Parse/Pidl/Typelist.pm15
1 files changed, 14 insertions, 1 deletions
diff --git a/pidl/lib/Parse/Pidl/Typelist.pm b/pidl/lib/Parse/Pidl/Typelist.pm
index 0e3fd8de44..4f9d982c21 100644
--- a/pidl/lib/Parse/Pidl/Typelist.pm
+++ b/pidl/lib/Parse/Pidl/Typelist.pm
@@ -8,7 +8,7 @@ package Parse::Pidl::Typelist;
require Exporter;
@ISA = qw(Exporter);
@EXPORT_OK = qw(hasType getType resolveType mapTypeName scalar_is_reference expandAlias
- mapScalarType addType typeIs is_scalar enum_type_fn
+ mapScalarType addType typeIs is_signed is_scalar enum_type_fn
bitmap_type_fn mapType typeHasBody
);
use vars qw($VERSION);
@@ -145,6 +145,19 @@ sub hasType($)
return 0;
}
+sub is_signed($)
+{
+ my $t = shift;
+
+ return ($t eq "int8"
+ or $t eq "int16"
+ or $t eq "int32"
+ or $t eq "dlong"
+ or $t eq "int"
+ or $t eq "long"
+ or $t eq "short");
+}
+
sub is_scalar($)
{
sub is_scalar($);