[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    KDE/kdebindings/perl/qtcore
From:       Chris Michael Burel <chrisburel () gmail ! com>
Date:       2010-10-21 16:53:36
Message-ID: 20101021165336.8B472AC897 () svn ! kde ! org
[Download RAW message or body]

SVN commit 1188193 by burel:

Fix uniqMethods() to better respect ambiguous method order preference.
Add a check to prevent calling non-static methods without passing a value for "this".

 M  +6 -2      lib/QtCore4.pm  
 M  +3 -0      src/handlers.cpp  
 M  +9 -0      src/marshall_types.cpp  


--- trunk/KDE/kdebindings/perl/qtcore/lib/QtCore4.pm #1188192:1188193
@@ -1057,10 +1057,14 @@
 sub uniqMethods {
     my ($methodIds, $numArgs) = @_;
     my %hash;
-    foreach my $moduleId ( @{$methodIds} ) {
+    foreach my $moduleId ( reverse @{$methodIds} ) {
         my $smokeId = $moduleId->[0];
         my $methodId = $moduleId->[1];
-        my $sig = join ',', map( getTypeNameOfArg( $smokeId, $methodId, $_ ), \
0..$numArgs-1 ); +        my $sig = join ',', map{
+            my $str = getTypeNameOfArg( $smokeId, $methodId, $_ );
+            $str =~ s/^const //;
+            $str =~ s/[*&]$//;
+            $str} ( 0..$numArgs-1 );
         $hash{$sig} = $moduleId;
     }
     return values %hash;
--- trunk/KDE/kdebindings/perl/qtcore/src/handlers.cpp #1188192:1188193
@@ -513,6 +513,9 @@
             SV* sv = m->var();
             QString* mystr = 0;
 
+            if( SvROK( sv ) )
+                sv = SvRV( sv );
+
             // Don't check for SvPOK.  Calling SvPV_nolen will stringify the
             // sv, which is what we want for numbers.
             mystr = qstringFromPerlString( sv );
--- trunk/KDE/kdebindings/perl/qtcore/src/marshall_types.cpp #1188192:1188193
@@ -502,6 +502,15 @@
 
     MethodCall::MethodCall(Smoke *smoke, Smoke::Index method, smokeperl_object \
                *call_this, SV **sp, int items):
       MethodCallBase(smoke,method), _this(call_this), _sp(sp), _items(items) {
+        if ( !(this->method().flags & (Smoke::mf_static|Smoke::mf_ctor)) && \
_this->ptr == 0 ) { +            COP* callercop = caller(0);
+            croak( "%s::%s(): Non-static method called with no \"this\" value "
+                "at %s line %lu\n",
+                _smoke->className(this->method().classId),
+                _smoke->methodNames[this->method().name],
+                GvNAME(CopFILEGV(callercop))+2,
+                CopLINE(callercop) );
+        }
         _stack = new Smoke::StackItem[items + 1];
         _args = _smoke->argumentList + _smoke->methods[_method].args;
         _retval = newSV(0);


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic