16310 Commits

Author SHA1 Message Date
Delyan Angelov
d20ed23365 thirdparty/sokol/sokol_gfx.h: fix whitespaces around the new glReadPixels XMACRO 2023-10-06 16:09:32 +03:00
Delyan Angelov
5e0c225472
thirdparty/sokol/sokol_gfx.h: ensure that glReadBuffer will be binded too, even on windows 2023-10-06 15:51:44 +03:00
Delyan Angelov
5d38c61aa1
fix cross compilation to windows 2023-10-06 15:34:43 +03:00
Delyan Angelov
729ed06a03
ci: fix error for private_redeclaration_of_C_struct.out 2023-10-06 15:04:32 +03:00
Delyan Angelov
8e7cd6f3ac
sokol.gfx: update the V bindings for the new functionality in the Sokol GFX library 2023-10-06 09:27:23 +03:00
Delyan Angelov
cee2eabd1f
sokol: fix the audio examples 2023-10-06 07:26:10 +03:00
Alexander Medvednikov
322ba7113f sokol: fix gfx structs 2023-10-06 02:31:11 +03:00
Alexander Medvednikov
0bf85d049e sokol: upgrade to latest version, fix all related issues 2023-10-05 20:22:49 +03:00
Tim Marston
756075380b
orm: add null handling and option fields (#19379)
* orm: added is none and !is none handling

* orm: added NullType, support option fields and deprecate [nonull]

Nullable DB fields are now determined by corresponding option struct field.  The
[nonull] attribute is deprecated and fields are all NOT NULL now, unless they
are option fields. New orm primitive, NullType, added to support passing none
values to db backends, which have been updated to support it.  Also, empty
string and 0 numberic values are no longer skipped during insert (since they may
be valid values).

* orm: fix [nonull] deprecation warning

* orm: add null handling to update and select

also, improved formatting for orm cgen, and removed optimised operand handling
of orm `is` and `!is` operators

* sqlite: read/report NULLs using new orm NullType

* postgres: returning data primitives now returns new orm.NullType

* orm: initialise NullType Primitives properly

* orm: do not smart cast operands inside sql

* orm: fix bad setting of option value

* orm: improve orm_null_test.v, adding/fixing selects

* orm: cleanup: rename NullType->Null, use serial const, cgen output

* orm: handle automatically generated fields more explicitly

During insert, fields which are
* [sql: serial]
* [default: whatever]
and where the data is a default value (e.g., 0, ""), those fields are not sent
to the db, so that the db can generate auto-increment or default values.  (This
was previously done only for [primary] fields, and not in all circumstances, but
that is not correct -- primary and serial/auto-increment fields are differnet.)

* orm: udpated README

* orm: select cgen fixes: read from uninit res; fail to init res

* orm: udpated tests

* orm: fix option sub-struct fields

* orm: fixed joins to option structs

Changed orm.write_orm_select() so that you pass to it the name of a resut
variable which it populates with the result (or not) and changed use of it in
sql_select_expr() and calls in write_orm_select() to populate substructs.

* orm: fix pg driver handling of NULL results

* orm: move runtime checks to comptime checker; cache checked tables

* orm: vfmt :(

* orm: markdown formatting

* orm: renamed orm.time_ and orm.enum_; updated db drivers

* checker: updated orm tests

* orm: fix issue setting up ast option values as orm primitives

* checker: ORM use of none/options and operations (added tests)

* orm: fixed tests

* db: clean code

* examples: remove orm nonull attributes

* orm: skip test memory santisation for orm_null_test.v

* orm: make the type-to-primitive converstion fns not public

* orm: mv object var c-code from checker->cgen; fix memory corruption

Code in checker/orm.v used the SqlStmtLine object field name to store c-specific
referenecs to option and array fields (for arrays of children).  I moved this
logic to cgen.  And fixed an issue introduced with option fields, where an array
of children was unpacked into a non-array result which could corrupt memory.

* orm: fixed vast error

* orm: skip 2 tests on ubuntu-musl which require sqlite3.h

* cgen: prevent casting a struct (string)

* v fmt orm_fkey_attribute.vv, orm_multidim_array.vv, orm_table_attributes.vv; run `VAUTOFIX=1 ./v vlib/v/compiler_errors_test.v`
2023-10-05 19:09:03 +03:00
Spydr
32bb8cf86d
all: implement @VCURRENTHASH to replace C.V_CURRENT_COMMIT_HASH (#19514) 2023-10-05 18:14:36 +03:00
Delyan Angelov
1512486d01
checker: extract vlib/v/checker/errors.v, use maps for c.error_lines, c.warning_lines, c.notice_lines, dedup all errors, warns, and notices
To better support projects with lots of errors/notices, deduplicate notices, warnings and messages,
for the same line (`generic method routes of vweb will be skipped` etc).
2023-10-05 17:59:43 +03:00
emacser
13c9006667
vweb: fix typo in vweb.v (#19513) 2023-10-05 14:22:17 +03:00
Delyan Angelov
e87d743b0a
ci: fix gitly compilation (add libgit2-dev) 2023-10-05 12:41:11 +03:00
Delyan Angelov
63b6407b6a
ci: fix v_apps_and_modules_compile_ci.yml (YAML should be abandoned, the sooner the better) 2023-10-05 12:34:08 +03:00
Delyan Angelov
b10342eeaa
ci: skip more checks on manual new tag/release pushes (already done in the previous ci runs for the same commit) 2023-10-05 12:00:59 +03:00
Delyan Angelov
beaa33a9bc
v.builder: cleanup, support V_NO_C_ERROR_INFO=1 for more compact error messages on cgen errors. weekly.2023.40.1 weekly.2023.40 2023-10-05 09:40:17 +03:00
Sudoer
5c37c312b0
builtin,math: add more missing doc strings for public functions (#19509) 2023-10-05 00:35:37 +03:00
Spydr
8cfe9e81fc
native, builtin: implement little improvements from #19498 and remove vcommithash() in favor of @VHASH (#19508) 2023-10-05 00:30:55 +03:00
Redstoyn33
4b03d08457
math.fractions: make the Fraction struct public (#19507) 2023-10-04 18:16:08 +03:00
yuyi
a1e3040461
cgen: fix casting to interface with struct field default expr (#19506) 2023-10-04 16:42:47 +03:00
Spydr
6d1558b006
native, builtin, ast: handle ast.HashStmt correctly and reduce macro usage in builtin (#19498) 2023-10-04 16:42:15 +03:00
Sudoer
db0808c6c9
math: fix documentation for math.radians, math.degrees and math.aprox_cos (#19504) 2023-10-04 12:19:00 +03:00
yuyi
2bcbda55ff
parser, fmt: fix formatting assign static method to anon fn (#19505) 2023-10-04 12:15:06 +03:00
Swastik Baranwal
dd7f3a73f3
checker: disallow printing variadic expansions of arrays: print(...a), println(...a), where a is an array (fix #19490) (#19503) 2023-10-04 09:28:20 +03:00
Delyan Angelov
c79f84d406
builtin: add input_character/0 and print_character/1 (#19502) 2023-10-04 04:40:03 +03:00
yuyi
0904a9e892
parser: fix assigning static method to anon fn (#19499) 2023-10-03 21:12:30 +03:00
Spydr
2563552cd6
ast, native, cgen: add support for $if native {} (#19500) 2023-10-03 21:09:56 +03:00
Alexander Medvednikov
b1f141aef3 checker: more precise error message 2023-10-03 20:32:52 +03:00
Delyan Angelov
6b79b2aaa5
encoding.leb128: fix v -cstrict -cc gcc-11 examples/wasm_codegen/bf_compiler.v 2023-10-03 17:05:55 +03:00
Delyan Angelov
7a49f24eb1
examples: fix brainvuck.v (handle [ and ] properly); allow both brainvuck.v wasm_codegen/bf_compiler.v to work with .b files too 2023-10-03 17:01:55 +03:00
Delyan Angelov
fae46a8d85
builtin: extract vlib/builtin/result.v from vlib/builtin/option.v 2023-10-03 08:36:13 +03:00
yuyi
78910535ac
parser: minor optimization in name_expr() (#19493) 2023-10-03 00:11:44 +03:00
Ikko Eltociear Ashimine
5645ee2875
v.util: fix typo in module.v (#19494) 2023-10-03 00:10:28 +03:00
Delyan Angelov
c0a7397637
native: support -no-builtin (generate executables < 1KB Linux with v -no-builtin -b native examples/hello_world.v) 2023-10-02 19:44:02 +03:00
Delyan Angelov
f43be7a171
docs: add dots for consistency, to all the items in the @FILE etc list 2023-10-02 19:07:32 +03:00
yuyi
e3caae9d57
cgen: fix struct init with multi option fn type (#19491) 2023-10-02 17:21:01 +03:00
l-m
7ebee2ed36
examples: add a brainfuck->wasm compiler example (#19492) 2023-10-02 14:42:02 +03:00
Delyan Angelov
8d98a21ff8
all: add support for @LOCATION, for more convenient logging/tracing, without needing to combine @FILE, @LINE at runtime (#19488) 2023-10-02 07:49:10 +03:00
yuyi
6bd45394f1
cgen: fix struct field of fixed array init (fix #19483) (#19487) 2023-10-01 22:11:20 +03:00
Alexander Medvednikov
f8693adfa2 checker: turn propagation warning into an error; sokol: make some structs public 2023-10-01 14:42:12 +03:00
Delyan Angelov
a79c574cb9
ci: fix v -cstrict vlib/builtin/array_test.v 2023-10-01 09:18:07 +03:00
Delyan Angelov
ec9ac7715a
builtin: add an unsafe { a.reset() } method, for quickly setting all bytes in an array to 0 2023-10-01 07:22:42 +03:00
Delyan Angelov
413da8be62
ci: fix misc-tooling, V self compilation with g++ and -std=c++11 2023-09-30 20:16:26 +03:00
Delyan Angelov
f5fc0f9ea2
ci: fix flaky vlib/v/tests/go_wait_option_test.v (error->none) 2023-09-30 20:05:06 +03:00
Delyan Angelov
c552ecf2b0
ci: fix vlib/net/tcp_test.v (change return type of one_shot_echo_server from ? to !) 2023-09-30 19:56:40 +03:00
Delyan Angelov
7d1eab7931
ci: fix vlib/v/gen/js/jsgen_test.v errors in js.v and option.v 2023-09-30 19:50:42 +03:00
Delyan Angelov
d850c4667a
ci: temporary workaround for the -autofree regression in the valgrind tests, caused by 773f961 2023-09-30 19:41:33 +03:00
Delyan Angelov
c030c5efa8
builtin: extract backtraces.c.v, backtraces_nix.c.v, backtraces_windows.c.v (#19480) 2023-09-30 19:24:31 +03:00
yuyi
80339c841a
cgen: fix printing fixed array of options (#19479) 2023-09-30 16:46:45 +03:00
Alexander Medvednikov
773f961736 checker: turn the option/result split warning into an error; readme: better wording 2023-09-30 16:40:26 +03:00