Skip to content

Commit 8b23655

Browse files
Deimantas Aukštkalnispravic
Deimantas Aukštkalnis
authored andcommitted
Fix for go 1.10: Removed -w flag and fixed CGO warning. Removed not needed spaces.
1 parent 9646a0a commit 8b23655

File tree

2 files changed

+28
-28
lines changed

2 files changed

+28
-28
lines changed

callbacks.c

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,65 +1,65 @@
11
#include "sciter-x.h"
22
#include "_cgo_export.h"
33

4-
// typedef BOOL SC_CALLBACK SciterElementCallback( HELEMENT he, LPVOID param );
4+
// typedef BOOL SC_CALLBACK SciterElementCallback(HELEMENT he, LPVOID param);
55

66
BOOL SC_CALLBACK SciterElementCallback_cgo(HELEMENT he, LPVOID param)
77
{
88
return goSciterElementCallback(he, param);
99
}
1010

11-
// typedef VOID SC_CALLBACK LPCBYTE_RECEIVER( LPCBYTE bytes, UINT num_bytes, LPVOID param );
12-
VOID SC_CALLBACK LPCBYTE_RECEIVER_cgo( LPCBYTE bytes, UINT num_bytes, LPVOID param )
11+
// typedef VOID SC_CALLBACK LPCBYTE_RECEIVER(LPCBYTE bytes, UINT num_bytes, LPVOID param);
12+
VOID SC_CALLBACK LPCBYTE_RECEIVER_cgo(LPCBYTE bytes, UINT num_bytes, LPVOID param)
1313
{
14-
goLPCBYTE_RECEIVER(bytes, num_bytes, param);
14+
goLPCBYTE_RECEIVER((BYTE*)bytes, num_bytes, param);
1515
}
1616

17-
// typedef VOID SC_CALLBACK LPCWSTR_RECEIVER( LPCWSTR str, UINT str_length, LPVOID param );
18-
VOID SC_CALLBACK LPCWSTR_RECEIVER_cgo( LPCWSTR str, UINT str_length, LPVOID param )
17+
// typedef VOID SC_CALLBACK LPCWSTR_RECEIVER(LPCWSTR str, UINT str_length, LPVOID param);
18+
VOID SC_CALLBACK LPCWSTR_RECEIVER_cgo(LPCWSTR str, UINT str_length, LPVOID param)
1919
{
20-
goLPCWSTR_RECEIVER(str, str_length, param);
20+
goLPCWSTR_RECEIVER((WCHAR*)str, str_length, param);
2121
}
2222

23-
// typedef VOID SC_CALLBACK LPCSTR_RECEIVER( LPCSTR str, UINT str_length, LPVOID param );
24-
VOID SC_CALLBACK LPCSTR_RECEIVER_cgo( LPCSTR str, UINT str_length, LPVOID param )
23+
// typedef VOID SC_CALLBACK LPCSTR_RECEIVER(LPCSTR str, UINT str_length, LPVOID param);
24+
VOID SC_CALLBACK LPCSTR_RECEIVER_cgo(LPCSTR str, UINT str_length, LPVOID param)
2525
{
26-
goLPCSTR_RECEIVER(str, str_length, param);
26+
goLPCSTR_RECEIVER((CHAR*)str, str_length, param);
2727
}
2828

29-
// typedef BOOL SC_CALLBACK ElementEventProc(LPVOID tag, HELEMENT he, UINT evtg, LPVOID prms );
30-
BOOL SC_CALLBACK ElementEventProc_cgo(LPVOID tag, HELEMENT he, UINT evtg, LPVOID prms )
29+
// typedef BOOL SC_CALLBACK ElementEventProc(LPVOID tag, HELEMENT he, UINT evtg, LPVOID prms);
30+
BOOL SC_CALLBACK ElementEventProc_cgo(LPVOID tag, HELEMENT he, UINT evtg, LPVOID prms)
3131
{
32-
return goElementEventProc( tag, he, evtg, prms );
32+
return goElementEventProc(tag, he, evtg, prms);
3333
}
3434

35-
// typedef UINT SC_CALLBACK SciterHostCallback( LPSCITER_CALLBACK_NOTIFICATION pns, LPVOID callbackParam );
36-
UINT SC_CALLBACK SciterHostCallback_cgo( LPSCITER_CALLBACK_NOTIFICATION pns, LPVOID callbackParam )
35+
// typedef UINT SC_CALLBACK SciterHostCallback(LPSCITER_CALLBACK_NOTIFICATION pns, LPVOID callbackParam);
36+
UINT SC_CALLBACK SciterHostCallback_cgo(LPSCITER_CALLBACK_NOTIFICATION pns, LPVOID callbackParam)
3737
{
3838
return goSciterHostCallback(pns, callbackParam);
3939
}
4040

41-
// typedef VOID NATIVE_FUNCTOR_INVOKE( VOID* tag, UINT argc, const VALUE* argv, VALUE* retval); // retval may contain error definition
42-
VOID NATIVE_FUNCTOR_INVOKE_cgo( VOID* tag, UINT argc, const VALUE* argv, VALUE* retval)
41+
// typedef VOID NATIVE_FUNCTOR_INVOKE(VOID* tag, UINT argc, const VALUE* argv, VALUE* retval); // retval may contain error definition
42+
VOID NATIVE_FUNCTOR_INVOKE_cgo(VOID* tag, UINT argc, const VALUE* argv, VALUE* retval)
4343
{
44-
goNATIVE_FUNCTOR_INVOKE(tag, argc, argv, retval);
44+
goNATIVE_FUNCTOR_INVOKE(tag, argc, (VALUE*)argv, retval);
4545
}
4646

47-
// typedef VOID NATIVE_FUNCTOR_RELEASE( VOID* tag );
48-
VOID NATIVE_FUNCTOR_RELEASE_cgo( VOID* tag )
47+
// typedef VOID NATIVE_FUNCTOR_RELEASE(VOID* tag);
48+
VOID NATIVE_FUNCTOR_RELEASE_cgo(VOID* tag)
4949
{
5050
goNATIVE_FUNCTOR_RELEASE(tag);
5151
}
5252

53-
// typedef INT SC_CALLBACK ELEMENT_COMPARATOR( HELEMENT he1, HELEMENT he2, LPVOID param );
53+
// typedef INT SC_CALLBACK ELEMENT_COMPARATOR(HELEMENT he1, HELEMENT he2, LPVOID param);
5454

55-
INT SC_CALLBACK ELEMENT_COMPARATOR_cgo( HELEMENT he1, HELEMENT he2, LPVOID param )
55+
INT SC_CALLBACK ELEMENT_COMPARATOR_cgo(HELEMENT he1, HELEMENT he2, LPVOID param)
5656
{
5757
goELEMENT_COMPARATOR(he1, he2, param);
5858
}
5959

60-
// typedef BOOL SC_CALLBACK KeyValueCallback( LPVOID param, const VALUE* pkey, const VALUE* pval );
60+
// typedef BOOL SC_CALLBACK KeyValueCallback(LPVOID param, const VALUE* pkey, const VALUE* pval);
6161

62-
BOOL SC_CALLBACK KeyValueCallback_cgo(LPVOID param, const VALUE* pkey, const VALUE* pval )
62+
BOOL SC_CALLBACK KeyValueCallback_cgo(LPVOID param, const VALUE* pkey, const VALUE* pval)
6363
{
64-
return goKeyValueCallback( param, pkey, pval );
64+
return goKeyValueCallback(param, (VALUE*)pkey, (VALUE*)pval);
6565
}

sciter.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
package sciter
66

77
/*
8-
#cgo CFLAGS: -g -w -std=c11 -Iinclude -DPLAIN_API_ONLY
8+
#cgo CFLAGS: -g -std=c11 -Iinclude -DPLAIN_API_ONLY
99
#cgo linux LDFLAGS: -ldl
1010
#cgo linux pkg-config: gtk+-3.0
1111
#include "sciter-x.h"
@@ -1623,8 +1623,8 @@ func (e *Element) IsEnabled() bool {
16231623
}
16241624

16251625
//export goELEMENT_COMPARATOR
1626-
func goELEMENT_COMPARATOR(he1 unsafe.Pointer, he2 unsafe.Pointer, arg uintptr) int {
1627-
cmp := *(*func(*Element, *Element) int)(unsafe.Pointer(arg))
1626+
func goELEMENT_COMPARATOR(he1 unsafe.Pointer, he2 unsafe.Pointer, arg unsafe.Pointer) int {
1627+
cmp := *(*func(*Element, *Element) int)(arg)
16281628
return cmp(WrapElement(C.HELEMENT(he1)), WrapElement(C.HELEMENT(he2)))
16291629
}
16301630

0 commit comments

Comments
 (0)