cppintf: fix int type

This commit is contained in:
xushiwei
2024-06-23 16:14:42 +08:00
parent 2314c41103
commit ce81872686
2 changed files with 7 additions and 7 deletions

View File

@@ -8,10 +8,10 @@ import (
type Bar struct {
foo.Callback
a int
a c.Int
}
func NewBar(a int) *Bar {
func NewBar(a c.Int) *Bar {
return &Bar{
Callback: foo.Callback{
Vptr: &foo.CallbackVtbl{
@@ -23,7 +23,7 @@ func NewBar(a int) *Bar {
}
}
func (p *Bar) getA() int {
func (p *Bar) getA() c.Int {
return p.a
}

View File

@@ -10,10 +10,10 @@ import (
type Bar struct {
foo.Callback
a int
a c.Int
}
func NewBar(a int) *Bar {
func NewBar(a c.Int) *Bar {
return &Bar{
Callback: foo.Callback{
ICalc: foo.ICalc{
@@ -31,11 +31,11 @@ func NewBar(a int) *Bar {
}
}
func (p *Bar) getA() int {
func (p *Bar) getA() c.Int {
return p.a
}
func bar_IVal_getA(this c.Pointer) int {
func bar_IVal_getA(this c.Pointer) c.Int {
const delta = -int(unsafe.Offsetof(foo.Callback{}.IVal))
return (*Bar)(c.Advance(this, delta)).getA()
}