1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

checker: allow EnumName(number) casts only inside unsafe{} blocks (#15932)

This commit is contained in:
Swastik Baranwal
2022-10-03 01:09:11 +05:30
committed by GitHub
parent 7993f0bf39
commit b584e1df98
32 changed files with 129 additions and 97 deletions

View File

@@ -2,7 +2,7 @@ module gfx
pub fn create_clear_pass(r f32, g f32, b f32, a f32) PassAction {
mut color_action := ColorAttachmentAction{
action: Action(C.SG_ACTION_CLEAR)
action: unsafe { Action(C.SG_ACTION_CLEAR) }
value: Color{
r: r
g: g

View File

@@ -20,12 +20,12 @@ pub fn shutdown() {
[inline]
pub fn error() SglError {
return SglError(int(C.sgl_error()))
return unsafe { SglError(int(C.sgl_error())) }
}
[inline]
pub fn context_error(ctx Context) SglError {
return SglError(int(C.sgl_context_error(ctx)))
return unsafe { SglError(int(C.sgl_context_error(ctx))) }
}
[inline]