[glibmm/gmmproc-refactor] Warn about refreturn and transfers only when return type is a ref ptr.
- From: Krzesimir Nowak <krnowak src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glibmm/gmmproc-refactor] Warn about refreturn and transfers only when return type is a ref ptr.
- Date: Sun, 24 Jun 2012 19:52:12 +0000 (UTC)
commit 476aba125154c2448ee791f005efc86792694916
Author: Krzesimir Nowak <qdlacz gmail com>
Date: Sat Jun 23 21:40:39 2012 +0200
Warn about refreturn and transfers only when return type is a ref ptr.
tools/pm/Common/WrapParser.pm | 12 +++++++-----
1 files changed, 7 insertions(+), 5 deletions(-)
---
diff --git a/tools/pm/Common/WrapParser.pm b/tools/pm/Common/WrapParser.pm
index 4e80a6b..e942c67 100644
--- a/tools/pm/Common/WrapParser.pm
+++ b/tools/pm/Common/WrapParser.pm
@@ -678,9 +678,11 @@ sub _on_ignore_signal ($)
}
# TODO: move it elsewhere, remove it later.
-sub _maybe_warn_about_refreturn ($$$)
+sub _maybe_warn_about_refreturn ($$$$)
{
- my ($self, $ret_transfer, $refreturn) = @_;
+ my ($self, $ret_transfer, $refreturn, $cxx_type) = @_;
+
+ return if ($cxx_type !~ /^(const\s+)?(?:Glib::)?RefPtr/);
if ($ret_transfer == Common::TypeInfo::Common::TRANSFER_FULL and $refreturn)
{
@@ -793,7 +795,7 @@ sub _on_wrap_method ($)
# TODO: remove the ifs below after possible bugs in
# TODO continued: wrappers/annotations are fixed.
- $self->_maybe_warn_about_refreturn ($ret_transfer, $refreturn);
+ $self->_maybe_warn_about_refreturn ($ret_transfer, $refreturn, $cxx_function->get_return_type ());
$self->_maybe_warn_about_errthrow ($throws, $errthrow);
Common::Output::Method::output ($self,
@@ -947,7 +949,7 @@ sub _on_wrap_signal ($)
# TODO: remove the ifs below after possible bugs in
# TODO continued: wrappers/annotations are fixed.
- $self->_maybe_warn_about_refreturn ($ret_transfer, $refreturn);
+ $self->_maybe_warn_about_refreturn ($ret_transfer, $refreturn, $cxx_function->get_return_type ());
# TODO: Add custom_signal_handler.
Common::Output::Signal::output $self,
@@ -1094,7 +1096,7 @@ sub _on_wrap_vfunc ($)
# TODO: remove the ifs below after possible bugs in
# TODO continued: wrappers/annotations are fixed.
- $self->_maybe_warn_about_refreturn ($ret_transfer, $refreturn);
+ $self->_maybe_warn_about_refreturn ($ret_transfer, $refreturn, $cxx_function->get_return_type ());
$self->_maybe_warn_about_errthrow ($throws, $errthrow);
Common::Output::VFunc::output $self,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]