From 5a7f683f61cae493b7eba99c775638c8ea6a73e7 Mon Sep 17 00:00:00 2001 From: Alexander Medvednikov Date: Fri, 20 Mar 2020 17:20:53 +0100 Subject: [PATCH] cgen: minor fixes --- cmd/v/internal/flag/flag_workaround.v | 5 +++-- cmd/v/v.v | 2 +- vlib/compiler/fn.v | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/cmd/v/internal/flag/flag_workaround.v b/cmd/v/internal/flag/flag_workaround.v index 4609ef5579..709e2dc7e3 100644 --- a/cmd/v/internal/flag/flag_workaround.v +++ b/cmd/v/internal/flag/flag_workaround.v @@ -16,7 +16,8 @@ pub fn parse_pref(args []string, callback fn(string, &Instance, &pref.Preference args: args current_pos: 0 } - tmp := p.parse_impl(args, voidptr(obj), void_cb(callback)) or { + //tmp := p.parse_impl(args, voidptr(obj), void_cb(callback)) or { + tmp := p.parse_impl(args, obj, void_cb(callback)) or { return error(err) } return tmp @@ -40,7 +41,7 @@ pub fn parse_main_cmd(args []string, callback fn(string, &Instance, &MainCmdPref args: args current_pos: 0 } - tmp := p.parse_impl(args, voidptr(obj), void_cb(callback)) or { + tmp := p.parse_impl(args, obj, void_cb(callback)) or { return error(err) } return tmp diff --git a/cmd/v/v.v b/cmd/v/v.v index a816a936a2..928139542b 100644 --- a/cmd/v/v.v +++ b/cmd/v/v.v @@ -26,7 +26,7 @@ const ( fn main() { prefs := flag.MainCmdPreferences{} - values := flag.parse_main_cmd(os.args, parse_flags, &prefs) or { + values := flag.parse_main_cmd(os.args, parse_flags, prefs) or { println('V Error: An error has occurred while parsing flags: ') println(err) exit(1) diff --git a/vlib/compiler/fn.v b/vlib/compiler/fn.v index ef01784f81..24a5d9ed23 100644 --- a/vlib/compiler/fn.v +++ b/vlib/compiler/fn.v @@ -346,7 +346,7 @@ fn (p mut Parser) fn_decl() { if p.tok == .lt { // instance (dispatch) if p.generic_dispatch.inst.size > 0 { - rename_generic_fn_instance(mut f, &p.generic_dispatch) + rename_generic_fn_instance(mut f, p.generic_dispatch) } else { f.is_generic = true