Commit Graph

8163 Commits

Author SHA1 Message Date
Benjamin Feng f51c8f26c1 Apply explicit error type 2020-03-12 09:19:32 -05:00
Benjamin Feng 78d12762a9 Re-enable a bunch of tests 2020-03-12 09:15:49 -05:00
Benjamin Feng 8241b96f78 Re-enable testFmt 2020-03-12 09:06:12 -05:00
Benjamin Feng e1e9ff9546 Get formatIntBuf working 2020-03-12 09:06:10 -05:00
Benjamin Feng 278b9ec1aa Blind translation 2020-03-12 09:04:18 -05:00
Benjamin Feng ae3fb6df00 Copy fmtstream 2020-03-12 08:58:36 -05:00
Andrew Kelley 895f67cc6d Merge pull request #4710 from ziglang/io-stream-iface
rework I/O stream abstractions
2020-03-11 18:54:52 -04:00
Andrew Kelley 571f3ed161 fix stray warn() in runtime safety test 2020-03-11 18:45:09 -04:00
Andrew Kelley 06d2f53ece windows: detect HANDLE_EOF in ReadFile 2020-03-11 17:39:53 -04:00
Andrew Kelley 3657a54618 fix regressions in elf parsing code 2020-03-11 17:34:12 -04:00
Andrew Kelley 6892865ba7 FixedBufferStream: match file semantics more by clamping pos 2020-03-11 16:14:12 -04:00
Andrew Kelley 04626c176b Merge remote-tracking branch 'origin/master' into io-stream-iface 2020-03-11 15:47:07 -04:00
Andrew Kelley 431d76c023 add std.io.StreamSource and fixes to emitRaw 2020-03-11 15:40:34 -04:00
Andrew Kelley c71991c869 fix compilation errors for emitRaw 2020-03-11 14:34:13 -04:00
Andrew Kelley 51c6bb92b1 Merge pull request #4709 from LemonBoy/implement-2096
Stricter shift left/right safety checks
2020-03-11 14:22:40 -04:00
Andrew Kelley d96b6c0d9f fix footguns in File readAll functions 2020-03-11 13:06:30 -04:00
Andrew Kelley ed13cffca4 rework some old ELF parsing code and start to fix emitRaw 2020-03-10 22:01:58 -04:00
Andrew Kelley bd14a81e30 fix std.ChildProcess on Windows 2020-03-10 21:09:49 -04:00
Andrew Kelley d882a30587 fix stage2 lib on windows 2020-03-10 20:51:30 -04:00
Andrew Kelley 2bff0dda79 fix regressions found by test suite 2020-03-10 20:22:30 -04:00
Andrew Kelley 9abee660dc fix stack trace code not opening files in forced blocking mode 2020-03-10 19:28:05 -04:00
Andrew Kelley cd26d3b0bb fix regressions caused earlier in this branch 2020-03-10 18:54:24 -04:00
LemonBoy 2f1052a313 std: Fix broken tests 2020-03-10 23:50:04 +01:00
Andrew Kelley 18f1fef142 update standard library to new I/O streams API 2020-03-10 18:44:30 -04:00
Michael Dusan 83f6f730cd std: simplify format enum-literals 2020-03-10 18:09:41 -04:00
LemonBoy 4ab13a359d ir: Fix shift code for u0 operands 2020-03-10 23:04:49 +01:00
Andrew Kelley b6fbd524f1 (breaking) improve and simplify fixed buffer streams API 2020-03-10 16:31:04 -04:00
LemonBoy 300fceac6e ir: Implement more safety checks for shl/shr
The checks are now valid on types whose size is not a power of two.

Closes #2096
2020-03-10 20:54:05 +01:00
Andrew Kelley ba0e3be5cf (breaking) rework stream abstractions
The main goal here is to make the function pointers comptime, so that we
don't have to do the crazy stuff with async function frames.

Since InStream, OutStream, and SeekableStream are already generic
across error sets, it's not really worse to make them generic across the
vtable as well.

See #764 for the open issue acknowledging that using generics for these
abstractions is a design flaw.

See #130 for the efforts to make these abstractions non-generic.

This commit also changes the OutStream API so that `write` returns
number of bytes written, and `writeAll` is the one that loops until the
whole buffer is written.
2020-03-10 15:32:32 -04:00
Vexu 1ad831a0ef fix zig fmt on noasync block 2020-03-10 15:27:11 -04:00
Jonathan Marler 90c232bbe8 add allocSentinel function 2020-03-10 15:03:59 -04:00
Andrew Kelley 9c4dc7b1bb Merge pull request #4703 from Vexu/translate-c
Translate-c improvements
2020-03-10 12:56:17 -04:00
LemonBoy 3e93dce0a1 std: Fix detection of Linux kernel version 2020-03-10 12:55:35 -04:00
Vexu cb4c488cbd translate-c support struct field alignment 2020-03-10 15:57:57 +02:00
Vexu 4cace8f7c3 properly mangle shadowed primitive types 2020-03-10 15:52:54 +02:00
Vexu baec74645d translate-c add daurnimator's pointer check to macro cast 2020-03-10 15:52:03 +02:00
Andrew Kelley 675f01f176 Merge pull request #4590 from xackus/fix-4587
fix failed assert on generic fn opaque return type
2020-03-09 22:10:57 -04:00
LemonBoy 1f44b29724 ir: Fix codegen of ?*T types where T is zero-sized
* Fix codegen for optional types that decay to a pointer, the type
  behaves as a boolean
* Fix comptime evaluation of zero-sized arrays, always initialize the
  internal array elements

Closes #4673
2020-03-09 22:08:56 -04:00
Andrew Kelley 638d5c3aca Merge pull request #4700 from Vexu/noasync
Implement new noasync syntax
2020-03-09 18:36:01 -04:00
xackus e7cc456421 better error messages and more tests 2020-03-09 22:33:18 +01:00
Andrew Kelley 52c01840ce Merge branch 'LemonBoy-fix-4527'
closes #4531
2020-03-09 14:24:51 -04:00
Andrew Kelley 7db6da7cb8 lazy_cmp_zero only resolves type is zero bits for alignof 2020-03-09 14:24:04 -04:00
LemonBoy 14bbb82832 ir: Fix lazy comparison between @alignOf and zero
Closes #4527
2020-03-09 14:05:38 -04:00
daurnimator 648f94c027 std: add some definitions for netlink sockets 2020-03-09 13:02:38 -04:00
Andrew Kelley 6ab156ce7d Merge pull request #4695 from leroycep/feature-inode-stat
Expose file inode number on posix and file index on windows
2020-03-09 13:01:26 -04:00
Ryan Liptak 9b1b44b41c Windows: Fix std.fs.realpath/os.realpathW for directories 2020-03-09 12:59:17 -04:00
Vexu 3fd2cd4367 add LemonBoy's test 2020-03-09 18:43:09 +02:00
Vexu 03c1431f9c disallow resume and suspend in noasync scopes 2020-03-09 15:51:51 +02:00
Vexu 3618256c97 implement noasync scopes 2020-03-09 12:33:24 +02:00
Vexu 6f8d732599 update parsers to new noasync syntax 2020-03-09 12:23:30 +02:00