Skip to content

Commit

Permalink
[sipify] fix initializer in strcuts
Browse files Browse the repository at this point in the history
  • Loading branch information
3nids committed Nov 28, 2018
1 parent 5f6dff0 commit 7bce934
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
3 changes: 2 additions & 1 deletion scripts/sipify.pl
Expand Up @@ -1006,7 +1006,8 @@ sub detect_non_method_member{
};

# remove struct member assignment
if ( $SIP_RUN != 1 && $ACCESS[$#ACCESS] == PUBLIC && $LINE =~ m/^(\s*\w+[\w<> *&:,]* \*?\w+) = [\-\w\:\.]+(\([^()]*\))?\s*;/ ){
# https://regex101.com/r/tWRGkY/2
if ( $SIP_RUN != 1 && $ACCESS[$#ACCESS] == PUBLIC && $LINE =~ m/^(\s*\w+[\w<> *&:,]* \*?\w+) = [\-\w\:\.]+(<\w+( \*)?>)?(\([^()]*\))?\s*;/ ){
dbg_info("remove struct member assignment");
$LINE = "$1;";
}
Expand Down
1 change: 1 addition & 0 deletions tests/code_layout/sipifyheader.expected.sip
Expand Up @@ -93,6 +93,7 @@ typedef QtClass<QVariant> QtClassQVariantBase;
QString mName;
int mCount;
QgsMapLayer *mLayer;
QList<QAction *> contextMenuActions;
};

static const int MONTHS;
Expand Down
1 change: 1 addition & 0 deletions tests/code_layout/sipifyheader.h
Expand Up @@ -134,6 +134,7 @@ class CORE_EXPORT QgsSipifyHeader : public QtClass<QVariant>, private Ui::QgsBas
QString mName;
int mCount = 100;
QgsMapLayer *mLayer = nullptr;
QList<QAction *> contextMenuActions = QList<QAction *>();
};

static const int MONTHS = 60 * 60 * 24 * 30; // something
Expand Down

0 comments on commit 7bce934

Please sign in to comment.