Attached patch fixes 2 issues: CParse::Enumerator::get_member doesn't pass $namespace down on the call stack and this is the reason of the bug. CType::Ref proxies only some of the methods of underlying type, four new are added. This allows to canonify at least freetype headers. Maybe more proxying methods are needed.
diff -Nru icheck.old/CParse/Enumerator.pm icheck/CParse/Enumerator.pm --- icheck.old/CParse/Enumerator.pm 2006-04-03 06:04:54.000000000 +0800 +++ icheck/CParse/Enumerator.pm 2006-05-24 13:58:56.000000000 +0800 @@ -41,7 +41,7 @@ my $self = shift; my $namespace = shift; - return {name => $self->{name}, value => $self->{value} ? $self->{value}->get_expr : undef}; + return {name => $self->{name}, value => $self->{value} ? $self->{value}->get_expr($namespace) : undef}; } 1; diff -Nru icheck.old/CType/Ref.pm icheck/CType/Ref.pm --- icheck.old/CType/Ref.pm 2006-04-03 06:04:55.000000000 +0800 +++ icheck/CType/Ref.pm 2006-05-24 13:58:55.000000000 +0800 @@ -192,4 +192,29 @@ return $self->type->signed; } +sub nature + { + my $self = shift; + return $self->type->nature; + } + +sub max_value + { + my $self = shift; + return $self->type->max_value; + } + +sub min_value + { + my $self = shift; + return $self->type->min_value; + } + +sub can_represent + { + my $self = shift; + my $value = shift; + return $self->type->can_represent($value); + } + 1;