internal/glfwwin: remove .errcheck_excludes_windows

The third returning value of Syscall is GetLastError, and the functions
like glGetIntegerv should not change the error state. Then it is safe
to ignore the errors.

Updates #2287
This commit is contained in:
Hajime Hoshi 2022-09-10 02:17:37 +09:00
parent b5acb1e53d
commit b1fff313ac
3 changed files with 9 additions and 11 deletions

View File

@ -1,2 +0,0 @@
syscall.Syscall
(*golang.org/x/sys/windows.LazyProc).Call

View File

@ -1049,11 +1049,11 @@ func _DragAcceptFiles(hWnd windows.HWND, accept bool) {
if accept { if accept {
fAccept = 1 fAccept = 1
} }
procDragAcceptFiles.Call(uintptr(hWnd), fAccept) _, _, _ = procDragAcceptFiles.Call(uintptr(hWnd), fAccept)
} }
func _DragFinish(hDrop _HDROP) { func _DragFinish(hDrop _HDROP) {
procDragFinish.Call(uintptr(hDrop)) _, _, _ = procDragFinish.Call(uintptr(hDrop))
} }
func _DragQueryFileW(hDrop _HDROP, iFile uint32, file []uint16) uint32 { func _DragQueryFileW(hDrop _HDROP, iFile uint32, file []uint16) uint32 {

View File

@ -334,7 +334,7 @@ func (w *Window) refreshContextAttribs(ctxconfig *ctxconfig) (ferr error) {
// Read back context flags (OpenGL 3.0 and above) // Read back context flags (OpenGL 3.0 and above)
if w.context.major >= 3 { if w.context.major >= 3 {
var flags int32 var flags int32
syscall.Syscall(getIntegerv, 2, GL_CONTEXT_FLAGS, uintptr(unsafe.Pointer(&flags)), 0) _, _, _ = syscall.Syscall(getIntegerv, 2, GL_CONTEXT_FLAGS, uintptr(unsafe.Pointer(&flags)), 0)
if flags&GL_CONTEXT_FLAG_FORWARD_COMPATIBLE_BIT != 0 { if flags&GL_CONTEXT_FLAG_FORWARD_COMPATIBLE_BIT != 0 {
w.context.forward = true w.context.forward = true
@ -363,7 +363,7 @@ func (w *Window) refreshContextAttribs(ctxconfig *ctxconfig) (ferr error) {
// Read back OpenGL context profile (OpenGL 3.2 and above) // Read back OpenGL context profile (OpenGL 3.2 and above)
if w.context.major >= 4 || (w.context.major == 3 && w.context.minor >= 2) { if w.context.major >= 4 || (w.context.major == 3 && w.context.minor >= 2) {
var mask int32 var mask int32
syscall.Syscall(getIntegerv, 2, GL_CONTEXT_PROFILE_MASK, uintptr(unsafe.Pointer(&mask)), 0) _, _, _ = syscall.Syscall(getIntegerv, 2, GL_CONTEXT_PROFILE_MASK, uintptr(unsafe.Pointer(&mask)), 0)
if mask&GL_CONTEXT_COMPATIBILITY_PROFILE_BIT != 0 { if mask&GL_CONTEXT_COMPATIBILITY_PROFILE_BIT != 0 {
w.context.profile = OpenGLCompatProfile w.context.profile = OpenGLCompatProfile
@ -394,7 +394,7 @@ func (w *Window) refreshContextAttribs(ctxconfig *ctxconfig) (ferr error) {
// only present from 3.0 while the extension applies from 1.1 // only present from 3.0 while the extension applies from 1.1
var strategy int32 var strategy int32
syscall.Syscall(getIntegerv, 2, GL_RESET_NOTIFICATION_STRATEGY_ARB, uintptr(unsafe.Pointer(&strategy)), 0) _, _, _ = syscall.Syscall(getIntegerv, 2, GL_RESET_NOTIFICATION_STRATEGY_ARB, uintptr(unsafe.Pointer(&strategy)), 0)
if strategy == GL_LOSE_CONTEXT_ON_RESET_ARB { if strategy == GL_LOSE_CONTEXT_ON_RESET_ARB {
w.context.robustness = LoseContextOnReset w.context.robustness = LoseContextOnReset
@ -413,7 +413,7 @@ func (w *Window) refreshContextAttribs(ctxconfig *ctxconfig) (ferr error) {
// one, so we can reuse them here // one, so we can reuse them here
var strategy int32 var strategy int32
syscall.Syscall(getIntegerv, 2, GL_RESET_NOTIFICATION_STRATEGY_ARB, uintptr(unsafe.Pointer(&strategy)), 0) _, _, _ = syscall.Syscall(getIntegerv, 2, GL_RESET_NOTIFICATION_STRATEGY_ARB, uintptr(unsafe.Pointer(&strategy)), 0)
if strategy == GL_LOSE_CONTEXT_ON_RESET_ARB { if strategy == GL_LOSE_CONTEXT_ON_RESET_ARB {
w.context.robustness = LoseContextOnReset w.context.robustness = LoseContextOnReset
@ -429,7 +429,7 @@ func (w *Window) refreshContextAttribs(ctxconfig *ctxconfig) (ferr error) {
} }
if ok { if ok {
var behavior int32 var behavior int32
syscall.Syscall(getIntegerv, 2, GL_CONTEXT_RELEASE_BEHAVIOR, uintptr(unsafe.Pointer(&behavior)), 0) _, _, _ = syscall.Syscall(getIntegerv, 2, GL_CONTEXT_RELEASE_BEHAVIOR, uintptr(unsafe.Pointer(&behavior)), 0)
if behavior == GL_NONE { if behavior == GL_NONE {
w.context.release = ReleaseBehaviorNone w.context.release = ReleaseBehaviorNone
@ -441,7 +441,7 @@ func (w *Window) refreshContextAttribs(ctxconfig *ctxconfig) (ferr error) {
// Clearing the front buffer to black to avoid garbage pixels left over from // Clearing the front buffer to black to avoid garbage pixels left over from
// previous uses of our bit of VRAM // previous uses of our bit of VRAM
glClear := w.context.getProcAddress("glClear") glClear := w.context.getProcAddress("glClear")
syscall.Syscall(glClear, 1, GL_COLOR_BUFFER_BIT, 0, 0) _, _, _ = syscall.Syscall(glClear, 1, GL_COLOR_BUFFER_BIT, 0, 0)
if w.doublebuffer { if w.doublebuffer {
if err := w.context.swapBuffers(w); err != nil { if err := w.context.swapBuffers(w); err != nil {
@ -553,7 +553,7 @@ func ExtensionSupported(extension string) (bool, error) {
glGetIntegerv := window.context.getProcAddress("glGetIntegerv") glGetIntegerv := window.context.getProcAddress("glGetIntegerv")
var count int32 var count int32
syscall.Syscall(glGetIntegerv, 2, GL_NUM_EXTENSIONS, uintptr(unsafe.Pointer(&count)), 0) _, _, _ = syscall.Syscall(glGetIntegerv, 2, GL_NUM_EXTENSIONS, uintptr(unsafe.Pointer(&count)), 0)
glGetStringi := window.context.getProcAddress("glGetStringi") glGetStringi := window.context.getProcAddress("glGetStringi")
for i := 0; i < int(count); i++ { for i := 0; i < int(count); i++ {