lithdew
c8d721aa42
array_hash_map: decrement entries slice len after popping from entries in pop() to prevent oob
2021-03-28 11:02:37 +02:00
lithdew
4ce212739b
os/linux: handle ECONNRESET for recv
2021-03-25 12:41:51 -07:00
Sreehari S
5c28b8cd11
boot_services: implement locateDevicePath
2021-03-25 16:45:43 +02:00
Isaac Freund
3bf72f2b3a
std.build: make Builder.install_prefix non optional
...
This is useful for build.zig files to check in some cases, for example
to adhere to the convention of installing config to /etc instead of
/usr/etc on linux when using the /usr prefix. Perhaps std.build will
handle such common cases eventually, but that is not yet the case.
2021-03-24 12:29:50 +01:00
Carlos Zúñiga
187af14599
Fixed typo in user32
...
Use CreateWindowExW instead of RegisterClassExW as the type of pfnCreateWindowExW.
2021-03-22 10:43:04 +02:00
Joris Hartog
5e40560367
Specify type in autoHash error message
...
This commit simply specifies the type which `autoHash` can't hash in the
compile error.
Closes #7970 .
2021-03-21 23:07:02 +02:00
Nuno Leiria
0d96a284e8
std: Add reset to TokenIterator
2021-03-20 22:01:09 -07:00
LemonBoy
867ae506e3
std: Add syscall7 stub for Linux/MIPS
...
Some syscalls such as fadvise require an extra argument to comply with
the register pair alignment imposed by the ABI.
Wacky, isn't it?
2021-03-19 13:03:55 -07:00
Martin Wickham
96ae451bbe
Add some enum utilities
2021-03-18 14:05:01 -07:00
Jakub Konka
17c066e925
Merge pull request #8282 from kubkon/zld
...
macho: upstream zld linker
2021-03-18 19:14:17 +01:00
root
75a7abb0c4
std: Fix std.fs.path.joinZ
2021-03-18 14:33:38 +02:00
Jakub Konka
7516dfff83
zld: use zld when linking aarch64 by default and cross-comp
2021-03-18 00:37:13 +01:00
Jakub Konka
1ec620be62
zld: fix GOT loads and indirection on x86_64
2021-03-17 19:59:57 +01:00
Jakub Konka
a1b0ec5277
zld: start bringing x64 up to speed
2021-03-17 19:59:13 +01:00
Jakub Konka
b0ee480177
zld: merge and sort sections
2021-03-17 19:59:13 +01:00
Jakub Konka
0f7b036eb7
Merge pull request #8281 from kubkon/macho-got-refactor
...
stage2+macho: refactor global offset table for incremental linker
2021-03-17 19:44:32 +01:00
Frank Denis
119fc318a7
std/crypto/chacha20: add round-reduced versions & cleanup internals
...
See https://eprint.iacr.org/2019/1492.pdf for justification.
8 rounds ChaCha20 provides a 2.5x speedup, and is still believed
to be safe.
Round-reduced versions are actually deployed (ex: Android filesystem
encryption), and thanks to the magic of comptime, it doesn't take much
to support them.
This also makes the ChaCha20 code more consistent with the Salsa20 code,
removing internal functions that were not part of the public API any more.
No breaking changes; the public API remains backwards compatible.
2021-03-17 11:25:51 -07:00
Andrew Kelley
587243c7a5
Merge pull request #8273 from jedisct1/pbkdf2-check
...
crypto/pbkdf2: simplify the check for the max number of iterations
2021-03-17 11:25:19 -07:00
Jakub Konka
e5234c0e9e
macho: offset table part of GOT
2021-03-17 12:16:36 +01:00
Frank Denis
6d9b3e7b19
pbkdf2: use std.math.divCeil()
2021-03-17 10:11:47 +01:00
Evan Haas
f76bd56588
translate-c: fix __builtin_object_size
...
Previous code assumed `c_long` and `usize` were the same size.
Use `isize` instead.
2021-03-17 09:06:47 +02:00
Evan Haas
715370a10a
translate-c: demote usage of un-implemented builtins
2021-03-17 09:06:47 +02:00
xackus
9a94415680
translate-c: improve std.meta.cast
2021-03-17 00:05:42 +02:00
jacob gw
83d0c2ed67
std: make all errors in os.zig public
2021-03-16 14:48:31 -07:00
Frank Denis
f609c4ddb3
crypto/pbkdf2: use snake_case for variables like everywhere else
2021-03-16 19:08:38 +01:00
Frank Denis
d1b1e542a0
crypto/pbkdf2: simplify the check for the max number of iterations
2021-03-16 18:55:58 +01:00
Lewis Gaul
6787f163eb
zig fmt: don't add trailing whitespace on switch case
2021-03-16 09:26:28 +01:00
LemonBoy
5ecf8bddae
zig fmt: Respect line breaks in struct default value decls
...
Bring this in line with how variable declarations are handled.
Open a new indentation level for the initialization expression to handle
nested expressions like blocks.
Closes #7618
2021-03-16 09:22:16 +01:00
Anders Conbere
f16f25047c
std: support optional getaddrinfo arguments
2021-03-16 01:10:32 +01:00
Lewis Gaul
aa1c780560
Add test for multi-line while cont expr with same-line then expr
2021-03-15 20:44:45 +01:00
Isaac Freund
48efa3bcb6
zig fmt: simplify and improve consistency of if/for/while handling
...
The main realization here was that getting rid of the early returns
in renderWhile() and rewriting the logic into a mostly unified execution
path took things from ~200 lines to ~100 lines and improved consistency
by deduplicating code.
Also add several test cases and fix a few issues along the way:
Fixes https://github.com/ziglang/zig/issues/6114
Fixes https://github.com/ziglang/zig/issues/8022
2021-03-15 14:55:34 +01:00
Lewis Gaul
b4db03d8bb
zig fmt: fix extra newline before if nested in for
...
Add failing testcase to reproduce issue 8088
Tidy up renderWhile(), factoring out renderWhilePayload()
Ensure correct newline is used before 'then' token in while/for/if
Handle indents for 'if' inside 'for' or 'while'
Stop special-casing 'if' compared to 'for' and 'while'
2021-03-15 14:55:34 +01:00
LemonBoy
27d07c6c4d
std: Replace testing fns for floating-point values
...
Beside handling NaNs and other non-numeric values better we finally
offer the same pair of testing predicates in math and testing.
2021-03-14 17:23:47 -04:00
Frank Denis
b98d7747fa
Use a unified error set for std/crypto/*
...
This ensures that errors are used consistently across all operations.
2021-03-14 20:51:31 +01:00
LemonBoy
8ebb18d9da
std: Use more common escape sequences in Progress
...
This should fix the badly-rendered progress message when run in
Terminal.app.
2021-03-12 19:31:59 -05:00
Isaac Freund
b83ef595a5
std/linux: sync io_uring library with liburing
...
liburing commit: 1bafb3ce5f
As stated in the liburing commit message, this fixes a regression,
reverting code that was added specutively to avoid a syscall in some
cases.
2021-03-12 22:22:06 +01:00
Andrew Kelley
f950489ed9
Merge pull request #8174 from LemonBoy/progress-line-wrap
...
std: Better handling of line-wrapping in Progress
2021-03-12 15:45:11 -05:00
Jakub Konka
a745e704f6
macos: add missing x86_64 libc headers
2021-03-12 18:05:50 +01:00
LemonBoy
b0724a350f
Handle some weird edge cases of Win32 API
...
Sometimes the viewport srWindow may report an invalid rectangle where
the top row is below the bottom one.
2021-03-12 17:14:50 +01:00
LemonBoy
b5a50a26eb
Fix many thinkos
...
Somehow I forgot to save after copy-pasting some code and changing it.
2021-03-12 15:08:48 +01:00
Sébastien Marie
89e522b935
make std.c.getErrno() return same type as _errno() aka c_int
...
adjust std.os.unexpectedErrno() to be correct for all std.os.system.errno (c_int, u12, usize, ...)
2021-03-12 15:04:36 +01:00
LemonBoy
3010bfb08a
Fix Progress printing on Windows systems
...
The cursor must be restored after the line is printed, not before.
Take into account the visible viewport to correctly compute the terminal
size.
2021-03-12 10:15:38 +01:00
Andrew Kelley
e9a038c33b
Merge pull request #7934 from Vexu/stage2-cbe
...
Stage2 cbe: optionals and errors
2021-03-11 22:02:35 -05:00
Isaac Freund
a5cb4ab95e
parser: disallow ptr modifiers on array types
2021-03-12 00:18:30 +01:00
LemonBoy
482424e2b1
std: Handle empty MultiArrayList in items()
...
Closes #8211
2021-03-12 00:17:35 +01:00
Andrew Kelley
4fc6f631e0
Merge pull request #8126 from xackus/translate_c_int_literal_promotion
...
translate-c: promote int literals to bigger types
2021-03-11 14:32:37 -05:00
Asherah Connor
24e5959840
elf: make EM non-exhaustive
2021-03-11 10:09:51 +11:00
Asherah Connor
c5eb15526d
expose machine field in ELF header
2021-03-10 16:26:41 +11:00
Loris Cro
a033735c8d
update to latest fetch-them-macos-headers
2021-03-09 22:43:16 +01:00
Loris Cro
767eb2d469
update to latest fetch-them-macos-headers
2021-03-09 22:15:01 +01:00