From 364656b31217fb9444327bda9364c59f39168179 Mon Sep 17 00:00:00 2001 From: Alexander Medvednikov Date: Wed, 20 Apr 2022 13:03:22 +0300 Subject: [PATCH] builtin: define C.abs() --- vlib/builtin/cfns.c.v | 1 + vlib/v/parser/containers.v | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/vlib/builtin/cfns.c.v b/vlib/builtin/cfns.c.v index 9d2123df27..c20bf0198f 100644 --- a/vlib/builtin/cfns.c.v +++ b/vlib/builtin/cfns.c.v @@ -53,6 +53,7 @@ fn C.chmod(&char, u32) int fn C.printf(&char, ...voidptr) int fn C.puts(&char) int +fn C.abs(f64) f64 fn C.fputs(str &char, stream &C.FILE) int diff --git a/vlib/v/parser/containers.v b/vlib/v/parser/containers.v index aa845db940..17c61efcfd 100644 --- a/vlib/v/parser/containers.v +++ b/vlib/v/parser/containers.v @@ -69,7 +69,7 @@ fn (mut p Parser) array_init() ast.ArrayInit { // [100]u8 elem_type = p.parse_type() if p.table.sym(elem_type).name == 'byte' { - p.error('`byte` has been deprecated in favor of `u8`: use `[10]u8` instead of `[10]byte`') + p.error('`byte` has been deprecated in favor of `u8`: use `[10]u8{}` instead of `[10]byte{}`') } last_pos = p.tok.pos() is_fixed = true