Commit Graph

9505 Commits (2c7fc1c5c504af9dd22d5ac21ecc6773e263e395)

Author SHA1 Message Date
Luna c7b790ded6 net.test: only call resolveIp6 when os is linux 2020-06-02 14:56:06 -04:00
Luna 15efe03d1f Add tests for overflow 2020-06-02 14:56:06 -04:00
Luna b72c862725 Use IFNAMESIZE for scope id value 2020-06-02 14:56:06 -04:00
Luna aebf28eba3 Make ifru fields sentinel-terminated 2020-06-02 14:56:06 -04:00
Luna c60daa255f Replace C types in declarations 2020-06-02 14:56:06 -04:00
Luna 2fa9cf51ff Plug resolveIp6 into IPv6 tests 2020-06-02 14:56:06 -04:00
Luna 64e55a74de Add validation for scope ids 2020-06-02 14:56:06 -04:00
Luna 10ea2db5cb Replace C shorts by integer types 2020-06-02 14:56:06 -04:00
Luna 11a06d4341 Remove warn() calls 2020-06-02 14:56:06 -04:00
Luna cb649b769c Fix ifreq definition 2020-06-02 14:56:06 -04:00
Luna c50ac9a764 Change Unsupported to InterfaceNotFound 2020-06-02 14:56:06 -04:00
Luna 38109d48a3 Make interface name null-terminated before syscall 2020-06-02 14:56:06 -04:00
Luna 5919831529 Stop using mem.len on array 2020-06-02 14:56:06 -04:00
Luna 901aab8761 Add ioctl errors 2020-06-02 14:56:06 -04:00
Luna 2c641c93da Only resolve scope id when needed 2020-06-02 14:56:06 -04:00
Luna f02f4c0880 Fix typo and add if_nametoindex 2020-06-02 14:56:06 -04:00
Luna 9c200035f3 Add some interface structs to linux bits 2020-06-02 14:56:06 -04:00
Luna b816303122 Add basics of resolveIp6
Instead of streaming the scope id digits to an u32, we keep a [32]u8 in
the stack and fill it up with the characters we get for scope id.
2020-06-02 14:56:05 -04:00
Andrew Kelley bae0c9b554 std.HashMap: allow ensureCapacity with a zero parameter 2020-06-02 14:41:45 -04:00
Veikka Tuominen 40a1cfed53
Merge pull request #5510 from jessrud/arraylist-fix
pass allocator to self.resize() in appendNTimes()
2020-06-02 18:13:55 +03:00
Jesse Rudolph 100aa6fbaf pass allocator to self.resize() in appendNTimes() 2020-06-02 09:59:13 -05:00
Alexandros Naskos aa1a727284 Allow carriare return in comments 2020-06-02 00:56:05 -04:00
Andrew Kelley c6764fd254
Merge pull request #5475 from marler8997/windowsDns
support name resolution on windows
2020-06-01 15:33:05 -04:00
Andrew Kelley 8f4bc77260
Merge pull request #5449 from data-man/more_traits
Add more traits
2020-06-01 14:50:01 -04:00
Andrew Kelley f9b220ec2c Merge branch 'brodeuralexis-zero-init-helper'
closes #5472
2020-06-01 14:47:55 -04:00
Andrew Kelley 109c0b9d96 rename std.mem.defaultInit to std.mem.zeroInit 2020-06-01 14:47:18 -04:00
Alexis Brodeur c0e5eca6f2 Add initialization helper
When using C libraries, C99 designator list initialization is often
times used to initialize data structure.

While `std.mem.zeroes` and manually assigning to each field can
achieve the same result, it is much more verbose then the equivalent
C code:

```zig
usingnamespace @cImport({
    @cInclude("sokol_app.h");
});

// Using `std.mem.zeroes` and manual assignment.
var app_desc = std.mem.zeroes(sapp_desc);
app_desc.init_cb = init;
app_desc.frame_cb = frame;
app_desc.cleanup_cb = cleanup;
app_desc.width = 400;
app_desc.height = 300;
app_desc.window_name = "no default init";

// Using `std.mem.defaultInit`.
var app_desc = std.mem.defaultInit(sapp_desc, .{
    .init_cb = init,
    .frame_cb = frame,
    .cleanup_cb = cleanup,
    .width = 400,
    .height = 300,
    .window_name = "default init"
});
```

The `std.mem.defaultInit` aims to solve this problem by zero
initializing all fields of the given struct to their zero, or default
value if any.  Each field mentionned in the `init` variable is then
assigned to the corresponding field in the struct.

If a field is a struct, and an initializer for it is present, it is
recursively initialized.
2020-06-01 14:45:35 -04:00
Sebastian 937dcad0b3 fixed timestamp() 2020-06-01 14:43:13 -04:00
Alexandros Naskos 215a0d61ab Fix evented builds on windows with runtime safety on 2020-06-01 14:22:45 -04:00
Veikka Tuominen 078e4afdaf
Merge pull request #5500 from Vexu/fix
Fix std.zig rejecting literal tabs in comments
2020-06-01 17:24:30 +03:00
Veikka Tuominen eb687810cf
Merge pull request #4976 from xackus/std-lib-docs
std lib docs: fix null and int values
2020-06-01 14:50:05 +03:00
Veikka Tuominen 8c5c860b00
Merge pull request #5443 from data-man/mem_len_vectors
Support vectors in mem.len
2020-06-01 14:44:38 +03:00
Vexu a47257d9b0
fix std.zig rejecting literal tabs in comments 2020-06-01 14:37:36 +03:00
Jonathan Marler 0d32f4acf7 enable dns test on windows 2020-05-31 11:58:50 -06:00
Veikka Tuominen f5eb31a55a
Merge pull request #5491 from xackus/fix_5487
stage1: fix unresolved inferred error sets
2020-05-31 20:48:04 +03:00
daurnimator f5167f73e8 deps/SoftFloat-3e/: commit with LF line endings
`git add --renormalize .`

For text files, git expects that all files are commited with LF line endings,
it then (optionally) swaps to CRLF on checkout depending on .gitattributes and
git config.
2020-05-31 12:18:31 -04:00
Jonathan Marler 58fb5b29b6 more windows network fixes
* support posix SOCK_NONBLOCK and SOCK_CLOEXEC flags on windows
* fix bugs in os.socket and os.connect to return at the correct place
2020-05-31 10:07:51 -06:00
Veikka Tuominen 899d79f8f0
Merge pull request #5478 from vrischmann/fix-iouring
linux: fix IOSQE_BIT decl and io_uring_sqe flags
2020-05-31 16:59:04 +03:00
Veikka Tuominen 30b2bc86b9
Merge pull request #5477 from alexnask/patch-1
Fix WSARecvFrom signature
2020-05-31 16:49:08 +03:00
Veikka Tuominen 21544267ee
Merge pull request #5481 from kubkon/typo-packedintarray
Fix typo in PackedIntArray tests
2020-05-31 16:48:19 +03:00
xackus 250dd9ac21 stage1: fix unresolved inferred error sets 2020-05-31 15:04:34 +02:00
Veikka Tuominen 557d75d58a
Merge pull request #5480 from Vexu/fix
Fix zig fmt out of bounds on empty file
2020-05-31 13:50:03 +03:00
Jakub Konka 13c405127d Fix typo in PackedIntArray tests
Both `PackedIntArray` and `PackedIntSlice` tests defined `max_bits`
but didn't use it in the predicate in the inline while loop.
2020-05-30 23:17:55 +02:00
Vexu 010c58e303
fix zig fmt out of bounds on empty file 2020-05-30 23:07:51 +03:00
Jonathan Marler 2bae91e769 convert getaddrinfo rc to enum before switching on it 2020-05-30 09:56:52 -06:00
Vincent Rischmann 636d3ba780
linux: fix IOSQE_BIT decl and io_uring_sqe flags 2020-05-30 16:05:46 +02:00
Alexandros Naskos dbdacb0938
Fix WSARecvFrom signature
The lpFromLen should be a pointer.
2020-05-30 16:46:32 +03:00
Jonathan Marler 2eaab1e65e more windows network support, including dns 2020-05-29 22:38:48 -06:00
foobles 51682717d7 Support equality comparison for optional to non-optional (?T ==/!= T)
extracted function ir_try_evaluate_bin_op_const
extracted type_is_self_comparable function
renamed ir_try_evaluate_bin_op_const to ir_try_evaluate_bin_op_cmp_const
implemented analysis of ?T == T
added ir_set_cursor_at_end_and_append_basic_block_gen
use build_br_gen and ir_set_cursor_at_end_and_append_block_gen
added ir_append_basic_block_gen
removed include of all_types in ir.cpp
extracted compile-time and runtime evaluation of cmp_optional_non_optional to separate functions

closes #5390
closes #1332
2020-05-29 18:46:09 -04:00
Andrew Kelley f107d654e0 Merge branch 'gereeter-reduced-path-max'
closes #4837
2020-05-29 18:41:40 -04:00