mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
generics: another mut arg test
This commit is contained in:
parent
073d9f3179
commit
e3917d98c2
2
thirdparty/fontstash/fontstash.h
vendored
2
thirdparty/fontstash/fontstash.h
vendored
@ -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)));
|
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;
|
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;
|
if (ftError) return 0;
|
||||||
ftError = FT_Get_Advance(font->font, glyph, FT_LOAD_NO_SCALE, &advFixed);
|
ftError = FT_Get_Advance(font->font, glyph, FT_LOAD_NO_SCALE, &advFixed);
|
||||||
if (ftError) return 0;
|
if (ftError) return 0;
|
||||||
|
@ -64,15 +64,22 @@ fn (u User) init() {
|
|||||||
fn (c City) init() {
|
fn (c City) init() {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn gen_arg<T>(mut x T) {
|
fn mut_arg<T>(mut x T) {
|
||||||
println(x.foo) // = 'foo'
|
println(x.foo) // = 'foo'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
fn mut_arg2<T>(mut x T) T {
|
||||||
|
println(x.foo) // = 'foo'
|
||||||
|
return x
|
||||||
|
}
|
||||||
|
*/
|
||||||
fn test_create() {
|
fn test_create() {
|
||||||
create<User>()
|
create<User>()
|
||||||
create<City>()
|
create<City>()
|
||||||
u := User{}
|
u := User{}
|
||||||
gen_arg<User>(mut u)
|
mut_arg<User>(mut u)
|
||||||
|
// mut_arg2<User>(mut u)
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -169,9 +169,9 @@ pub fn run<T>(port int) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//fn handle_conn<T>(conn net.Socket, app mut T) {
|
fn handle_conn<T>(conn net.Socket, app mut T) {
|
||||||
fn handle_conn<T>(conn net.Socket, app_ T) T {
|
//fn handle_conn<T>(conn net.Socket, app_ T) T {
|
||||||
mut app := app_
|
//mut app := app_
|
||||||
//first_line := strip(lines[0])
|
//first_line := strip(lines[0])
|
||||||
first_line := conn.read_line()
|
first_line := conn.read_line()
|
||||||
println('firstline="$first_line"')
|
println('firstline="$first_line"')
|
||||||
|
Loading…
Reference in New Issue
Block a user