From e3917d98c2c19968d129614b49d3ef8822719870 Mon Sep 17 00:00:00 2001 From: Alexander Medvednikov Date: Fri, 5 Jun 2020 20:57:02 +0200 Subject: [PATCH] generics: another mut arg test --- thirdparty/fontstash/fontstash.h | 2 +- vlib/v/tests/generics_test.v | 11 +++++++++-- vlib/vweb/vweb.v | 6 +++--- 3 files changed, 13 insertions(+), 6 deletions(-) diff --git a/thirdparty/fontstash/fontstash.h b/thirdparty/fontstash/fontstash.h index aa34ad55b9..a8d689e99a 100644 --- a/thirdparty/fontstash/fontstash.h +++ b/thirdparty/fontstash/fontstash.h @@ -217,7 +217,7 @@ static int fons__tt_buildGlyphBitmap(FONSttFontImpl *font, int glyph, float size ftError = FT_Set_Pixel_Sizes(font->font, 0, (FT_UInt)(size * (float)font->font->units_per_EM / (float)(font->font->ascender - font->font->descender))); if (ftError) return 0; - ftError = FT_Load_Glyph(font->font, glyph, FT_LOAD_RENDER); + ftError = FT_Load_Glyph(font->font, glyph, FT_LOAD_RENDER | FT_LOAD_FORCE_AUTOHINT); if (ftError) return 0; ftError = FT_Get_Advance(font->font, glyph, FT_LOAD_NO_SCALE, &advFixed); if (ftError) return 0; diff --git a/vlib/v/tests/generics_test.v b/vlib/v/tests/generics_test.v index 982ba32a51..c381e6a1b7 100644 --- a/vlib/v/tests/generics_test.v +++ b/vlib/v/tests/generics_test.v @@ -64,15 +64,22 @@ fn (u User) init() { fn (c City) init() { } -fn gen_arg(mut x T) { +fn mut_arg(mut x T) { println(x.foo) // = 'foo' } +/* +fn mut_arg2(mut x T) T { + println(x.foo) // = 'foo' + return x +} +*/ fn test_create() { create() create() u := User{} - gen_arg(mut u) + mut_arg(mut u) + // mut_arg2(mut u) } /* diff --git a/vlib/vweb/vweb.v b/vlib/vweb/vweb.v index 763877777b..7855f9993d 100644 --- a/vlib/vweb/vweb.v +++ b/vlib/vweb/vweb.v @@ -169,9 +169,9 @@ pub fn run(port int) { } } -//fn handle_conn(conn net.Socket, app mut T) { -fn handle_conn(conn net.Socket, app_ T) T { - mut app := app_ +fn handle_conn(conn net.Socket, app mut T) { +//fn handle_conn(conn net.Socket, app_ T) T { + //mut app := app_ //first_line := strip(lines[0]) first_line := conn.read_line() println('firstline="$first_line"')