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:
@ -768,7 +768,7 @@ fn (mut app App) next_theme() {
|
||||
|
||||
[inline]
|
||||
fn (mut app App) next_tile_format() {
|
||||
app.tile_format = TileFormat(int(app.tile_format) + 1)
|
||||
app.tile_format = unsafe { TileFormat(int(app.tile_format) + 1) }
|
||||
if app.tile_format == .end_ {
|
||||
app.tile_format = .normal
|
||||
}
|
||||
|
@ -134,10 +134,10 @@ fn on_event(e &gg.Event, mut app App) {
|
||||
app.gg.quit()
|
||||
}
|
||||
.up {
|
||||
app.sel = Selection(math.max(0, int(app.sel) - 1))
|
||||
app.sel = unsafe { Selection(math.max(0, int(app.sel) - 1)) }
|
||||
}
|
||||
.down {
|
||||
app.sel = Selection(math.min(int(Selection.len) - 1, int(app.sel) + 1))
|
||||
app.sel = unsafe { Selection(math.min(int(Selection.len) - 1, int(app.sel) + 1)) }
|
||||
}
|
||||
.left {
|
||||
match app.sel {
|
||||
|
@ -458,7 +458,7 @@ fn frame(mut app App) {
|
||||
|
||||
// clear
|
||||
mut color_action := gfx.ColorAttachmentAction{
|
||||
action: gfx.Action(C.SG_ACTION_DONTCARE) // C.SG_ACTION_CLEAR)
|
||||
action: unsafe { gfx.Action(C.SG_ACTION_DONTCARE) } // C.SG_ACTION_CLEAR)
|
||||
value: gfx.Color{
|
||||
r: 1.0
|
||||
g: 1.0
|
||||
|
Reference in New Issue
Block a user