diff --git a/app/pdb/color-cmds.c b/app/pdb/color-cmds.c index b3e8ce088e..bfa24a4822 100644 --- a/app/pdb/color-cmds.c +++ b/app/pdb/color-cmds.c @@ -1116,13 +1116,13 @@ register_color_procs (GimpPDB *pdb) gimp_param_spec_int32 ("start-range", "start range", "Start of the intensity measurement range", - 0, 256, 0, + 0, 255, 0, GIMP_PARAM_READWRITE)); gimp_procedure_add_argument (procedure, gimp_param_spec_int32 ("end-range", "end range", "End of the intensity measurement range", - 0, 256, 0, + 0, 255, 0, GIMP_PARAM_READWRITE)); gimp_procedure_add_return_value (procedure, g_param_spec_double ("mean", diff --git a/tools/pdbgen/app.pl b/tools/pdbgen/app.pl index f867449c94..2a143f1641 100644 --- a/tools/pdbgen/app.pl +++ b/tools/pdbgen/app.pl @@ -324,8 +324,18 @@ g_param_spec_double ("$name", CODE } elsif ($pdbtype eq 'int32') { - $min = defined $typeinfo[0] ? $typeinfo[0] : G_MININT32; - $max = defined $typeinfo[2] ? $typeinfo[2] : G_MAXINT32; + if (defined $typeinfo[0]) { + $min = ($typeinfo[1] eq '<') ? ($typeinfo[0] + 1) : $typeinfo[0]; + } + else { + $min = G_MININT32; + } + if (defined $typeinfo[2]) { + $max = ($typeinfo[3] eq '<') ? ($typeinfo[2] - 1) : $typeinfo[2]; + } + else { + $max = G_MAXINT32; + } $default = exists $arg->{default} ? $arg->{default} : defined $typeinfo[0] ? $typeinfo[0] : 0; $pspec = <{default} ? $arg->{default} : defined $typeinfo[0] ? $typeinfo[0] : 0; $pspec = <{default} ? $arg->{default} : defined $typeinfo[0] ? $typeinfo[0] : 0; $pspec = < '<=', - '>' => '>=', - '<=' => '<', - '>=' => '>' - ); - - my %postmap = ( - '<' => '>=', - '>' => '<=', - '<=' => '>', - '>=' => '<' - ); - my $arg = shift; if ($arg =~ /^enum (\w+)(.*)/) { @@ -264,7 +250,7 @@ sub arg_parse { \s* (\w+) \s* (?:(<=|<) \s* ([+-.\dA-Z_][^\s]*))? /x) { - return ($3, $1, $2 ? $premap{$2} : $2, $5, $4 ? $postmap{$4} : $4); + return ($3, $1, $2, $5, $4); } } diff --git a/tools/pdbgen/pdbgen.pl b/tools/pdbgen/pdbgen.pl index 57444a0bab..57cd1e7df1 100755 --- a/tools/pdbgen/pdbgen.pl +++ b/tools/pdbgen/pdbgen.pl @@ -164,10 +164,10 @@ sub arrayexpand { # We can't have negative lengths, but let them set a min number unless (exists $arg->{type}) { - $arg->{type} = '0 < int32'; + $arg->{type} = '0 <= int32'; } elsif ($arg->{type} !~ /^\s*\d+\s*{type} = '0 < ' . $arg->{type}; + $arg->{type} = '0 <= ' . $arg->{type}; } $arg->{void_ret} = 1 if exists $_->{void_ret};