From cd1089025824bf2d2b2203aec7e5633d4a0bffd9 Mon Sep 17 00:00:00 2001 From: Alexander Medvednikov Date: Mon, 8 Jul 2019 03:42:36 +0200 Subject: [PATCH] minor tcc fixes --- compiler/comptime.v | 4 ++-- compiler/fn.v | 2 +- compiler/main.v | 3 +++ vlib/builtin/int.v | 3 ++- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/compiler/comptime.v b/compiler/comptime.v index 563a9071e2..2b0b9ad3d6 100644 --- a/compiler/comptime.v +++ b/compiler/comptime.v @@ -47,7 +47,7 @@ fn (p mut Parser) comp_time() { } if_returns := p.returns p.returns = false - p.gen('/* returns $p.returns */') + //p.gen('/* returns $p.returns */') if p.tok == .dollar && p.peek() == .key_else { p.next() p.next() @@ -57,7 +57,7 @@ fn (p mut Parser) comp_time() { p.genln('#endif') else_returns := p.returns p.returns = if_returns && else_returns - p.gen('/* returns $p.returns */') + //p.gen('/* returns $p.returns */') } } else if p.tok == .key_for { diff --git a/compiler/fn.v b/compiler/fn.v index 046172c2fc..bf70c27757 100644 --- a/compiler/fn.v +++ b/compiler/fn.v @@ -124,7 +124,7 @@ fn (p mut Parser) fn_decl() { p.next() } p.returns = false - p.gen('/* returns $p.returns */') + //p.gen('/* returns $p.returns */') p.next() mut f := new_fn(p.mod, is_pub) // Method receiver diff --git a/compiler/main.v b/compiler/main.v index 4e8b02e5ea..e30a5484c0 100644 --- a/compiler/main.v +++ b/compiler/main.v @@ -802,6 +802,9 @@ fn new_v(args[]string) *V { cflags: cflags ccompiler: find_c_compiler() } + if pref.is_verbose || pref.is_debug { + println('C compiler=$pref.ccompiler') + } if pref.is_play { println('Playground') } diff --git a/vlib/builtin/int.v b/vlib/builtin/int.v index 7e8b316dcc..f7e97ef8bc 100644 --- a/vlib/builtin/int.v +++ b/vlib/builtin/int.v @@ -33,7 +33,8 @@ pub fn ptr_str(ptr voidptr) string { // compare floats using C epsilon pub fn (a f64) eq(b f64) bool { - return C.fabs(a - b) <= C.DBL_EPSILON + //return C.fabs(a - b) <= C.DBL_EPSILON + return (a - b) <= C.DBL_EPSILON } // fn (nn i32) str() string {