Skip to content

Commit

Permalink
genbindings/go: add extra type cast for QIntegerForSizeof<void *>::Si…
Browse files Browse the repository at this point in the history
…gned
  • Loading branch information
mappu committed Sep 18, 2024
1 parent f6d1ef8 commit 3f1c8cb
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
1 change: 1 addition & 0 deletions cmd/genbindings/intermediate.go
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,7 @@ func (p CppParameter) IntType() bool {
"qintptr", "quintptr", "uintptr_t", "intptr_t",
"qsizetype", "size_t",
"QIntegerForSizeof<void *>::Unsigned",
"QIntegerForSizeof<void *>::Signed",
"qptrdiff", "ptrdiff_t",
"double", "float", "qreal":
return true
Expand Down
4 changes: 2 additions & 2 deletions qt/gen_qsocketnotifier.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@
#include "_cgo_export.h"

QSocketNotifier* QSocketNotifier_new(intptr_t socket, int param2) {
return new QSocketNotifier(socket, static_cast<QSocketNotifier::Type>(param2));
return new QSocketNotifier(static_cast<qintptr>(socket), static_cast<QSocketNotifier::Type>(param2));
}

QSocketNotifier* QSocketNotifier_new2(intptr_t socket, int param2, QObject* parent) {
return new QSocketNotifier(socket, static_cast<QSocketNotifier::Type>(param2), parent);
return new QSocketNotifier(static_cast<qintptr>(socket), static_cast<QSocketNotifier::Type>(param2), parent);
}

QMetaObject* QSocketNotifier_MetaObject(const QSocketNotifier* self) {
Expand Down
4 changes: 2 additions & 2 deletions qt/gen_qsocketnotifier.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,13 @@ func newQSocketNotifier_U(h unsafe.Pointer) *QSocketNotifier {

// NewQSocketNotifier constructs a new QSocketNotifier object.
func NewQSocketNotifier(socket uintptr, param2 QSocketNotifier__Type) *QSocketNotifier {
ret := C.QSocketNotifier_new(socket, (C.int)(param2))
ret := C.QSocketNotifier_new((C.intptr_t)(socket), (C.int)(param2))
return newQSocketNotifier(ret)
}

// NewQSocketNotifier2 constructs a new QSocketNotifier object.
func NewQSocketNotifier2(socket uintptr, param2 QSocketNotifier__Type, parent *QObject) *QSocketNotifier {
ret := C.QSocketNotifier_new2(socket, (C.int)(param2), parent.cPointer())
ret := C.QSocketNotifier_new2((C.intptr_t)(socket), (C.int)(param2), parent.cPointer())
return newQSocketNotifier(ret)
}

Expand Down

0 comments on commit 3f1c8cb

Please sign in to comment.