Skip to content
Permalink
Browse files
Fix sipify handling of long long return types
  • Loading branch information
nyalldawson committed Jun 21, 2021
1 parent e59f343 commit 2328f4fad809b9ac0a8c371bf6d5446da1abd851
@@ -109,7 +109,7 @@ the hierarchy of a dataset which organises layers in schemas or in an internal f
.. seealso:: :py:func:`path`
%End

long long featureCount() const { return mFeatureCount; }
long long featureCount() const;
%Docstring
Returns the layer's feature count, or Qgis.FeatureCountState.UnknownCount/Qgis.FeatureCountState.Uncounted if no feature count is applicable or available.

@@ -56,6 +56,7 @@ Feature to render
struct RenderLevel
{
explicit RenderLevel( int z );

~RenderLevel();
int zIndex;

@@ -405,7 +405,7 @@ sub detect_and_remove_following_body_or_initializerlist {
# https://regex101.com/r/ZaP3tC/8
my $python_signature = '';
do {no warnings 'uninitialized';
if ( $LINE =~ m/^(\s*)?((?:(?:explicit|static|const|unsigned|virtual)\s+)*)(([\w:]+(<.*?>)?\s+[*&]?)?(~?\w+|(\w+::)?operator.{1,2})\s*\(([\w=()\/ ,&*<>."-]|::)*\)( +(?:const|SIP_[\w_]+?))*)\s*((\s*[:,]\s+\w+\(.*\))*\s*\{.*\}\s*(?:SIP_[\w_]+)?;?|(?!;))(\s*\/\/.*)?$/
if ( $LINE =~ m/^(\s*)?((?:(?:explicit|static|const|unsigned|virtual)\s+)*)(([(?:long )\w:]+(<.*?>)?\s+[*&]?)?(~?\w+|(\w+::)?operator.{1,2})\s*\(([\w=()\/ ,&*<>."-]|::)*\)( +(?:const|SIP_[\w_]+?))*)\s*((\s*[:,]\s+\w+\(.*\))*\s*\{.*\}\s*(?:SIP_[\w_]+)?;?|(?!;))(\s*\/\/.*)?$/
|| $LINE =~ m/SIP_SKIP\s*(?!;)\s*(\/\/.*)?$/
|| $LINE =~ m/^\s*class.*SIP_SKIP/ ){
dbg_info("remove constructor definition, function bodies, member initializing list");
@@ -1251,12 +1251,12 @@ sub detect_non_method_member{
$PYTHON_SIGNATURE = detect_and_remove_following_body_or_initializerlist();

# remove inline declarations
if ( $LINE =~ m/^(\s*)?(static |const )*(([\w:]+(<.*?>)?\s+(\*|&)?)?(\w+)( (?:const*?))*)\s*(\{.*\});(\s*\/\/.*)?$/ ){
if ( $LINE =~ m/^(\s*)?(static |const )*(([(?:long )\w:]+(<.*?>)?\s+(\*|&)?)?(\w+)( (?:const*?))*)\s*(\{.*\});(\s*\/\/.*)?$/ ){
my $newline = "$1$3;";
$LINE = $newline;
}

if ( $LINE =~ m/^\s*(?:const |virtual |static |inline )*(?!explicit)([\w:]+(?:<.*?>)?)\s+(?:\*|&)?(?:\w+|operator.{1,2})\(.*$/ ){
if ( $LINE =~ m/^\s*(?:const |virtual |static |inline )*(?!explicit)([(?:long )\w:]+(?:<.*?>)?)\s+(?:\*|&)?(?:\w+|operator.{1,2})\(.*$/ ){
if ($1 !~ m/(void|SIP_PYOBJECT|operator|return|QFlag)/ ){
$RETURN_TYPE = $1;
# replace :: with . (changes c++ style namespace/class directives to Python style)
@@ -90,7 +90,10 @@ class CORE_EXPORT QgsRuleBasedRenderer : public QgsFeatureRenderer
*/
struct RenderLevel
{
explicit RenderLevel( int z ): zIndex( z ) {}
explicit RenderLevel( int z )
: zIndex( z )
{}

~RenderLevel() { qDeleteAll( jobs ); }
int zIndex;

@@ -38,7 +38,9 @@ class CORE_EXPORT QgsVectorTileRendererData
{
public:
//! Constructs the object
explicit QgsVectorTileRendererData( QgsTileXYZ id ): mId( id ) {}
explicit QgsVectorTileRendererData( QgsTileXYZ id )
: mId( id )
{}

//! Returns coordinates of the tile
QgsTileXYZ id() const { return mId; }

0 comments on commit 2328f4f

Please sign in to comment.